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

Jö Fahlke jorrit at jorrit.de
Mon Jun 14 16:06:18 CEST 2010


Am Mon, 14. Jun 2010, 14:42:45 +0200 schrieb Christian Waluga:
> 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?

OK, with hanging nodes like this

            v
  +---------+----+----+
  |         |    |    |
  |  is->   |    |    |
  |outside()+----+----+
  |         |<=  |    |
  |         |    |    |
  +---------+----+----+
            ^

lets say *is is the intersection marked by the arrow, is->inside() is the
small element with the arrow inside and is->outside() is the big element.  You
have xq, which is a coordinate local to *is.  You then go and aquire the codim
1 subentity of the big element where the intersection *is is on.  That
subentity is the big one between the "v" and the "^"; in particular it is
bigger then the intersection *is itself.  If you then interpret xq as local to
that subentity it (although it is only local to *is) the result will be
rubbish.

What you probably want is

  xinside = is->geometryInOutside().global(xq);

although one could argue about the name of "xinside" here.

Bye,
Jö.

-- 
Entstauben ist Mord!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20100614/3a97881b/attachment.sig>


More information about the Dune mailing list