← Back to team overview

ufl team mailing list archive

Re: implementasjon av isoparametrisk mapping

 

On Fri, Nov 02, 2007 at 12:48:16AM +0100, Kent-Andre Mardal wrote:
> tor, 01.11.2007 kl. 22.43 +0100, skrev Anders Logg:
> > On Thu, Nov 01, 2007 at 09:00:05AM +0100, kent-and@xxxxxxxxx wrote:
> > > > 2007/11/1, Anders Logg <logg@xxxxxxxxx>:
> > > >> On Tue, Oct 30, 2007 at 09:57:18AM +0100, Martin Sandve Alnæs wrote:
> > > >> > 2007/10/29, Anders Logg <logg@xxxxxxxxx>:
> > > >> > > 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 kent-and@xxxxxxxxx <kent-and@xxxxxxxxx>
> > > >> 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
> > > >
> > > >
> > > > This doesn't fit into that exactly:
> > > >
> > > >> > reference_element = ReferenceElement("Lagrange", "triangle", 3)
> > > >> > mapping = Mapping("isoparametric", 3)
> > > >> > global_element = FiniteElement(reference_element, mapping)
> > > >
> > > >
> > > 
> > > OK, I think
> > > 
> > > cell = Cell(polygon, geometry="Lagrange", order=1)
> > > 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
> 
> 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

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


References