Hello, in a minimal code example i get the error [0] Matrix is missing diagonal entry in row 25 if i use the PETSc method zeroRows() to apply my boundary conditions. I use this formulation because i split my formulation for the operators of the Stokes operators on a mixed function in order to decouple the pressure. The documentation states, that keep_diagonal preserves all diagonal entries, which is maybe not the case here?
from dolfin import * from petsc4py import PETSc mesh = UnitSquareMesh(4, 4) V = VectorFunctionSpace(mesh, "CG", 2) Q = FunctionSpace(mesh, "CG", 1) u = TrialFunction(V) v = TestFunction(V) p = TrialFunction(Q) q = TestFunction(Q) a = div(v) * p * dx # Define boundary condition u0 = Constant((0.0, 0.0)) bc = DirichletBC(V, u0, 'on_boundary') M = PETScMatrix() assemble(a, tensor=M, keep_diagonal=True) # This operation succeeds bc.zero(M) # Extract the boundary dofs bcdict = bc.get_boundary_values() bcinds = bcdict.keys() # This one fails M.mat().zeroRows(bcinds) _______________________________________________ fenics mailing list [email protected] http://fenicsproject.org/mailman/listinfo/fenics
