how to do symmetric imposition of bcs without reassembling matrix?
Suppose I want to solve the linear system corresponding to a linear
variational problem subject to Dirichlet boundary conditions
many times with different right hand sides (e.g., as part of
a time-stepping loop). I may choose to do this by assembling
the matrix, applying the boundary conditions, and then doing a
Cholesky decomposition or other preprocessing to make the matrix
solves speedy. For each right hand side I then have to apply the
boundary conditions. In FEniCS I can do this with something like
A = assemble(a) # assemble the matrix
bc.apply(A) # apply the boundary conditions to the matrix
<set up Solver for A>
<loop over right hand sides>
...
b = assemble(L) # assemble rhs
bc.apply(b) # apply the boundary condition to the rhs
Solver.
But this applies the boundary conditions in the nonsymmetric way,
destroying the symmetry of the matrix A.
I could used
A, b = assemble_system(a, L)
which preserves the symmetry, but then I have to reassemble the matrix
for each right hand side.
Is there a way to do symmetric imposition of boundary conditions, without
reassembling the matrix? I don't see any reason it is not doable,
but have not found how to specify it to dolfin.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Doug Arnold
- Solved:
- Last query:
- Last reply: