Failure to select quadrature rule for empty forms
Issue #48
resolved
Was - Empty integrals are not detected early enough
This dolfin program from @Gabrielbalaban results in an internal error in ffc that is the result of having 0 integrals in the form, which should probably be detected at an earlier stage.
from dolfin import *
mesh = UnitCubeMesh(1,1,1)
M = VectorFunctionSpace(mesh,"CG", 2)*FunctionSpace(mesh, "DG", 0)
U = Function(M)
vq = TestFunction(M)
#This one produces a cryptic error message.
u,p = U.split()
#This one works fine.
#u,p = split(U)
F = grad(u) + Identity(3)
psi = tr(F) - 3 + p*(det(F) - 1)
R = derivative(psi*dx, U, vq)
assemble(R)
Comments (6)
-
reporter -
reporter -
assigned issue to
-
assigned issue to
-
reporter I've fixed the actual bug here, the choice of quadrature rule now defaults to canonical when the form is empty. Changing the last line in the example here to
r = assemble(R) print r print norm(r)
will work as it should, giving a zero vector instead of the cryptic error message.
Note that 'as it should' is not 'as Gabriel expected', because U.split() and split(U) are fundamentally different operations, but that is a whole other issue already in the bug tracker somewhere.
-
reporter - changed title to Failure to select quadrature rule for empty forms
- edited description
-
reporter - changed status to resolved
-
reporter - removed milestone
Removing milestone: 1.5 (automated comment)
- Log in to comment