dune-pdelab
2.5-dev
|
Class providing a consecutive index for codim 0 entities of a GridView. More...
#include <dune/pdelab/common/elementmapper.hh>
Public Types | |
typedef BaseT::size_type | size_type |
The type of the returned index. More... | |
typedef BaseT::Element | Element |
The type of the codim 0 entities of the GridView. More... | |
Public Member Functions | |
ElementMapper (const GV &gv) | |
Construct a CellIndexProvider for the given GridView. More... | |
size_type | map (const Element &e) const |
Return the index of the given element. More... | |
Class providing a consecutive index for codim 0 entities of a GridView.
ElementMapper yields a unique, consecutive, zero-based index for all codim 0 entities of a GridView. Conceptually, this can also be achieved using a Mapper from dune-grid, but this implementation has better performance as it avoids looking up the GeometryType in a std::map. For the common case of grids with a single codim 0 GeometryType, ElementMapper is specialized to just look up the cell index on the IndexSet of the GridView.
GV | The type of the GridView to operate on. |
typedef BaseT::Element Dune::PDELab::ElementMapper< GV >::Element |
The type of the codim 0 entities of the GridView.
typedef BaseT::size_type Dune::PDELab::ElementMapper< GV >::size_type |
The type of the returned index.
|
inline |
Construct a CellIndexProvider for the given GridView.
gv | the GridView to operate on. |
|
inline |
Return the index of the given element.
Returns an index for the given codim 0 entity that is guaranteed to be zero-based, consecutive and unique across all codim 0 entities of the GridView.
e | The codim 0 entity for which to calculate an index. |