Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes > Class Template Reference
[IndexSet and IdSet]
#include <indexidset.hh>

Detailed Description
template<class GridImp, class IndexSetImp, class IndexSetTypes>
class Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >
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.
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.
Overview
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:
- It is unique within the subsets
, i.e. for any
we have
.
- It is consecutive and zero-starting within the subsets
, i.e. we have
for any
.
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.
Level index
Index set where corresponds to all entities of a given grid level. All grid implementations provide level indices.
Leaf Index
Index set where corresponds to all entities of the leaf grid. All grid implementations provide a leaf index.
Public Types | |
typedef int | IndexType |
type of index (in upcomming version this is unsigned int) | |
Public Member Functions | |
Index access from entity | |
template<int cc> | |
int | 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> | |
int | 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> | |
int | 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 ![]() | |
int | size (GeometryType type) const |
Return total number of entities of given geometry type in entity set ![]() | |
int | 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... |
Member Function Documentation
int 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.
- Parameters:
-
e Reference to codim cc entity, where cc is the template parameter of the function.
- Returns:
- An index in the range 0 ... Max number of entities in set - 1.
Referenced by Dune::IndexSetDefaultImplementation< Dune::ALU3dGrid< dim, dimworld, elType >, Dune::ALU3dGridHierarchicIndexSet< dim, dimworld, elType >, Dune::ALU3dGridHierarchicIteratorTypes< Dune::ALU3dGrid< dim, dimworld, elType > > >::contains(), Dune::IndexSetDefaultImplementation< Dune::ALU3dGrid< dim, dimworld, elType >, Dune::ALU3dGridHierarchicIndexSet< dim, dimworld, elType >, Dune::ALU3dGridHierarchicIteratorTypes< Dune::ALU3dGrid< dim, dimworld, elType > > >::subIndex(), and Dune::GnuplotWriter< GridType, IndexSet >::write().
int 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.
- Parameters:
-
e Reference to codim cc entity. Since entity knows its codimension, automatic extraction is possible.
- Returns:
- An index in the range 0 ... Max number of entities in set - 1.
Reimplemented in Dune::ALU2dGridHierarchicIndexSet< dim, dimworld >, Dune::ALU3dGridHierarchicIndexSet< dim, dimworld, elType >, Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.
int 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.
- Parameters:
-
e Reference to codim 0 entity. i Number of codim cc subentity of e, where cc is the template parameter of the function.
- Returns:
- An index in the range 0 ... Max number of entities in set - 1.
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 .
- Parameters:
-
[in] codim A valid codimension.
- Returns:
- Const reference to a vector of geometry types.
Reimplemented in Dune::ALU2dGridHierarchicIndexSet< dim, dimworld >, Dune::ALU3dGridHierarchicIndexSet< dim, dimworld, elType >, Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.
int Dune::IndexSet< GridImp, IndexSetImp, IndexSetTypes >::size | ( | GeometryType | type | ) | const [inline] |
Return total number of entities of given geometry type in entity set .
- Parameters:
-
[in] type A valid geometry type.
- Returns:
- number of entities.
Reimplemented in Dune::ALU2dGridHierarchicIndexSet< dim, dimworld >, Dune::ALU3dGridHierarchicIndexSet< dim, dimworld, elType >, Dune::DefaultLevelIndexSet< GridImp >, and Dune::DefaultLeafIndexSet< GridImp >.
int 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.
- Parameters:
-
[in] codim A valid codimension
- Returns:
- number of entities.
Reimplemented in Dune::ALU2dGridHierarchicIndexSet< dim, dimworld >, Dune::ALU3dGridHierarchicIndexSet< dim, dimworld, elType >, 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< Dune::YaspGrid< dim, dimworld >, Dune::YaspLeafIndexSet< Dune::YaspGrid< dim, dimworld > >, Dune::YaspLeafIndexSetTypes< Dune::YaspGrid< dim, dimworld > > >, 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::YaspGrid< dim, dimworld >, Dune::YaspLevelIndexSet< Dune::YaspGrid< dim, dimworld > >, Dune::YaspLevelIndexSetTypes< Dune::YaspGrid< dim, dimworld > > >, Dune::IndexSetDefaultImplementation< Dune::SGrid< dim, dimworld >, Dune::SGridLeafIndexSet< Dune::SGrid< dim, dimworld > >, Dune::SGridLeafIndexSetTypes< Dune::SGrid< dim, dimworld > > >, Dune::IndexSetDefaultImplementation< GridImp, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSetTypes< GridImp > >, Dune::IndexSetDefaultImplementation< Dune::ALU2dGrid< dim, dimworld >, Dune::ALU2dGridHierarchicIndexSet< dim, dimworld >, Dune::ALU2dGridHierarchicIteratorTypes< Dune::ALU2dGrid< dim, dimworld > > >, and Dune::IndexSetDefaultImplementation< Dune::ALU3dGrid< dim, dimworld, elType >, Dune::ALU3dGridHierarchicIndexSet< dim, dimworld, elType >, Dune::ALU3dGridHierarchicIteratorTypes< Dune::ALU3dGrid< dim, dimworld, elType > > >.
The documentation for this class was generated from the following file: