Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp > Class Template Reference
[Grid Developer API]

Provide default implementation of method if IndexSet. More...

#include <dune/grid/common/indexidset.hh>

Inheritance diagram for Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >:
Inheritance graph

List of all members.

Public Types

typedef Base::IndexType IndexType
 The type used for the indices.

Public Member Functions

Index access from entity

template<int cc>
IndexType subIndex (const typename Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
Access to entity set

IndexType size (const 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.
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 explicitely. The result of calling this method with an entity that is not in the index set is undefined.
IndexType subIndex (const Entity &e, int i, unsigned int codim) const
 Map a subentity to an index.
Access to entity set

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$.
IndexType size (GeometryType type) const
 Return total number of entities of given geometry type in entity set $E$.
bool contains (const EntityType &e) const
 Return true if the given entity is contained in $E$.

Static Public Attributes

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

Detailed Description

template<class GridImp, class IndexSetImp>
class Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >

Provide default implementation of method if IndexSet.


Member Typedef Documentation

template<class GridImp , class IndexSetImp >
typedef Base::IndexType Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >::IndexType

The type used for the indices.

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


Member Function Documentation

bool Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::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.
const std::vector<GeometryType>& Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::geomTypes ( int  codim  )  const [inline, inherited]

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] codim A valid codimension.
Returns:
Const reference to a vector of geometry types.

Referenced by Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >::size().

IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::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:
e Reference 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.
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::index ( const typename remove_const< GridImp >::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:
e Reference 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.

Referenced by Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >::subIndex().

IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::size ( GeometryType  type  )  const [inline, inherited]

Return total number of entities of given geometry type in entity set $E$.

Parameters:
[in] type A valid geometry type.
Returns:
number of entities.

Referenced by Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >::size().

template<class GridImp , class IndexSetImp >
IndexType Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >::size ( const 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] codim A valid codimension
Returns:
number of entities.

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

References Dune::IndexSet< GridImp, IndexSetImp >::geomTypes(), and Dune::IndexSet< GridImp, IndexSetImp >::size().

template<class GridImp , class IndexSetImp >
template<int cc>
IndexType Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >::subIndex ( const typename Traits::template Codim< cc >::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:
cc codimension of the entity
Parameters:
[in] e reference to codimsion cc entity
[in] i number subentity of e within the codimension
[in] codim codimension 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.

The default implementation is as follows:

  index( *(e.subEntity( i, codim )) );

It does only work for cc=0 since the subEntity method is not present otherwise.

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

References Dune::IndexSet< GridImp, IndexSetImp >::index().

IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::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:
Entity type of entity (must be GridImp::Codim< cc >::Entity for some cc)
Parameters:
[in] e reference to entity
[in] i number subentity of e within the codimension
[in] codim codimension 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 GridImp , class IndexSetImp >
const int Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >::dimension = Base::dimension [static]

dimension of the grid (maximum allowed codimension)

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


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

Generated on Fri Apr 29 2011 with Doxygen (ver 1.7.1) [doxygen-log,error-log].