Quoting Shawn Walker <walker@xxxxxxxxxxxxxxx>:
Hello. I would like to know how hard it would be to modify FFC (and UFL)
to do the following.
Here is the sample .ufl file:
Poisson.ufl
------------------------------------------
element = FiniteElement("Lagrange", "triangle", 2)
vector = VectorElement("Lagrange", "triangle", 2)
v = TestFunction(element)
u = TrialFunction(element)
f = Function(element)
G = Function(vector)
a = inner(grad(v), grad(u))*dx
L = v*f*dx
------------------------------------------
And I would like to do the following in C++:
// in C++
a.G = Some_Function;
Basically, I just want to attach to `a' some external function that does
NOT appear in the bilinear form. How hard would that be? I'm not sure
what the UFL syntax should be. This is for the higher order mesh stuff.
I'm sure it's possible, but does it make sense that a has a function attached on
which it does not depend?
The code that will be generated from this form, will not use G in any way, so
how do you plan on using it? For higher order mesh stuff, should one not just
use:
triangle = Cell("triangle", 2) # Cell() is defined in geometry.py in UFL
and then define the finite element as:
element = FiniteElement("CG", triangle, 1)
maybe we should/could attach the function G to the cell if you intend to use
this to compute the geometry?
Kristian