dune-grid
2.1.1
|
Index Set Interface base class. More...
#include <dune/grid/common/indexidset.hh>
Public Types | |
typedef IndexTypeImp | 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 Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const |
Map a subentity to an index. | |
template<class Entity > | |
IndexType | subIndex (const Entity &e, int i, unsigned int codim) const |
Map a subentity to an index. | |
Static Public Attributes | |
static const int | dimension = remove_const< GridImp >::type::dimension |
dimension of the grid (maximum allowed codimension) | |
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 ![]() | |
IndexSet () |
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 |
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.
typedef IndexTypeImp Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::IndexType |
The type used for the indices.
Reimplemented in Dune::YaspLeafIndexSet< GridImp >, Dune::YaspLeafIndexSet< const YaspGrid< dim > >, Dune::YaspLevelIndexSet< GridImp >, Dune::YaspLevelIndexSet< const YaspGrid< dim > >, Dune::DefaultLeafIndexSet< GridImp >, Dune::AlbertaGridIndexSet< dim, dimworld >, Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >, Dune::DefaultLevelIndexSet< GridImp >, Dune::AlbertaGridHierarchicIndexSet< dim, dimworld >, and Dune::GeoGrid::IndexSet< Grid, HostIndexSet >.
Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::IndexSet | ( | ) | [inline] |
bool Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::contains | ( | const EntityType & | e | ) | const [inline] |
Return true if the given entity is contained in .
Reimplemented in Dune::YaspLeafIndexSet< GridImp >, Dune::YaspLeafIndexSet< const YaspGrid< dim > >, Dune::YaspLevelIndexSet< GridImp >, Dune::YaspLevelIndexSet< const YaspGrid< dim > >, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSet< const SGrid< dim, dimworld > >, Dune::SGridLevelIndexSet< GridImp >, Dune::DefaultLeafIndexSet< GridImp >, Dune::DefaultLevelIndexSet< GridImp >, Dune::ALU3dGridHierarchicIndexSet< elType, Comm >, Dune::ALU2dGridHierarchicIndexSet< dim, dimworld, eltype >, and Dune::ALU2dGridHierarchicIndexSet< dim, dimworld, elementType >.
Referenced by Dune::IndexSet< const SGrid< dim, dimworld >, SGridLeafIndexSet< const SGrid< dim, dimworld > > >::contains().
const std::vector<GeometryType>& Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::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::YaspLeafIndexSet< GridImp >, Dune::YaspLeafIndexSet< const YaspGrid< dim > >, Dune::YaspLevelIndexSet< GridImp >, Dune::YaspLevelIndexSet< const YaspGrid< dim > >, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSet< const SGrid< dim, dimworld > >, Dune::SGridLevelIndexSet< GridImp >, Dune::DefaultLeafIndexSet< GridImp >, Dune::DefaultLevelIndexSet< GridImp >, Dune::AlbertaGridIndexSet< dim, dimworld >, Dune::AlbertaGridHierarchicIndexSet< dim, dimworld >, Dune::ALU3dGridHierarchicIndexSet< elType, Comm >, Dune::ALU2dGridHierarchicIndexSet< dim, dimworld, eltype >, Dune::ALU2dGridHierarchicIndexSet< dim, dimworld, elementType >, and Dune::GeoGrid::IndexSet< Grid, HostIndexSet >.
Referenced by Dune::IndexSet< const SGrid< dim, dimworld >, SGridLeafIndexSet< const SGrid< dim, dimworld > > >::geomTypes().
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::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. |
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::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::DefaultLeafIndexSet< GridImp >, Dune::DefaultLevelIndexSet< GridImp >, and Dune::ALU3dGridHierarchicIndexSet< elType, Comm >.
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::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::YaspLeafIndexSet< GridImp >, Dune::YaspLeafIndexSet< const YaspGrid< dim > >, Dune::YaspLevelIndexSet< GridImp >, Dune::YaspLevelIndexSet< const YaspGrid< dim > >, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSet< const SGrid< dim, dimworld > >, Dune::SGridLevelIndexSet< GridImp >, Dune::DefaultLeafIndexSet< GridImp >, Dune::DefaultLevelIndexSet< GridImp >, Dune::ALU3dGridHierarchicIndexSet< elType, Comm >, Dune::ALU2dGridHierarchicIndexSet< dim, dimworld, eltype >, Dune::ALU2dGridHierarchicIndexSet< dim, dimworld, elementType >, and Dune::GeoGrid::IndexSet< Grid, HostIndexSet >.
Referenced by Dune::fillGridViewInfoSerial(), main(), Dune::OneDGrid::size(), Dune::IndexSet< const SGrid< dim, dimworld >, SGridLeafIndexSet< const SGrid< dim, dimworld > > >::size(), and Dune::UGGrid< dimworld >::size().
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::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::YaspLeafIndexSet< GridImp >, Dune::YaspLeafIndexSet< const YaspGrid< dim > >, Dune::YaspLevelIndexSet< GridImp >, Dune::YaspLevelIndexSet< const YaspGrid< dim > >, Dune::SGridLeafIndexSet< GridImp >, Dune::SGridLeafIndexSet< const SGrid< dim, dimworld > >, Dune::SGridLevelIndexSet< GridImp >, Dune::DefaultLeafIndexSet< GridImp >, Dune::AlbertaGridIndexSet< dim, dimworld >, Dune::DefaultLevelIndexSet< GridImp >, Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >, Dune::AlbertaGridHierarchicIndexSet< dim, dimworld >, Dune::ALU3dGridHierarchicIndexSet< elType, Comm >, Dune::ALU2dGridHierarchicIndexSet< dim, dimworld, eltype >, Dune::ALU2dGridHierarchicIndexSet< dim, dimworld, elementType >, and Dune::GeoGrid::IndexSet< Grid, HostIndexSet >.
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::subIndex | ( | const typename Traits::template Codim< cc >::Entity & | e, |
int | i, | ||
unsigned int | codim | ||
) | const [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 codimsion cc entity |
[in] | i | number subentity of e within the codimension |
[in] | codim | codimension of the subentity we're interested in (must satisfy cc <= codim <= dimension) |
Reimplemented in Dune::AlbertaGridIndexSet< dim, dimworld >, Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >, and Dune::AlbertaGridHierarchicIndexSet< dim, dimworld >.
IndexType Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::subIndex | ( | const Entity & | e, |
int | i, | ||
unsigned int | codim | ||
) | const [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 |
const int Dune::IndexSet< GridImp, IndexSetImp, IndexTypeImp >::dimension = remove_const< GridImp >::type::dimension [static] |
dimension of the grid (maximum allowed codimension)
Reimplemented in Dune::AlbertaGridIndexSet< dim, dimworld >, Dune::IndexSetDefaultImplementation< GridImp, IndexSetImp >, Dune::AlbertaGridHierarchicIndexSet< dim, dimworld >, and Dune::GeoGrid::IndexSet< Grid, HostIndexSet >.