dune-grid
2.2.1
|
Id Set Interface. More...
#include <dune/grid/common/indexidset.hh>
Inherited by Dune::SGridGlobalIdSet< const SGrid< dim, dimworld > >, and Dune::YaspGlobalIdSet< const YaspGrid< dim > >.
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. | |
IdType | subId (const typename remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e, int i, unsigned int codim) const |
Get id of subentity i of codim cc of a codim 0 entity. | |
IdSet () |
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 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 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:
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.
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.
typedef IdTypeImp Dune::IdSet< GridImp, IdSetImp, IdTypeImp >::IdType |
Type used to represent an id.
|
inline |
Reimplemented in Dune::GeoGrid::IdSet< Grid, HostIdSet >.
|
inline |
Get id of an entity. This method is simpler to use than the one below.
Reimplemented in Dune::ALU3dGridLocalIdSet< elType, Comm >, Dune::ALU3dGridGlobalIdSet< elType, Comm >, Dune::ALU2dGridLocalIdSet< dim, dimworld, eltype >, and Dune::ALU2dGridLocalIdSet< dim, dimworld, elementType >.
|
inline |
Get id of an entity of codim cc. Unhandy because template parameter must be supplied explicitely.
|
inline |
Get id of subentity i of codim cc of a codim 0 entity.
Reimplemented in Dune::YaspGlobalIdSet< GridImp >, and Dune::SGridGlobalIdSet< GridImp >.
Referenced by Dune::VertexOrderByIdFactory< IdSet, Index >::make().