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

UFL Form names

0 votes

What are the "valid" Form names in UFL? If I take this example and compile it with ffc I get a Form_M in the header file. However if I change M to G it doesn't compile (while with a, L, F it works).

element = FiniteElement("Lagrange", triangle, 2)
v = Coefficient(element)
M = (v*v + dot(grad(v), grad(v)))*dx
asked Apr 4, 2016 by str FEniCS User (1,600 points)

1 Answer

+2 votes
 
Best answer

The default valid form names seem to be a, L, M (and in certain conditions, F and J), but you can define more by adding a forms list to the bottom of your UFL file, for example, to use G instead of M:

element = FiniteElement("Lagrange", triangle, 2)
v = Coefficient(element)
G = (v*v + dot(grad(v), grad(v)))*dx
forms = [G]

which will result in Form_G in the header file.

See this section in the UFL documentation for more information. I believe the relevant section of the UFL source code which defines the default forms to be exported is here.

answered Apr 7, 2016 by FF FEniCS User (4,630 points)
selected Apr 10, 2016 by str

Nice digging :)

...