[Dune] Id Based Mappers

Dan Popovic dan.popovic at maxplanckflorida.org
Fri Mar 4 16:15:44 CET 2011


Hi Joe, 

brilliant explanation! I'd propose to include it exactly as is in the
dune-grid-howto, it would surely be very helpful for anyone learning
Dune... :-)

Best,
Dan

On Fri, 2011-03-04 at 15:38 +0100, Jö Fahlke wrote:
> Am Fri,  4. Mar 2011, 14:46:15 +0100 schrieb S. Swayamjyoti:
> > In the dune-grid how to, we have mappers which are supposed to be
> > zero-starting and consecutive. Mappers are supposed to have the same
> > functionality as Index Sets.
> 
> An IndexSet-based mapper is something different from an IndexSet!  IndexSets
> enumerates entities of different geometry types seperately.  Suppose you have
> the following grid:
> 
>   a---A----b---B----c      Numbers           : Faces
>   |        |        |      Upper case letters: Edges
>   C   0    D   1    E      Lower case letters: Nodes
>   |        |        |
>   d---F----e---G----f
>   |        |        |
>   H   2    I   3    J
>   |        |        |
>   g---K----h---L----i
> 
> An indexset will assign the following indices (actual order depends on
> implementation)[1]:
> 
>   Face:    0 1 2 3
>   index(): 0 1 2 3
> 
>   Edge:    A B C D E F G H I J  K  L
>   index(): 0 1 2 3 4 5 6 7 8 9 10 11
> 
>   Node:    a b c d e f g h i
>   index(): 0 1 2 3 4 5 6 7 8
> 
> A Mapper can map entities of different type into one continuous index space.
> If you for instance configure the MultipleCodimMultipleGeomTypeMapper to map
> faces and nodes, you will get something like this:
> 
>   Entity: 0 1 2 3 a b c d e f  g  h  i
>   map():  0 1 2 3 4 5 6 7 8 9 10 11 12
> 
> Calling map() with an edge is illegal and results in undefined behaviour,
> because edges are not contained in this particular mapper.  You can check
> wether an entity is contained in a mapper by using the mappers contains()
> method.
> 
> People often use the indexset instead of a mapper when they want indices for
> just codim-0 entities; THIS IS USUALLY AN ERROR.  This will not work on grids
> which support for instance quadrilaterals as well as triangles, because
> quadrilaterals and triangles are indexed seperately.
> 
> > But there is also a mention about Id based Mappers. What are these days?
> > Because these mappers need not have positive or consecutive. Could some one
> > please give examples to differentiate between Index based mappers and Id
> > based mappers? I guess they are not same as Index set and Id set.
> 
> Mappers are always consecutive and zero-starting, for the entities they are
> configured to support.  IdSets are *not* consecutive.  You can however
> implement a Mapper on top of an IdSet instead of an IndexSet.  This is of
> course slow, since it uses something like std::map internally.
> 
> Examples for IndexSet-based mappers are SingleCodimSingleGeomTypeMapper and
> MultipleCodimMultipleGeomTypeMapper.  An example for an IdSet-based mapper is
> UniversalMapper.
> 
> Bye,
> Jö.
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune






More information about the Dune mailing list