← Back to team overview

dolfin team mailing list archive

Re: Input/output for FiniteElement

 

Some more thoughts: Maybe we should keep the FiniteElement interface
as simple as possible and just have simple inheritance from a protocol
class in the same way as for BilinearForm and LinearForm? These three
classes are somewhat special and we can't really store them to an XML
file.

The only thing we can store is some kind of identification, so it
seems we need a new class, something like FiniteElementIdentifier or
FiniteElementSpecification (name suggestions welcome) that we can
read/write to file. That would make it possible to do

  FiniteElementSpecification specification;
  file >> specification;
  FiniteElement* element = FiniteElement::makeElement(specification);

This would mainly be used when reading/writing functions and mostly
hidden so it is somewhat special.

Any thoughts?

/Anders


On Thu, Feb 16, 2006 at 11:30:32AM -0600, Anders Logg wrote:
> 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
> 
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev
> 

-- 
Anders Logg
Research Assistant Professor
Toyota Technological Institute at Chicago
http://www.tti-c.org/logg/



Follow ups

References