Skip to content

Reduced Jacobian of Linear Operator as (Fenics) Integral #2116

Answered by Frostyant
Frostyant asked this question in Q&A
Discussion options

You must be logged in to vote

I solved the issue as follows.

First you have to add in the missing contributions from the boundaries manually via

def add_diagonal_contributions(A_ij,basis_i,basis_j,bcs):
    for bc in bcs:
        dofs = bc.get_boundary_values().keys()
        for dof in dofs:
            A_ij += basis_i[dof]*basis_j[dof]
    return A_ij

Then you have to apply 0-boundary conditions to v and compute the integral as above via assemble.
This process simulates setting a row of the matrix to [0,...,0,1,0,...,0] and the corresponding right hand-side term to the boundary value when you consider the discretized matrix equation Au=b.

In my tests it was slower than just doing it directly via pymor at higher res…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Frostyant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant