[Dune] ID for an interface

Jö Fahlke jorrit at jorrit.de
Mon May 16 12:04:00 CEST 2011


Am Mon, 16. May 2011, 11:27:09 +0200 schrieb Benjamin Faigle:
> if i understood it right, the method
> 	grid.localIdSet().id(const EntityType &e)
> should return a unique ID for every sort of entities, be it
> elements, vertices or intersections. It works out pretty well with
> elements, as shown for example in the Dune Grid Howto
> 	IdType idf = idset.id (* ep );
> 
> However, if I try the same with an *intersection, I get the error message:
> ...dune-grid/dune/grid/common/indexidset.hh:394:43: error:
> ‘codimension’ is not a member of ‘Dune::IntersectionIterator<const
> Dune::UGGrid<2>, Dune::UGGridLeafIntersectionIterator,
> Dune::UGGridLeafIntersection>’
> 
> I am using dune 2.0.
> I am sorry if it is just an incredibly silly question, and many
> thanks for your help,

Only entities have ids.  Intersections are not entities!

All grids have entities of codimension dim (vertices) and codimension 0
(elements), and all have intersections.  Some grids have entities of other
codimensions as well.  Even if a grid has entities of codimension 1, these are
not the same as entities.  Most obvious differences:

 * Intersections know the neighbouring cells, codim 1 entities don't.

 * Intersections have an orientation, codim 1 entities don't.

 * Codim 1 entities have indices and ids and can be used to obtain array
   indices from a mapper (even if the grid does not support codim 1 entity
   objects!)  For intersections, indices, id's and maps are not provided by
   core Dune, though it is possibly to build such things yourself.

 * In non-conforming grids you may have the following situation:

     +-------+---+---+
     |       | b | d |
     |   a   +---+---+
     |       | c | e |
     +-------+---+---+

   Elements b, c, d and e all have four codim 1 subentities and four
   corresponding intersections.  Element a also has four codim 1 subentities,
   but it has five intersections.  The codim 1 entity to the right of b is the
   same as the codim 1 entity to the left of d.  You have three codim 1
   entities to the right of a however: on covering the whole of a's right
   border, and two smaller one each covering the upper and the lower half of
   a's border, respectively.

If you know you have a conforming grid, you have a correspondance between
intersections and codim 1 entities (ignoring the orientation of the
intersections).  In that case you can usually get away by using the id of the
corresponding codim 1 entity as the id of the intersection (even if the grid
does not support codim 1 entities as independent objects.  Use

  grid.globalIdSet().subId(e, i.indexInInside(), 1);

where i is the intersection and e is the codim 0 entity i was obtained from.
If you don't have e readily available, you can use

  grid.globalIdSet().subId(*i.inside(), i.indexInInside(), 1);

instead.

Bye,
Jö.

-- 
featured product: Debian GNU/Linux - http://www.debian.org
-------------- 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/20110516/f48b9a2e/attachment.sig>


More information about the Dune mailing list