dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #10831
Questions about new PyDOLFIN Functions design
How do you intend to handle (sub)functions in a mixed space?
Currently I don't see how the function space stuff generalizes
to even simple mixed spaces.
Take this simple example in a pure form language (FFC or UFL):
element1 = VectorElement("CG", "triangle", 2)
element2 = FiniteElement("CG", "triangle", 1)
mixed_element = element1 + element2
f, g = Functions(mixed_element)
Now in PyDOLFIN, would a function space be defined by (reusing the elements):
space1 = FunctionSpace(mesh, element1)
space2 = FunctionSpace(mesh, element2)
mixed_space1 = space1 + space2
or:
mixed_space2 = FunctionSpace(mesh, mixed_element)
and would the functions in this space be
f, g = Functions(mixed_space)
or
fg = Function(mixed_space)
f, g = fg.sub(0), fg.sub(1)
?
Neither of these two definitions of (f, g) works out.
The syntax
f, g = Functions(mixed_space)
doesn't work, since ufl.Functions does not return ufl.Function objects,
but ufl.Indexed objects that refer to subexpressions of ufl.Function objects.
The syntax
fg = Function(mixed_space)
f, g = fg.sub(0), fg.sub(1)
would require that sub returns something that is a subclass of what
ufl.Functions returns (ufl.Indexed) and at the same time is a dolfin.Function.
--
Martin
Follow ups