FFC fails for non-affine cells when quadrature degree is not set

Issue #100 resolved
Prof Garth Wells created an issue

Code to reproduce:

from dolfin import *
parameters["form_compiler"]["representation"] = "uflacs"
mesh = UnitDiscMesh(mpi_comm_world(), 1, 2, 2)
V = FunctionSpace(mesh, "Lagrange", 1)
assemble(1.0*dx(mesh))

whereas

from dolfin import *
parameters["form_compiler"]["representation"] = "uflacs"
mesh = UnitDiscMesh(mpi_comm_world(), 1, 2, 2)
V = FunctionSpace(mesh, "Lagrange", 1)
assemble(1.0*dx(mesh, degree=2))

works.

Comments (9)

  1. Martin Sandve Alnæs

    So what's happening is that with degree 1, the table of derivatives of CG2 contains a zero at the end, which is optimized away in the precomputed element tables, and the dofrange (end-begin) is mistakenly used to be the size of the per-component element space but is short by 1.

    So the actual size of the coordinate dofs array needs to be passed explicitly from somewhere to be accessible in the backend definitions.

  2. Martin Sandve Alnæs

    I.e. setting degree=1 above will also fail. The reason it "worked" before was that we never got that low degree with the previous degree estimation. I think the degree estimation might be wrong to use degree 1 here though, because it doesn't cater for the |detJ| factor and only looks at the integrand.

  3. Martin Sandve Alnæs

    Fix issue 100.

    Temporary fix for bug where table of jacobian values of high-order coordinates was compacted because of trailing zeros in precomputed table. Using formula to compute number of scalar dofs correctly for Lagrange 1-3 on simplices, which is all dolfin supports for now. Should rather get the dimension from element tables but those are so messy and this is sufficient for now.

    Refactor jacobian and spatial_coordinate handlers to reuse all the code, they only differ in which table data they use.

    Other minor simplifications.

    → <<cset 7d0b6bca7154>>

  4. Martin Sandve Alnæs

    Fix in next. Using the same formula for number of coordinate dofs that dolfin currently uses, a more generic solution would be better in the long run but it's fine now.

  5. Log in to comment