#include <indexidset.hh>
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:
GridImp
Type that is a model of Dune::Grid.IndexSetImp
Type that is a model of Dune::IndexSet.IndexSetTypes
Traits class containing return types depending on implementation.
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 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.
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.
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 ![]() | |
IndexType | size (GeometryType type) const |
Return total number of entities of given geometry type in entity set ![]() | |
IndexType | size (int codim) const |
Return total number of entities of given codim in the entity set ![]() | |
template<class EntityType> | |
bool | contains (const EntityType &e) const |
Return true if the given entity is contained in ![]() | |
template<int cd, PartitionIteratorType pitype> | |
Codim< cd >::template Partition< pitype >::Iterator | begin () const |
Iterator to first entity of given codimension and partition type in ![]() | |
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 ![]() | |
Classes | |
struct | Codim |
Define types needed to iterate over the entities in the index set. More... |
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.
e | Reference to codim cc entity, where cc is the template parameter of the function. |
Referenced by Dune::IndexSetDefaultImplementation< GridImp, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSetTypes< GridImp > >::contains(), and Dune::IndexSetDefaultImplementation< GridImp, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSetTypes< GridImp > >::subIndex().
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.
e | Reference to codim cc entity. Since entity knows its codimension, automatic extraction is possible. |
Reimplemented in Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >::subIndex | ( | const typename remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity & | e, | |
int | i | |||
) | const [inline] |
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.
e | Reference to codim 0 entity. | |
i | Number of codim cc subentity of e, where cc is the template parameter of the function. |
Reimplemented in Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp, IndexSetTypes >, 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 > >, and Dune::IndexSetDefaultImplementation< GridImp, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSetTypes< GridImp > >.
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 .
[in] | codim | A valid codimension. |
Reimplemented in Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.
Referenced by Dune::IndexSet< GridImp, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSetTypes< GridImp > >::geomTypes().
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >::size | ( | GeometryType | type | ) | const [inline] |
Return total number of entities of given geometry type in entity set .
[in] | type | A valid geometry type. |
Reimplemented in Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.
Referenced by Dune::IndexSet< GridImp, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSetTypes< GridImp > >::size().
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >::size | ( | int | codim | ) | const [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 |
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 > >.
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 . The iterator type is available via the public Codim struct.
Reimplemented in Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.
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 . The iterator type is available via the public Codim struct.
Reimplemented in Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.