dune-grid  2.1.1
Public Types | Public Member Functions | Static Public Attributes
Dune::GeoGrid::IndexSet< Grid, HostIndexSet > Class Template Reference

#include <dune/grid/geometrygrid/indexsets.hh>

Inheritance diagram for Dune::GeoGrid::IndexSet< Grid, HostIndexSet >:
Inheritance graph

List of all members.

Public Types

typedef Dune::IndexSet< Grid,
This, typename
HostIndexSet::IndexType > 
Base
typedef Base::IndexType IndexType
 The type used for the indices.

Public Member Functions

 IndexSet (const HostIndexSet &hostIndexSet)
template<int cc>
IndexType index (const typename Traits::template Codim< cc >::Entity &entity) const
template<int cc>
IndexType subIndex (const typename Traits::template Codim< cc >::Entity &entity, int i, unsigned int codim) const
IndexType size (GeometryType type) const
 Return total number of entities of given geometry type in entity set $E$.
int size (int codim) const
 Return total number of entities of given codim in the entity set $E$. This is simply a sum over all geometry types.
template<class Entity >
bool contains (const Entity &entity) const
const std::vector< GeometryType > & geomTypes (int codim) const
 Return vector with all geometry types of entities in domain of index map. Return a vector with all geometry types of a given codimension contained in the Entity set $E$.
Index access from entity
IndexType index (const typename remove_const< Grid >::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 explicitely. 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.
Access to entity set
bool contains (const EntityType &e) const
 Return true if the given entity is contained in $E$.

Static Public Attributes

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

template<class Grid, class HostIndexSet>
class Dune::GeoGrid::IndexSet< Grid, HostIndexSet >


Member Typedef Documentation

template<class Grid , class HostIndexSet >
typedef Dune::IndexSet< Grid, This, typename HostIndexSet::IndexType > Dune::GeoGrid::IndexSet< Grid, HostIndexSet >::Base
template<class Grid , class HostIndexSet >
typedef Base::IndexType Dune::GeoGrid::IndexSet< Grid, HostIndexSet >::IndexType

The type used for the indices.

Reimplemented from Dune::IndexSet< Grid, IndexSet< Grid, HostIndexSet >, HostIndexSet::IndexType >.


Constructor & Destructor Documentation

template<class Grid , class HostIndexSet >
Dune::GeoGrid::IndexSet< Grid, HostIndexSet >::IndexSet ( const HostIndexSet< Grid, HostIndexSet > &  hostIndexSet) [inline]

Member Function Documentation

template<class Grid , class HostIndexSet >
template<class Entity >
bool Dune::GeoGrid::IndexSet< Grid, HostIndexSet >::contains ( const Entity entity) const [inline]
bool Dune::IndexSet< Grid , IndexSet< Grid, HostIndexSet > , HostIndexSet::IndexType >::contains ( const EntityType &  e) const [inline, inherited]

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.
template<class Grid , class HostIndexSet >
const std::vector< GeometryType >& Dune::GeoGrid::IndexSet< Grid, HostIndexSet >::geomTypes ( int  codim) const [inline]

Return vector with all geometry types of entities in domain of index map. Return a vector with all geometry types of a given codimension contained in the Entity set $E$.

Parameters:
[in]codimA valid codimension.
Returns:
Const reference to a vector of geometry types.

Reimplemented from Dune::IndexSet< Grid, IndexSet< Grid, HostIndexSet >, HostIndexSet::IndexType >.

template<class Grid , class HostIndexSet >
template<int cc>
IndexType Dune::GeoGrid::IndexSet< Grid, HostIndexSet >::index ( const typename Traits::template Codim< cc >::Entity entity) const [inline]
IndexType Dune::IndexSet< Grid , IndexSet< Grid, HostIndexSet > , HostIndexSet::IndexType >::index ( const typename remove_const< Grid >::type::Traits::template Codim< cc >::Entity e) const [inline, inherited]

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< Grid , IndexSet< Grid, HostIndexSet > , HostIndexSet::IndexType >::index ( const EntityType &  e) const [inline, inherited]

Map entity to index. Easier to use than the above because codimension template parameter need not be supplied explicitely. 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 Grid , class HostIndexSet >
IndexType Dune::GeoGrid::IndexSet< Grid, HostIndexSet >::size ( GeometryType  type) 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.

Reimplemented from Dune::IndexSet< Grid, IndexSet< Grid, HostIndexSet >, HostIndexSet::IndexType >.

template<class Grid , class HostIndexSet >
int Dune::GeoGrid::IndexSet< Grid, HostIndexSet >::size ( int  codim) const [inline]

Return total number of entities of given codim in the entity set $E$. This is simply a sum over all geometry types.

Parameters:
[in]codimA valid codimension
Returns:
number of entities.

Reimplemented from Dune::IndexSet< Grid, IndexSet< Grid, HostIndexSet >, HostIndexSet::IndexType >.

template<class Grid , class HostIndexSet >
template<int cc>
IndexType Dune::GeoGrid::IndexSet< Grid, HostIndexSet >::subIndex ( const typename Traits::template Codim< cc >::Entity entity,
int  i,
unsigned int  codim 
) const [inline]
IndexType Dune::IndexSet< Grid , IndexSet< Grid, HostIndexSet > , HostIndexSet::IndexType >::subIndex ( const typename Traits::template Codim< cc >::Entity e,
int  i,
unsigned int  codim 
) const [inline, inherited]

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 codimsion 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< Grid , IndexSet< Grid, HostIndexSet > , HostIndexSet::IndexType >::subIndex ( const Entity e,
int  i,
unsigned int  codim 
) const [inline, inherited]

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.

Member Data Documentation

template<class Grid , class HostIndexSet >
const int Dune::GeoGrid::IndexSet< Grid, HostIndexSet >::dimension = Grid::dimension [static]

dimension of the grid (maximum allowed codimension)

Reimplemented from Dune::IndexSet< Grid, IndexSet< Grid, HostIndexSet >, HostIndexSet::IndexType >.


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