dune-grid  2.3beta2
Public Types | Public Member Functions | Static Public Attributes | List of all members
Dune::SGridLevelIndexSet< GridImp > Class Template Reference

implementation of index set More...

#include <dune/grid/sgrid.hh>

Inheritance diagram for Dune::SGridLevelIndexSet< GridImp >:
Inheritance graph

Public Types

typedef IndexTypeImp IndexType
 The type used for the indices.

Public Member Functions

 SGridLevelIndexSet (const GridImp &g, int l)
 constructor stores reference to a grid and level
template<int cd>
int index (const typename GridImp::Traits::template Codim< cd >::Entity &e) const
 get index of an entity
template<int cc>
int subIndex (const typename GridImp::Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
template<class EntityType >
bool contains (const EntityType &e) const
 Return true if the given entity is contained in $E$.
int size (GeometryType type) const
 get number of entities of given type and level (the level is known to the object)
int size (int codim) const
 return size of set for a given codim
const std::vector< GeometryType > & geomTypes (int codim) const
 deliver all geometry types used in this grid
Index access from entity
IndexType index (const typename remove_const< GridImp >::type::Traits::template Codim< cc >::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.
IndexType index (const EntityType &e) const
 Map entity to index. Easier to use than the above because codimension template parameter need not be supplied explicitly. The result of calling this method with an entity that is not in the index set is undefined.
IndexType subIndex (const typename Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
 Map a subentity to an index.
IndexType subIndex (const Entity &e, int i, unsigned int codim) const
 Map a subentity to an index.

Static Public Attributes

static const int dimension
 dimension of the grid (maximum allowed codimension)

Detailed Description

template<class GridImp>
class Dune::SGridLevelIndexSet< GridImp >

implementation of index set

Member Typedef Documentation

typedef IndexTypeImp Dune::IndexSet< GridImp, SGridLevelIndexSet< GridImp > , IndexTypeImp >::IndexType
inherited

The type used for the indices.

Constructor & Destructor Documentation

template<class GridImp >
Dune::SGridLevelIndexSet< GridImp >::SGridLevelIndexSet ( const GridImp &  g,
int  l 
)
inline

constructor stores reference to a grid and level

References Dune::cube, and Dune::IndexSet< GridImp, SGridLevelIndexSet< GridImp > >::dimension.

Member Function Documentation

template<class GridImp >
template<class EntityType >
bool Dune::SGridLevelIndexSet< GridImp >::contains ( const EntityType &  e) const
inline

Return true if the given entity is contained in $E$.

Note
If the input element e is not an element of the grid, then the result of contains() is undefined.

Reimplemented from Dune::IndexSet< GridImp, SGridLevelIndexSet< GridImp > >.

template<class GridImp >
const std::vector<GeometryType>& Dune::SGridLevelIndexSet< GridImp >::geomTypes ( int  codim) const
inline

deliver all geometry types used in this grid

Reimplemented from Dune::IndexSet< GridImp, SGridLevelIndexSet< GridImp > >.

IndexType Dune::IndexSet< GridImp, SGridLevelIndexSet< GridImp > , IndexTypeImp >::index ( const typename remove_const< GridImp >::type::Traits::template Codim< cc >::Entity e) const
inlineinherited

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.
IndexType Dune::IndexSet< GridImp, SGridLevelIndexSet< GridImp > , IndexTypeImp >::index ( const EntityType &  e) const
inlineinherited

Map entity to index. Easier to use than the above because codimension template parameter need not be supplied explicitly. The result of calling this method with an entity that is not in the index set is undefined.

Parameters
eReference to codim cc entity. Since entity knows its codimension, automatic extraction is possible.
Returns
An index in the range 0 ... Max number of entities in set - 1.
template<class GridImp >
template<int cd>
int Dune::SGridLevelIndexSet< GridImp >::index ( const typename GridImp::Traits::template Codim< cd >::Entity e) const
inline

get index of an entity

template<class GridImp >
int Dune::SGridLevelIndexSet< GridImp >::size ( GeometryType  type) const
inline

get number of entities of given type and level (the level is known to the object)

Reimplemented from Dune::IndexSet< GridImp, SGridLevelIndexSet< GridImp > >.

template<class GridImp >
int Dune::SGridLevelIndexSet< GridImp >::size ( int  codim) const
inline

return size of set for a given codim

Reimplemented from Dune::IndexSet< GridImp, SGridLevelIndexSet< GridImp > >.

IndexType Dune::IndexSet< GridImp, SGridLevelIndexSet< GridImp > , IndexTypeImp >::subIndex ( const typename Traits::template Codim< cc >::Entity e,
int  i,
unsigned int  codim 
) const
inlineinherited

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 (must satisfy cc <= codim <= dimension)
Returns
An index in the range 0 ... Max number of entities in set - 1.
IndexType Dune::IndexSet< GridImp, SGridLevelIndexSet< GridImp > , IndexTypeImp >::subIndex ( const Entity e,
int  i,
unsigned int  codim 
) const
inlineinherited

Map a subentity to an index.

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

Note
This method exists for convenience only. It extracts the codimension from the type of the entity, which can be guessed by the compiler.
Template Parameters
Entitytype of entity (must be GridImp::Codim< cc >::Entity for some cc)
Parameters
[in]ereference to entity
[in]inumber subentity of e within the codimension
[in]codimcodimension of the subentity we're interested in
Returns
An index in the range 0 ... Max number of entities in set - 1.
template<class GridImp >
template<int cc>
int Dune::SGridLevelIndexSet< GridImp >::subIndex ( const typename GridImp::Traits::template Codim< cc >::Entity e,
int  i,
unsigned int  codim 
) const
inline

Member Data Documentation

const int Dune::IndexSet< GridImp, SGridLevelIndexSet< GridImp > , IndexTypeImp >::dimension
staticinherited

dimension of the grid (maximum allowed codimension)

Referenced by Dune::SGridLevelIndexSet< GridImp >::SGridLevelIndexSet().


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