Dune::CubeMapper< dim > Class Template Reference

#include <numbering.hh>

List of all members.


Detailed Description

template<int dim>
class Dune::CubeMapper< dim >

The CubeMapper assigns an id to all entities of all codimensions of a structured mesh with arbitrary number of elements (codim 0 entities) in each direction. The ids are unique and consecutive within each codimension.

The idea is as follows: Consider a structured mesh in $d$ dimensions with $N$ elements per direction. This mesh has $N^d$ elements in total. Now imagine refined mesh where each element is halfened in every coordinate direction. This refined mesh has $(2N+1)^d$ vertices (entities of codimension $d$). Each vertex of the refined mesh now corresponds to a grid entity of the original mesh. Moreover, a vertex in the refined mesh can be identified by integer coordintes $z$ where $z_i\in\{0,\ldots,2N\}, 0\leq i < d$. Let $c(z)$ be the number of even components in $z$. Then, $c(z)$ is the codimension of the mesh entity with coordinate $z$. E.~g.~ entities of codimension 0 have odd coordinates, all entities of codim $d$ have $d$ even coordinates.

In order to number all entities of one codimension consecutively we observe that the refined mesh can be subdivided into $2^d$subsets. Subset number $b$ with binary representation $(b_{d-1},\ldots,b_0)$ corresponds to all $z\in [0,2N]^d$ where $z_i$ is even if $b_i$ is 1 and $z_i$ is odd if $b_i$ is 0. The entities of codimension $c$ now consist of $\left ( \begin{array}{cc}d\\c\end{array} \right)$ of those subsets. Within the subsets the numbering is lexicographic and then the corrsponding subsets are numbered consecutively.


Public Member Functions

 CubeMapper (const array< int, dim > &_NN)
 construct with number of elements (of codim 0) in each direction
 CubeMapper ()
 make cube of single element
void make (const array< int, dim > &_NN)
 (re)initialize with number of elements (of codim 0) in each direction
int elements (int codim) const
 get number of elements in each codimension
int codim (const array< int, dim > &z) const
 compute codim from coordinate
int n (const array< int, dim > &z) const
array< int, dim > z (int i, int codim) const
 compute coordinates from number and codimension
array< int, dim > compress (const array< int, dim > &z) const
 compress from expanded coordinates to grid for a single partition number
array< int, dim > expand (const array< int, dim > &r, int b) const
 expand with respect to partition number
int partition (const array< int, dim > &z) const
 There are $2^d$ possibilities of having even/odd coordinates. The binary representation is called partition number.
void print (std::ostream &ss, int indent) const
 print internal data

Member Function Documentation

template<int dim>
int Dune::CubeMapper< dim >::n ( const array< int, dim > &  z  )  const [inline]

compute number from coordinate 0 <= n < elements(codim(z)) general implementation is O(2^dim)

References Dune::CubeMapper< dim >::compress(), Dune::JoinOrder< dim >::n(), and Dune::CubeMapper< dim >::partition().

Referenced by Dune::CubeMapper< dim >::z().


The documentation for this class was generated from the following files:

Generated on 6 Nov 2008 with Doxygen (ver 1.5.6) [logfile].