← Back to team overview

ufl team mailing list archive

Re: implementasjon av isoparametrisk mapping

 

> 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)
>
>
> --
> Martin


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.




Follow ups

References