[Dune] Id Based Mappers

Jö Fahlke jorrit at jorrit.de
Fri Mar 4 15:38:28 CET 2011


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ö.

-- 
Das Erststudium soll bis zum berufsqualifizierenden Abschluss
gebührenfrei bleiben, also bis zur Erlangung der Taxi-Lizenz.
-- Akrützel, Ausgabe vom 16.5.2002 (www.akruetzel.de)
-------------- 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/20110304/93b4aa9c/attachment.sig>


More information about the Dune mailing list