← Back to team overview

ufl team mailing list archive

Re: FiniteElement classes

 

2008/3/14, Anders Logg <logg@xxxxxxxxx>:
> On Thu, Mar 13, 2008 at 05:46:03PM -0400, Marie Rognes wrote:
'>  > Just a comment: I typically want to write something like
>  >
>  >     VectorElement("Nedelec", ...)
>  >
>  > in order to have a vector of Nedelec elements...!

So, does that represent a tensor field? I've implemented value_rank()
in the VectorElement and TensorElement that way, so the value rank of
a VectorElement is the value rank of the subelement (Nedelec) plus
one. Thus each row of the tensor is represented by a Nedelec element.

If you want a set of vector elements instead:
  fe = FiniteElement("Nedelec",...)
  me = MixedElement(fe, fe, fe)
  # or
  me = fe+fe+fe
should also work. The value rank of a MixedElement constructed one of
these ways is undefined, since Functions should be defined over its
subelements anyway.

> Take a look in the new elements.py. I have added some information
>  about the ranks of different elements and a possibility to register
>  new elements. I don't think ScalarElement will be needed. Just as
>  before, we have two things: FiniteElement and MixedElement and then
>  VectorElement and TensorElement as special cases of MixedElement.
>
>  The file ufl_io.py was missing so I couldn't run the code, so it's
>  probably broken in a few places...

It works now. I removed the QuadratureElement and made it a family
instead. So we can write:

fe = FiniteElement("Quadrature", "triangle") # degree should be None by default
fe = VectorElement("Quadrature", "triangle")
fe = TensorElement("Quadrature", "triangle")
# or short form
fe = FiniteElement("Q", "triangle")

In addition, we need a quadrature element for functions evaluated only
at the boundary, since quadrature points in a cell may not lie on the
boundary at all:

fe = VectorElement("Boundary Quadrature", "triangle")

I'm not sure wether we need to have one for exterior facets and one
for interior facets though. We'll have to think about it over easter.

--
Martin


Follow ups

References