3 #ifndef DUNE_GEOGRID_INDEXSETS_HH 4 #define DUNE_GEOGRID_INDEXSETS_HH 8 #include <dune/common/typetraits.hh> 24 template<
class Gr
id,
class HostIndexSet >
26 :
public Dune::IndexSet< Grid, IndexSet< Grid, HostIndexSet >, typename HostIndexSet::IndexType, typename HostIndexSet::Types >
31 typedef typename std::remove_const< Grid >::type::Traits Traits;
33 typedef typename Traits::HostGrid HostGrid;
44 explicit IndexSet (
const HostIndexSet &hostIndexSet )
45 : hostIndexSet_( &hostIndexSet )
59 IndexType
index (
const typename Traits::template Codim< cc >::Entity &entity )
const 61 return Grid::getRealImplementation( entity ).index( hostIndexSet() );
65 IndexType
subIndex (
const typename Traits::template Codim< cc >::Entity &entity,
int i,
unsigned int codim )
const 67 return Grid::getRealImplementation( entity ).subIndex( hostIndexSet(), i, codim );
72 return hostIndexSet().size( type );
75 int size (
int codim )
const 77 return hostIndexSet().size( codim );
80 template<
class Entity >
83 return Grid::getRealImplementation( entity ).isContained( hostIndexSet() );
86 Types
types (
int codim )
const {
return hostIndexSet().types( codim ); }
88 const std::vector< GeometryType > &
geomTypes (
int codim )
const 90 return hostIndexSet().geomTypes( codim );
93 explicit operator bool ()
const {
return bool( hostIndexSet_ ); }
95 void reset () { hostIndexSet_ =
nullptr; }
96 void reset (
const HostIndexSet &hostIndexSet ) { hostIndexSet_ = &hostIndexSet; }
99 const HostIndexSet &hostIndexSet ()
const 102 return *hostIndexSet_;
105 const HostIndexSet *hostIndexSet_ =
nullptr;
112 #endif // #ifndef DUNE_GEOGRID_INDEXSETS_HH IndexType subIndex(const typename Traits::template Codim< cc >::Entity &entity, int i, unsigned int codim) const
Definition: geometrygrid/indexsets.hh:65
IndexTypeImp IndexType
The type used for the indices.
Definition: indexidset.hh:90
Index Set Interface base class.
Definition: common/grid.hh:346
bool contains(const Entity &entity) const
Definition: geometrygrid/indexsets.hh:81
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:151
Base::IndexType IndexType
Definition: geometrygrid/indexsets.hh:38
void reset()
Definition: geometrygrid/indexsets.hh:95
void reset(const HostIndexSet &hostIndexSet)
Definition: geometrygrid/indexsets.hh:96
Base::Types Types
Definition: geometrygrid/indexsets.hh:40
Provides base classes for index and id sets.
IndexType size(GeometryType type) const
Definition: geometrygrid/indexsets.hh:70
Definition: geometrygrid/indexsets.hh:25
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
int size(int codim) const
Definition: geometrygrid/indexsets.hh:75
IndexType index(const typename Traits::template Codim< cc >::Entity &entity) const
Definition: geometrygrid/indexsets.hh:59
Types types(int codim) const
Definition: geometrygrid/indexsets.hh:86
static const int dimension
Definition: geometrygrid/indexsets.hh:36
IndexType index(const typename 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...
Definition: indexidset.hh:111
DUNE-conform implementation of the entityThis class merely changes the template parameters of the ent...
Definition: geometrygrid/entity.hh:47
const std::vector< GeometryType > & geomTypes(int codim) const
Definition: geometrygrid/indexsets.hh:88
IndexSet & operator=(const This &)=delete
IndexSet(const HostIndexSet &hostIndexSet)
Definition: geometrygrid/indexsets.hh:44
TypesImp Types
iterator range for geometry types in domain
Definition: indexidset.hh:93
Include standard header files.
Definition: agrid.hh:58