dune-grid 2.9.0
|
Index Set Interface base class. More...
#include <dune/grid/common/indexidset.hh>
Classes | |
struct | Codim |
Export the type of the entity used as parameter in the index(...) method. More... | |
Public Types | |
typedef IndexTypeImp | IndexType |
The type used for the indices. More... | |
typedef TypesImp | Types |
iterator range for geometry types in domain More... | |
Public Member Functions | |
Index access from entity | |
template<int cc> | |
IndexType | index (const typename 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. More... | |
template<class Entity > | |
IndexType | index (const Entity &e) const |
Map entity to index. Easier to use than the above because codimension template parameter need not be supplied explicitly. The result of calling this method with an entity that is not in the index set is undefined. More... | |
template<int cc> | |
IndexType | subIndex (const typename Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const |
Map a subentity to an index. More... | |
template<class Entity > | |
IndexType | subIndex (const Entity &e, int i, unsigned int codim) const |
Map a subentity to an index. More... | |
Static Public Attributes | |
static const int | dimension = std::remove_const< GridImp >::type::dimension |
dimension of the grid (maximum allowed codimension) More... | |
Access to entity set | |
Types | types (int codim) const |
obtain all geometry types of entities in domain More... | |
auto | size (GeometryType type) const |
Return total number of entities of given geometry type in entity set . More... | |
auto | size (int codim) const |
Return total number of entities of given codim in the entity set . This is simply a sum over all geometry types. More... | |
template<class Entity > | |
bool | contains (const Entity &e) const |
Return true if the given entity is contained in . More... | |
IndexSet (const IndexSet &)=delete | |
Forbid the copy constructor. More... | |
IndexSet & | operator= (const IndexSet &)=delete |
Forbid the assignment operator. More... | |
IndexSet ()=default | |
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.
GridImp | Type that is a model of Dune::Grid. |
IndexSetImp | Type that is a model of Dune::IndexSet. |
IndexTypeImp | The type used by IndexSetImp to store the indices |
TypesImp | iterator range for all geometry types in domain |
An index set provides a map
where is a subset of the entities of a grid and is the set of natural numbers (including 0).
We define the subsets
The index map 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 preferred 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 responsible for reorganizing the information stored in the external arrays appropriately. In order to do this the IdSet concept is supplied.
Index set where corresponds to all entities of a given grid level. All grid implementations provide level indices.
Index set where corresponds to all entities of the leaf grid. All grid implementations provide a leaf index.
typedef IndexTypeImp Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp, TypesImp >::IndexType |
The type used for the indices.
typedef TypesImp Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp, TypesImp >::Types |
iterator range for geometry types in domain
|
protecteddefault |
|
delete |
Forbid the copy constructor.
|
inline |
Return true if the given entity is contained in .
|
inline |
Map entity to index. Easier to use than the above because codimension template parameter need not be supplied explicitly. The result of calling this method with an entity that is not in the index set is undefined.
e | Reference to codim cc entity. Since entity knows its codimension, automatic extraction is possible. |
|
inline |
Map entity to index. The result of calling this method with an entity that is not in the index set is undefined.
e | Reference to codim cc entity, where cc is the template parameter of the function. |
|
delete |
Forbid the assignment operator.
|
inline |
Return total number of entities of given geometry type in entity set .
[in] | type | A valid geometry type. |
|
inline |
Return total number of entities of given codim in the entity set . This is simply a sum over all geometry types.
[in] | codim | A valid codimension |
|
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.
Entity | type of entity (must be GridImp::Codim< cc >::Entity for some cc) |
[in] | e | reference to entity |
[in] | i | number subentity of e within the codimension |
[in] | codim | codimension of the subentity we're interested in |
codim
denotes the codimension with respect to the grid, i.e., it must satisfy cc <= codim <= dimension.
|
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.
cc | codimension of the entity |
[in] | e | reference to codimension cc entity |
[in] | i | number subentity of e within the codimension |
[in] | codim | codimension of the subentity we're interested in |
codim
denotes the codimension with respect to the grid, i.e., it must satisfy cc <= codim <= dimension.
|
inline |
obtain all geometry types of entities in domain
This method returns an iterator range (something that behaves like Dune::IteratorRange) visiting all geometry types of codimension codim in the domain of the index map exactly once. The iterator must implement the concept of a forward iterator (in the sense of the STL). The elements in the iterator range are required to be of type Dune::GeometryType.
[in] | codim | a valid codimension |
|
static |
dimension of the grid (maximum allowed codimension)