dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #01998
Input/output for FiniteElement
I have done some initial work on input/output for FiniteElement.
The XML data for a FiniteElement will simply be something like
<finiteelement type="Lagrange" shape="triangle" degree="3" vectordim="2"/>
My first thought was to create a static "factory function" in
FiniteElement that creates a new FiniteElement from given type, shape,
degree and vectordim. (See current FiniteElement.h in repository.)
This would match the current design of FiniteElement that works as an
"interface" or "protocol" to each specific implementation (subclass)
generated by FFC.
The problem with this comes when you want to do something like
FiniteElement element;
file >> element;
or
FiniteElement element("Lagrange", "triangle", 3, 2);
To allow this, we would have to design the FiniteElement class
differently, using the envelope-letter design that we already have for
Function and File. This would make the FiniteElement class much more
flexible and I think the overhead will be minimal compared to the work
that is done by for example FiniteElement::eval() during assembly.
Or perhaps this flexibility is not needed for FiniteElement?
/Anders
Follow ups