[Dune] Non-unique coordinate mappings of Codim(1) entities?

Christian Waluga waluga at aices.rwth-aachen.de
Mon Jun 14 14:42:45 CEST 2010


Hi,

Ich have another (hopefully) easy question. My code is working well for conforming meshes. But if I refine locally with hanging nodes, something is wrong with the coordinate mapping. After some first tests, I thought that everything works well. But this morning, when I finished writing the adaption routine, I noticed that errors may occur due to a false mapping.

The variable  'flip' is always set, if outside is on a higher level or has a lower index...

    bool flip = false;
    if((is->outside()->level() > is->inside()->level()) || (gv.indexSet().index(*is->inside()) > gv.indexSet().index(*is->outside())))
      flip = true;

Now, to map from Intersection coords to the inside-Element, I wrote a workaround like this (xq is a quad point on the intersection)...

    IS::GlobalCoordinate xinside;
    if(flip)
    {
      int const i = is->indexInOutside();
      typename IS::GlobalCoordinate xg = is->outside()->template subEntity<1>(i)->geometry().global(xq);
      xinside = is->inside()->geometry().local(xg);
    }
    else
      xinside = is->geometryInInside().global(xq);

Does anyone have an idea what might be wrong here? Or is there a more elegant solution than the local (Intersection) to global to local (Element) mapping?

Thanks for reading!

Best, Chris


Am 07.06.2010 um 20:23 schrieb Andreas Dedner:

> Hi,
> 
> the map is (at the moment) the only possible solution I think.
> I would suggest orderning intersection so that the inside
> entity is alsways the one with the lower index - in the conform
> case. In the non-conform case the inside entity should be the
> one with the higher level (having the ''smaller'' intersection, that
> on most grids dees correspond to an codim 1 entity).
> 
> The orientation is now also not a problem since you have a unique
> (inside,outside) paring and can always take the geometry from the
> inside entity, e.g., the one with the higher level or lower index, if
> levels are equal.
> 
> Best
> Andreas





More information about the Dune mailing list