5#ifndef DUNE_GRID_YASPGRIDINDEXSET_HH
6#define DUNE_GRID_YASPGRIDINDEXSET_HH
22 template<
class Gr
idImp,
bool isLeafIndexSet>
24 :
public IndexSet< GridImp, YaspIndexSet< GridImp, isLeafIndexSet >, unsigned int >
39 assert(not isLeafIndexSet);
42 for (
int codim=0; codim<=GridImp::dimension; codim++)
43 mytypes[codim].push_back(GeometryTypes::cube(GridImp::dimension-codim));
50 assert(isLeafIndexSet);
53 for (
int codim=0; codim<=GridImp::dimension; codim++)
54 mytypes[codim].push_back(GeometryTypes::cube(GridImp::dimension-codim));
59 IndexType index (
const typename std::remove_const<GridImp>::type::Traits::template Codim<cc>::Entity& e)
const
61 return e.impl().compressedIndex();
66 IndexType subIndex (
const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e,
67 int i,
unsigned int codim )
const
69 return e.impl().subCompressedIndex(i, codim);
75 return (isLeafIndexSet)
77 : grid.size( level, type );
81 std::size_t
size (
int codim)
const
83 return (isLeafIndexSet)
85 : grid.size( level, codim );
89 template<
class EntityType>
92 return (isLeafIndexSet)
93 ? e.level() == grid.maxLevel()
97 std::vector< GeometryType >
types (
int codim )
const {
return mytypes[ codim ]; }
100 const std::vector<GeometryType>&
geomTypes (
int codim)
const
102 return mytypes[codim];
108 std::vector<GeometryType> mytypes[std::remove_const<GridImp>::type::dimension+1];
Include standard header files.
Definition: agrid.hh:60
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
Index Set Interface base class.
Definition: indexidset.hh:78
IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
Map a subentity to an index.
Definition: indexidset.hh:153
IndexTypeImp IndexType
The type used for the indices.
Definition: indexidset.hh:92
Implementation of Level- and LeafIndexSets for YaspGrid.
Definition: yaspgridindexsets.hh:25
const std::vector< GeometryType > & geomTypes(int codim) const
deliver all geometry types used in this grid
Definition: yaspgridindexsets.hh:100
YaspIndexSet(const GridImp &g)
Level grid view constructor stores reference to a grid and level.
Definition: yaspgridindexsets.hh:47
YaspIndexSet(const GridImp &g, int l)
Level grid view constructor stores reference to a grid and level.
Definition: yaspgridindexsets.hh:35
IndexType index(const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e) const
get index of an entity
Definition: yaspgridindexsets.hh:59
bool contains(const EntityType &e) const
return true if the given entity is contained in .
Definition: yaspgridindexsets.hh:90
std::size_t size(GeometryType type) const
get number of entities of given type and level (the level is known to the object)
Definition: yaspgridindexsets.hh:73
IndexType subIndex(const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
get index of subentity of an entity
Definition: yaspgridindexsets.hh:66
std::vector< GeometryType > types(int codim) const
Definition: yaspgridindexsets.hh:97
std::size_t size(int codim) const
return size of set for a given codim
Definition: yaspgridindexsets.hh:81
Base::IndexType IndexType
Definition: yaspgridindexsets.hh:30