DUNE PDELab (git)

Dune::PDELab::ElementMapper< GV > Class Template Reference

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.
 
typedef BaseT::Element Element
 The type of the codim 0 entities of the GridView.
 

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

Detailed Description

template<typename GV>
class Dune::PDELab::ElementMapper< GV >

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.

Template Parameters
GVThe type of the GridView to operate on.

Constructor & Destructor Documentation

◆ ElementMapper()

template<typename GV >
Dune::PDELab::ElementMapper< GV >::ElementMapper ( const GV &  gv)
inline

Construct a CellIndexProvider for the given GridView.

Parameters
gvthe GridView to operate on.

Member Function Documentation

◆ map()

template<typename GV >
size_type Dune::PDELab::ElementMapper< GV >::map ( const Element e) const
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.

Parameters
eThe codim 0 entity for which to calculate an index.
Returns
The index of the entity.

The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)