Dune Core Modules (2.9.1)

Dune::YaspPersistentContainerIndex< Grid > Class Template Reference

implement a consecutive index for all entities of given codim of a YaspGrid More...

#include <dune/grid/yaspgrid/yaspgridpersistentcontainer.hh>

Public Types

typedef std::size_t IndexType
 The type used for the indices. More...
 

Public Member Functions

template<class Entity >
IndexType index (const Entity &e) const
 Map entity to index. The result of calling this method with an entity that is not in the index set is undefined. More...
 
template<class Entity >
IndexType subIndex (const Entity &e, int i, unsigned int codim) const
 Map a subentity to an index. More...
 
std::size_t size (int) const
 Return total number of entities of given geometry type in entity set \(E\). More...
 

Detailed Description

template<typename Grid>
class Dune::YaspPersistentContainerIndex< Grid >

implement a consecutive index for all entities of given codim of a YaspGrid

this class behaves similar to an IndexSet

to make this work for a persistent vector we have to implement...

 indexSet.size( codim )
 indexSet.index( entity );
 indexSet.subIndex( entity, subEntity, codimension() );

Member Typedef Documentation

◆ IndexType

template<typename Grid >
typedef std::size_t Dune::YaspPersistentContainerIndex< Grid >::IndexType

The type used for the indices.

Member Function Documentation

◆ index()

template<typename Grid >
template<class Entity >
IndexType Dune::YaspPersistentContainerIndex< Grid >::index ( const Entity e) const
inline

Map entity to index. The result of calling this method with an entity that is not in the index set is undefined.

Parameters
eReference to codim cc entity, where cc is the template parameter of the function.
Returns
An index in the range 0 ... Max number of entities in set - 1.

References Dune::Entity< cd, dim, GridImp, EntityImp >::codimension, and Dune::Entity< cd, dim, GridImp, EntityImp >::level().

◆ size()

template<typename Grid >
std::size_t Dune::YaspPersistentContainerIndex< Grid >::size ( int  ) const
inline

Return total number of entities of given geometry type in entity set \(E\).

Parameters
[in]typeA valid geometry type.
Returns
number of entities (type is auto determined by the implementation. std::size_t is the expected return type).

References Dune::Grid< dim, dimworld, ct, GridFamily >::size().

◆ subIndex()

template<typename Grid >
template<class Entity >
IndexType Dune::YaspPersistentContainerIndex< Grid >::subIndex ( const Entity e,
int  i,
unsigned int  codim 
) const
inline

Map a subentity to an index.

The result of calling this method with an entity that is not in the index set is undefined.

Template Parameters
cccodimension of the entity
Parameters
[in]ereference to codimension cc entity
[in]inumber subentity of e within the codimension
[in]codimcodimension of the subentity we're interested in
Note
The parameter codim denotes the codimension with respect to the grid, i.e., it must satisfy cc <= codim <= dimension.
Returns
An index in the range 0 ... Max number of entities in set - 1.

References Dune::Entity< cd, dim, GridImp, EntityImp >::codimension, and Dune::Entity< cd, dim, GridImp, EntityImp >::level().


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