Preprocessing in uflacs representation fails to renumber the domain coordinates coefficient properly

Issue #40 resolved
Martin Sandve Alnæs created an issue

This code crashes:

from dolfin import *
parameters["form_compiler"]["representation"] = "uflacs"
m = 10
mesh = UnitSquareMesh(m, m)
Vx = VectorFunctionSpace(mesh, "Lagrange", 2)
x = Function(Vx)
D = Domain(x)
V = FunctionSpace(D, "Lagrange", 2)
f = Function(V)
M = f*dx(D)
print assemble(M)

because the generated code accesses "w[4]" and "w[1]" but that should be "w[0]" and "w[1]", after the canonical renumbering of coefficients. The reason is found and commented in ffc/uflacsrepr/uflacsrepresentation.py in the branch martinal/topic-include-domain-coordinates-in-form-coefficients which has a sister branch in ufl with the same name fixing some earlier issues with the above code sample.

Comments (2)

  1. Log in to comment