Dune::CubeMapper< dim > Class Template Reference
#include <numbering.hh>
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 dimensions with
elements per direction. This mesh has
elements in total. Now imagine refined mesh where each element is halfened in every coordinate direction. This refined mesh has
vertices (entities of codimension
). 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
where
. Let
be the number of even components in
. Then,
is the codimension of the mesh entity with coordinate
. E.~g.~ entities of codimension 0 have odd coordinates, all entities of codim
have
even coordinates.
In order to number all entities of one codimension consecutively we observe that the refined mesh can be subdivided into subsets. Subset number
with binary representation
corresponds to all
where
is even if
is 1 and
is odd if
is 0. The entities of codimension
now consist of
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 ![]() | |
void | print (std::ostream &ss, int indent) const |
print internal data |
Member Function Documentation
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)
The documentation for this class was generated from the following files:
- numbering.hh
- numbering.cc