I (think) I want to use PartExtracter to split a form into parts involving different arguments. The result I would like in a ufl.Form a_u1 is the first part of the ufl.Form a.
Any ideas? I'm guessing one of the UFL masters knows how to do this.
from dolfin import *
mesh = UnitSquareMesh(10, 10)
V = FunctionSpace(mesh, "CG", 1)
U = MixedFunctionSpace([V, V])
u = TrialFunction(U)
v = TestFunction(U)
u1, u2 = split(u)
v1, v2 = split(v)
a = inner(u1, v1)*dx + inner(u2, v2)*dx
print dir(a)
import ufl.algorithms.formtransformations
extractor = ufl.algorithms.formtransformations.PartExtracter(u1)
a_u1 = extractor.visit(a)
The above code fails with the error:
Traceback (most recent call last):
File "extractor.py", line 17, in <module>
a_u1 = extractor.visit(a)
File "/home/fenics/build/lib/python2.7/site-packages/ufl/algorithms/transformer.py", line 94, in visit
h, visit_children_first = self._handlers[o._ufl_typecode_]
AttributeError: 'Form' object has no attribute '_ufl_typecode_'