-
Notifications
You must be signed in to change notification settings - Fork 179
Closed
firedrakeproject/tsfc
#269Description
Consider a form that only depends on the jump of CG(1) test and trial functions.
Calling assemble(a, diagonal=False) gives a matrix of zeros, which is the expected output.
On the other hand, assemble(a, diagonal=True) gives non-zeros. For DG(1), the diagonal is also incorrectly computed.
Here is the minimal failing example:
from firedrake import *
mesh = UnitIntervalMesh(2)
V = FunctionSpace(mesh, "CG", 1)
u = TrialFunction(V)
v = TestFunction(V)
n = FacetNormal(mesh)
outer_jump = lambda w, n: outer(w('+'), n('+')) + outer(w('-'), n('-'))
a = inner(outer_jump(v, n), outer_jump(u, n)) * dS
A = assemble(a)
print(A.petscmat.view())
diag = assemble(a, diagonal=True)
with diag.dat.vec as x:
print(x.view())
Giving the output:
Mat Object: 1 MPI processes
type: seqaij
row 0: (0, 0.) (1, 0.) (2, 0.)
row 1: (0, 0.) (1, 0.) (2, 0.)
row 2: (0, 0.) (1, 0.) (2, 0.)
None
Vec Object: 1 MPI processes
type: seq
0.
2.
0.
None
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels