dune-grid 3.0-git
Public Types | Public Member Functions | List of all members
Dune::IdSet< GridImp, IdSetImp, IdTypeImp > Class Template Reference

Id Set Interface. More...

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

Inheritance diagram for Dune::IdSet< GridImp, IdSetImp, IdTypeImp >:
Inheritance graph

Public Types

typedef IdTypeImp IdType
 Type used to represent an id.
 

Public Member Functions

template<class Entity >
IdType id (const Entity &e) const
 Get id of an entity. This method is simpler to use than the one below.
 
template<int cc>
IdType id (const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e) const
 Get id of an entity of codim cc. Unhandy because template parameter must be supplied explicitely.
 
IdType subId (const typename std::remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
 Get id of subentity i of co-dimension codim of a co-dimension 0 entity.
 
 IdSet ()
 

Detailed Description

template<class GridImp, class IdSetImp, class IdTypeImp>
class Dune::IdSet< GridImp, IdSetImp, IdTypeImp >

Id Set Interface.

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

Template Parameters
GridImpType that is a model of Dune::Grid.
IdSetImpType that is a model of Dune::IdSet.
IdTypeImpType used for ids

Overview

An id set provides a map

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

where $E$ is a subset of the entities of a grid and $\mathbf{I}$ is a discrete set of ids. These ids need not be consecutive nor positive. However, the ids must be usable as keys for STL associative containers (e.g., std::map). For debugging purposes, it must also be possible to write them into standard C++ streams. More precisely, for such a type Id, at least the following operators have to be provided:

bool operator== ( const Id &, const Id & );
bool operator!= ( const Id &, const Id & );
bool operator< ( const Id &, const Id & );
template< class C, class T >
std::basic_ostream< C, T > &operator<< ( std::basic_ostream< C, T > &, const Id & );
std::ostream & operator<<(std::ostream &out, const PartitionType &type)
write a PartitionType to a stream
Definition gridenums.hh:70

The index map $m$ has the following properties:

The set of ids $ \mathbf{I} = \{i\ |\ \exists e\in E : m(e)=i\}$ used by the id set is not necessarily consecutive. In practice the numbers can be quite large, especially in a parallel implementation. Therefore the type used to represent the id can be chosen by the application.

Ids and leaf entities

An element is a copy of its father element if it is the only son. This concept can be transferred to all higher codimensions because in a nested grid structure the entities of any codimension form a set of trees. However, the roots of these trees are not necessarily on level 0. Thus, we define that an entity is a copy of another entity if it is the only descendant of this entity in the refinement tree. This is illustrated in the following figure where, for example, vertex w is a copy of vertex v.

Sharing of ids.

The copy relation can be trivially extended to be an equivalence relation. With respect to ids we define that all copies of an entity share the same id. In the example of the figure the vertices v and w would have the same id.

This definition is useful to transfer data related to the leaf grid during grid modification.

Global id set

A global id set provides ids that are unique over all processes over which the grid is distributed. All grid implementations provide a global id set.

Local id set

A local id set provides ids that are unique within one process but two entities in different processes may have the same id. Obviously, a global id set is also a local id set. A grid implementation may provide an extra local id set for efficiency reasons. In sequential grids local and global id set are identical. All grid implementations provide a local id set.

Member Typedef Documentation

◆ IdType

template<class GridImp , class IdSetImp , class IdTypeImp >
typedef IdTypeImp Dune::IdSet< GridImp, IdSetImp, IdTypeImp >::IdType

Type used to represent an id.

Constructor & Destructor Documentation

◆ IdSet()

template<class GridImp , class IdSetImp , class IdTypeImp >
Dune::IdSet< GridImp, IdSetImp, IdTypeImp >::IdSet ( )
inline

Member Function Documentation

◆ id() [1/2]

template<class GridImp , class IdSetImp , class IdTypeImp >
template<class Entity >
IdType Dune::IdSet< GridImp, IdSetImp, IdTypeImp >::id ( const Entity e) const
inline

Get id of an entity. This method is simpler to use than the one below.

◆ id() [2/2]

template<class GridImp , class IdSetImp , class IdTypeImp >
template<int cc>
IdType Dune::IdSet< GridImp, IdSetImp, IdTypeImp >::id ( const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &  e) const
inline

Get id of an entity of codim cc. Unhandy because template parameter must be supplied explicitely.

◆ subId()

template<class GridImp , class IdSetImp , class IdTypeImp >
IdType Dune::IdSet< GridImp, IdSetImp, IdTypeImp >::subId ( const typename std::remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &  e,
int  i,
unsigned int  codim 
) const
inline

Get id of subentity i of co-dimension codim of a co-dimension 0 entity.


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