This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Constant(cell) in UFL file

+1 vote

Hi Everyone, I'm seeing an issue with a simulation on a surface embedded in 3D where a Poisson equation is solved on the surface. The simulation was working circa six weeks ago but now throws an exception when the linear solver is called. I think I've tracked it down to something in the UFL file. In my code there is a line in Poisson.ufl:

c = Constant(cell)

This file compiles, and the main.cpp which includes the header also compiles but an exception is thrown when the solver is called. The dolfin error message indicates (to me) that the line above should not be allowed in the UFL file.

I'm sorry but I don't see how to attach a file to this question, but I have the code (C++, which is very simple) if anyone would like to take a look at it.

Thanks,
Dave

The contents of Poisson.ufl in the problematic bit is:

cell = Cell("triangle", geometric_dimension=3)
element = FiniteElement("Lagrange", cell, 2)
u = TrialFunction(element)
v = TestFunction(element)
c = Constant(cell)
a = inner(grad(u), grad(v))dx
L = c
v*dx
forms = [a, L]

asked May 2, 2014 by david.bernstein FEniCS User (2,000 points)
...