← Back to team overview

ffc team mailing list archive

Re: Add support for arbitrary mixed elements (experimental and untested). [...]

 

No, you can have any number of elements:

    P1 = FiniteElement("Lagrange", "triangle", 1)
    P2 = FiniteElement("Vector Lagrange", "triangle", 2)
    P3 = FiniteElement("Vector Lagrange", "triangle", 3)
    TH = P2 + P1 + P3
    element = P1 + TH + P3 + TH + TH + P3 # :-)

etc.

You can also initialize a mixed element from a list of elements:

    TH = MixedElement([P2, P1])

/Anders

On Tue, Sep 20, 2005 at 07:19:52PM +0200, Garth N. Wells wrote:

> This looks really nice, and will be really useful. Is it limited to
>two fields?
> 
> Garth
> 
> 
> 
> Quoting ffc@xxxxxxxxxx:
> 
> > Commit from logg (2005-09-20 17:06 CEST)
> > ----------------
> > 
> > Add support for arbitrary mixed elements (experimental and untested).
> > 
> > The following code creates a Taylor-Hood element:
> > 
> >   P1 = FiniteElement("Lagrange", "triangle", 1)
> >   P2 = FiniteElement("Vector Lagrange", "triangle", 2)
> >   TH = P2 + P1
> > 
> >   (v, q) = BasisFunctions(TH)
> >   (u, p) = BasisFunctions(TH)
> > 
> >   ffc  ChangeLog                          1.76
> >   ffc  src/bin/ffc                        1.21
> >   ffc  src/ffc/compiler/dofmap.py         1.19
> >   ffc  src/ffc/compiler/finiteelement.py  1.24
> >   ffc  src/ffc/compiler/integrator.py     1.16
> >   ffc  src/ffc/compiler/pointmap.py       1.6
> > 
> > _______________________________________________
> > FFC-dev mailing list
> > FFC-dev@xxxxxxxxxx
> > http://www.fenics.org/cgi-bin/mailman/listinfo/ffc-dev
> > 
> 
> _______________________________________________
> FFC-dev mailing list
> FFC-dev@xxxxxxxxxx
> http://www.fenics.org/cgi-bin/mailman/listinfo/ffc-dev
> 

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



References