#include <indexidset.hh>
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 are:
GridImp
Type that is a model of Dune::Grid.IdSetImp
Type that is a model of Dune::IdSet.IdTypeImp
Traits class containing return types depending on implementation.
An id set provides a map
where is a subset of the entities of a grid and
is a discrete set of ids. These ids need not be consecutive nor positive. However, the C++ type that implements them is required to provide
operator<()
and operator==()
. Hence they can be used as keys in an STL map
.
The index map has the following properties:
The set of ids 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.
An element is a copy of its father element if it is the only son. This concept can be transfered 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.
A global id set provides ids that are unique over all processes over wich the grid is distributed. All grid implementations provide a global 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.
Public Types | |
typedef IdTypeImp | IdType |
Type used to represent an id. | |
Public Member Functions | |
template<class EntityType> | |
IdType | id (const EntityType &e) const |
Get id of an entity. This method is simpler to use than the one below. | |
template<int cc> | |
IdType | id (const typename 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. | |
template<int cc> | |
IdType | subId (const typename remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e, int i) const |
Get id of subentity i of codim cc of a codim 0 entity. |