Subject: Re: [UFL-dev] implementasjon av isoparametrisk mapping

From: Anders Logg <[email-masked]>
Date: Thu, 1 Nov 2007 00:47:08 +0100

On Tue, Oct 30, 2007 at 09:57:18AM +0100, Martin Sandve Alnæs wrote:
> 2007/10/29, Anders Logg <[email-masked]>:
> > On Fri, Oct 26, 2007 at 01:23:11PM +0200, Kent-Andre Mardal wrote:
> > > fre, 26.10.2007 kl. 12.09 +0200, skrev Martin Sandve Alnæs:
> > > > Den 25.10.07 skrev [email-masked] <[email-masked]> følgende:
> > > > > geometry_element = FiniteElement("Hermite", "triangle", 3)
> > > > > uknown_element = FiniteElement("Lagrange", "triangle", 1, geometry_element)
> > > >
> > > > Eller:
> > > >
> > > > cell = Cell(polygon, mapping="affine", order=1)
> > > > cell = Cell("triangle")
> > > > cell = Cell("triangle", "affine")
> > > > cell = Cell("triangle", "Hermite", 3)
> > > > cell = Cell("triangle", "isoparametric", 2)
> > > >
> > > > element = FiniteElement("Lagrange", cell, 1)
> > > > element = FiniteElement("Hermite", cell, 3)
> > >
> > > What we typically do is that we define the global element in terms of a
> > > mapped reference element (as we know this is not always a smart thing to
> > > do cf. the Rannacher-Turek element).
> > >
> > > Anyway, we could then have
> > >
> > > reference_element = ReferenceElement("Lagrange", "triangle", 3)
> > >
> > > mapping = Mapping("isoparametric", 3)
> > >
> > > global_element = FiniteElement(reference_element, mapping)
> > >
> > >
> > > Here Mapping could be e.g. affine, Piola, isoparametric, Hermite
> > >
> > >
> > > The short cut can be
> > >
> > > fe = FiniteElement("Lagrange", "triangle", "affine", 3)
> >
> > Looks good to me, but it would be good to have the mapping as the last
> > argument (so it could be left out when using the default mapping).
> >
> > /Anders
> 
> The backside is that we must use FiniteElement.__init__(self, *args,
> **kwargs) to enable different constructor arguments in Python, I'm not
> a big fan of that. It would be nice to avoid that if we can.

Why? Isn't it enought do do

  def __init__(family, shape, degree, mapping="affine"):
      ...

/Anders

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Thu, 1 Nov 2007 07:31:36 +0100

-- 
Martin

---

From: [email-masked]
Date: Thu, 1 Nov 2007 09:00:05 +0100 (CET)

>> > global_element = FiniteElement(reference_element, mapping)

OK, I think

cell = Cell(polygon, geometry="Lagrange", order=1)
element = FiniteElement("Lagrange", cell, 1, geometry_mapping="affine")

is sufficient.

We need the geometry_mapping parameter in addition to cell.

---

From: Anders Logg <[email-masked]>
Date: Thu, 1 Nov 2007 22:43:22 +0100

> element = FiniteElement("Lagrange", cell, 1, geometry_mapping="affine")

It seems more natural to put the information about the type of mapping
in the mapping argument. It looks like it's now in two places (cell
and geometry_mapping)?

/Anders

> _______________________________________________
> UFL-dev mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/ufl-dev

---

From: Kent-Andre Mardal <[email-masked]>
Date: Fri, 02 Nov 2007 00:48:16 +0100

> in the mapping argument. It looks like it's now in two places (cell

But it may be two separate things. First, the mapping of the geometry
from the reference geometry to the global geometry. Then the mapping 
of the basis functions from the reference element to the global
element.  

Kent

---

From: Anders Logg <[email-masked]>
Date: Fri, 2 Nov 2007 18:14:13 +0100

> of the basis functions from the reference element to the global

Sounds reasonable, but I thought it was only of interest to specify
the mapping of the element (like affine or isoparametric)? Then the
basis functions are mapped accordingly (affine/isoparametric or
Piola+affine/isoparametric) and the mapping of basis functions is set
by the element (it knows it must use for example Piola).

/Anders