3 #ifndef DUNE_GRID_YASPGRIDINDEXSET_HH
4 #define DUNE_GRID_YASPGRIDINDEXSET_HH
20 template<
class Gr
idImp,
bool isLeafIndexSet>
22 :
public IndexSet< GridImp, YaspIndexSet< GridImp, isLeafIndexSet >, unsigned int >
24 typedef YaspIndexSet< GridImp, isLeafIndexSet > This;
25 typedef IndexSet< GridImp, This, unsigned int > Base;
37 assert(not isLeafIndexSet);
40 for (
int codim=0; codim<=GridImp::dimension; codim++)
48 assert(isLeafIndexSet);
51 for (
int codim=0; codim<=GridImp::dimension; codim++)
57 IndexType
index (
const typename remove_const<GridImp>::type::Traits::template Codim<cc>::Entity& e)
const
59 return grid.getRealImplementation(e).compressedIndex();
64 IndexType
subIndex (
const typename remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e,
65 int i,
unsigned int codim )
const
67 assert( cc == 0 || cc == GridImp::dimension );
68 if( cc == GridImp::dimension )
69 return grid.getRealImplementation(e).compressedIndex();
71 return grid.getRealImplementation(e).subCompressedIndex(i,codim);
77 return (isLeafIndexSet)
79 : grid.size( level, type );
85 return (isLeafIndexSet)
87 : grid.size( level, codim );
91 template<
class EntityType>
94 return (isLeafIndexSet)
95 ? e.level() == grid.maxLevel()
99 std::vector< GeometryType >
types (
int codim )
const {
return mytypes[ codim ]; }
102 const std::vector<GeometryType>&
geomTypes (
int codim)
const
104 return mytypes[codim];
110 std::vector<GeometryType> mytypes[remove_const<GridImp>::type::dimension+1];
115 #endif // DUNE_GRID_YASPGRIDINDEXSET_HH
Definition: alugrid/common/declaration.hh:18
int size(GeometryType type) const
get number of entities of given type and level (the level is known to the object) ...
Definition: yaspgridindexsets.hh:75
YaspIndexSet(const GridImp &g, int l)
Level grid view constructor stores reference to a grid and level.
Definition: yaspgridindexsets.hh:33
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
IndexType index(const typename remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e) const
get index of an entity
Definition: yaspgridindexsets.hh:57
IndexTypeImp IndexType
The type used for the indices.
Definition: indexidset.hh:90
int size(int codim) const
return size of set for a given codim
Definition: yaspgridindexsets.hh:83
YaspIndexSet(const GridImp &g)
Level grid view constructor stores reference to a grid and level.
Definition: yaspgridindexsets.hh:45
const std::vector< GeometryType > & geomTypes(int codim) const
deliver all geometry types used in this grid
Definition: yaspgridindexsets.hh:102
bool contains(const EntityType &e) const
return true if the given entity is contained in .
Definition: yaspgridindexsets.hh:92
IndexType subIndex(const typename 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:64
Include standard header files.
Definition: agrid.hh:59
Base::IndexType IndexType
Definition: yaspgridindexsets.hh:28
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
std::vector< GeometryType > types(int codim) const
Definition: yaspgridindexsets.hh:99