Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes > Class Template Reference
[IndexSet and IdSet]

#include <indexidset.hh>

Inheritance diagram for Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >:

Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp, IndexSetTypes > Dune::IndexSetDefaultImplementation< Dune::AlbertaGrid< dim, dimworld >, Dune::AlbertaGridHierarchicIndexSet< dim, dimworld >, Dune::AlbertaGridHierarchicIteratorTypes< Dune::AlbertaGrid< dim, dimworld > > > Dune::IndexSetDefaultImplementation< Dune::SGrid< dim, dimworld >, Dune::SGridLeafIndexSet< Dune::SGrid< dim, dimworld > >, Dune::SGridLeafIndexSetTypes< Dune::SGrid< dim, dimworld > > > Dune::IndexSetDefaultImplementation< Dune::SGrid< dim, dimworld >, Dune::SGridLevelIndexSet< Dune::SGrid< dim, dimworld > >, Dune::SGridLevelIndexSetTypes< Dune::SGrid< dim, dimworld > > > Dune::IndexSetDefaultImplementation< Dune::YaspGrid< dim, dim >, Dune::YaspLeafIndexSet< Dune::YaspGrid< dim, dim > >, Dune::YaspLeafIndexSetTypes< Dune::YaspGrid< dim, dim > > > Dune::IndexSetDefaultImplementation< Dune::YaspGrid< dim, dim >, Dune::YaspLevelIndexSet< Dune::YaspGrid< dim, dim > >, Dune::YaspLevelIndexSetTypes< Dune::YaspGrid< dim, dim > > > Dune::IndexSetDefaultImplementation< GridImp, Dune::DefaultLeafIndexSet< GridImp >, Dune::DefaultLeafIteratorTypes< GridImp > > Dune::IndexSetDefaultImplementation< GridImp, Dune::DefaultLevelIndexSet< GridImp >, Dune::DefaultLevelIteratorTypes< GridImp > > Dune::IndexSetDefaultImplementation< GridImp, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSetTypes< GridImp > > Dune::IndexSetDefaultImplementation< GridImp, Dune::SGridLevelIndexSet< GridImp >, Dune::SGridLevelIndexSetTypes< GridImp > > Dune::IndexSetDefaultImplementation< GridImp, Dune::YaspLeafIndexSet< GridImp >, Dune::YaspLeafIndexSetTypes< GridImp > > Dune::IndexSetDefaultImplementation< GridImp, Dune::YaspLevelIndexSet< GridImp >, Dune::YaspLevelIndexSetTypes< GridImp > >

List of all members.


Detailed Description

template<class GridImp, class IndexSetImp, class IndexSetTypes>
class Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >

Index Set Interface base class.

This class template is used as a base class for all index set implementations. It uses the Barton-Nackman trick to ensure conformity to the interface.

Template parameters are:

Overview

An index set provides a map

\[ m : E \to \mathbf{N}\]

where $E$ is a subset of the entities of a grid and $\mathbf{N}$ is the set of natural numbers (including 0).

We define the subsets

\[ E_g^c = \{e\in E \ | \ \textrm{$e$ has codimension $c$ and geometry type $g$} \}.\]

The index map $m$ has the following properties:

Index sets are used to assign user defined data (e.g. degrees of freedom of a discretization) to entities of the grid. For efficiency reasons the prefered data structure for user data is the array. In order to access the data from the entity, its index (with respect to an index set - there may be several) is evaluated and used as an index to an array (or some other container providing random access).

Usually an index set is not used directly but a Mapper is used to compute the array index from the information supplied by an index set.

It is important to note that the index assigned to an entity may change during grid modification (i.e. refinement or dynamic load balancing). The user is reponsible for reorganizing the information stored in the external arrays appropriately. In order to do this the IdSet concept is supplied.

Level index

Index set where $E$ corresponds to all entities of a given grid level. All grid implementations provide level indices.

Leaf Index

Index set where $E$ corresponds to all entities of the leaf grid. All grid implementations provide a leaf index.

Public Types

typedef unsigned int IndexType
 The type used for the indices.

Public Member Functions

Index access from entity
template<int cc>
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.
template<class EntityType>
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.
template<int cc>
IndexType subIndex (const typename remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e, int i) const
 Map subentity of codim cc of codim 0 entity to index. The result of calling this method with an entity that is not in the index set is undefined.
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$.
IndexType 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 EntityType>
bool contains (const EntityType &e) const
 Return true if the given entity is contained in $E$.
template<int cd, PartitionIteratorType pitype>
Codim< cd >::template
Partition< pitype >::Iterator 
begin () const
 Iterator to first entity of given codimension and partition type in $E$. The iterator type is available via the public Codim struct.
template<int cd, PartitionIteratorType pitype>
Codim< cd >::template
Partition< pitype >::Iterator 
end () const
 Iterator to one past the last entity of given codim and partition type in $E$. The iterator type is available via the public Codim struct.

Classes

struct  Codim
 Define types needed to iterate over the entities in the index set. More...


Member Function Documentation

template<class GridImp, class IndexSetImp, class IndexSetTypes>
template<int cc>
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >::index ( const typename remove_const< GridImp >::type::Traits::template Codim< cc >::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:
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, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSetTypes< GridImp > >::contains(), and Dune::IndexSetDefaultImplementation< GridImp, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSetTypes< GridImp > >::subIndex().

template<class GridImp, class IndexSetImp, class IndexSetTypes>
template<class EntityType>
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >::index ( const EntityType &  e  )  const [inline]

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.

Reimplemented in Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.

template<class GridImp, class IndexSetImp, class IndexSetTypes>
template<int cc>
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >::subIndex ( const typename remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity e,
int  i 
) const [inline]

template<class GridImp, class IndexSetImp, class IndexSetTypes>
const std::vector<GeometryType>& Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >::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] codim A valid codimension.
Returns:
Const reference to a vector of geometry types.

Reimplemented in Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.

Referenced by Dune::IndexSet< GridImp, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSetTypes< GridImp > >::geomTypes().

template<class GridImp, class IndexSetImp, class IndexSetTypes>
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >::size ( GeometryType  type  )  const [inline]

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

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

Reimplemented in Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.

Referenced by Dune::IndexSet< GridImp, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSetTypes< GridImp > >::size().

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

Reimplemented in Dune::DefaultLevelIndexSet< GridImp >, Dune::DefaultLeafIndexSet< GridImp >, Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp, IndexSetTypes >, Dune::IndexSetDefaultImplementation< Dune::AlbertaGrid< dim, dimworld >, Dune::AlbertaGridHierarchicIndexSet< dim, dimworld >, Dune::AlbertaGridHierarchicIteratorTypes< Dune::AlbertaGrid< dim, dimworld > > >, Dune::IndexSetDefaultImplementation< Dune::SGrid< dim, dimworld >, Dune::SGridLevelIndexSet< Dune::SGrid< dim, dimworld > >, Dune::SGridLevelIndexSetTypes< Dune::SGrid< dim, dimworld > > >, Dune::IndexSetDefaultImplementation< GridImp, Dune::DefaultLeafIndexSet< GridImp >, Dune::DefaultLeafIteratorTypes< GridImp > >, Dune::IndexSetDefaultImplementation< GridImp, Dune::YaspLeafIndexSet< GridImp >, Dune::YaspLeafIndexSetTypes< GridImp > >, Dune::IndexSetDefaultImplementation< GridImp, Dune::YaspLevelIndexSet< GridImp >, Dune::YaspLevelIndexSetTypes< GridImp > >, Dune::IndexSetDefaultImplementation< GridImp, Dune::SGridLevelIndexSet< GridImp >, Dune::SGridLevelIndexSetTypes< GridImp > >, Dune::IndexSetDefaultImplementation< GridImp, Dune::DefaultLevelIndexSet< GridImp >, Dune::DefaultLevelIteratorTypes< GridImp > >, Dune::IndexSetDefaultImplementation< Dune::SGrid< dim, dimworld >, Dune::SGridLeafIndexSet< Dune::SGrid< dim, dimworld > >, Dune::SGridLeafIndexSetTypes< Dune::SGrid< dim, dimworld > > >, Dune::IndexSetDefaultImplementation< Dune::YaspGrid< dim, dim >, Dune::YaspLevelIndexSet< Dune::YaspGrid< dim, dim > >, Dune::YaspLevelIndexSetTypes< Dune::YaspGrid< dim, dim > > >, Dune::IndexSetDefaultImplementation< Dune::YaspGrid< dim, dim >, Dune::YaspLeafIndexSet< Dune::YaspGrid< dim, dim > >, Dune::YaspLeafIndexSetTypes< Dune::YaspGrid< dim, dim > > >, and Dune::IndexSetDefaultImplementation< GridImp, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSetTypes< GridImp > >.

template<class GridImp, class IndexSetImp, class IndexSetTypes>
template<int cd, PartitionIteratorType pitype>
IndexSet< GridImp, IndexSetImp, IndexSetTypes >::template Codim< cd >::template Partition< pitype >::Iterator Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >::begin (  )  const [inline]

Iterator to first entity of given codimension and partition type in $E$. The iterator type is available via the public Codim struct.

Deprecated:
Deprecated:

Reimplemented in Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.

template<class GridImp, class IndexSetImp, class IndexSetTypes>
template<int cd, PartitionIteratorType pitype>
IndexSet< GridImp, IndexSetImp, IndexSetTypes >::template Codim< cd >::template Partition< pitype >::Iterator Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >::end (  )  const [inline]

Iterator to one past the last entity of given codim and partition type in $E$. The iterator type is available via the public Codim struct.

Deprecated:
Deprecated:

Reimplemented in Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.


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

Generated on Tue Jul 28 22:28:35 2009 for dune-grid by  doxygen 1.5.6