3#ifndef DUNE_GEOGRID_INDEXSETS_HH
4#define DUNE_GEOGRID_INDEXSETS_HH
10#include <dune/grid/common/gridenums.hh>
13#include <dune/grid/geometrygrid/declaration.hh>
24 template<
class Gr
id,
class HostIndexSet >
26 :
public Dune::IndexSet< Grid, IndexSet< Grid, HostIndexSet >, typename HostIndexSet::IndexType, typename HostIndexSet::Types >
28 typedef IndexSet< Grid, HostIndexSet > This;
31 typedef typename remove_const< Grid >::type::Traits Traits;
33 typedef typename Traits::HostGrid HostGrid;
36 static const int dimension = Traits::dimension;
46 explicit IndexSet (
const HostIndexSet &hostIndexSet )
47 : hostIndexSet_( &hostIndexSet )
50 IndexSet (
const This &other )
51 : hostIndexSet_( other.hostIndexSet_ )
54 const This &operator= (
const This &other )
56 hostIndexSet_ = other.hostIndexSet_;
64 IndexType
index (
const typename Traits::template Codim< cc >::Entity &entity )
const
66 return Grid::getRealImplementation( entity ).index( hostIndexSet() );
70 IndexType
subIndex (
const typename Traits::template Codim< cc >::Entity &entity,
int i,
unsigned int codim )
const
72 return Grid::getRealImplementation( entity ).subIndex( hostIndexSet(), i, codim );
75 IndexType size ( GeometryType type )
const
77 return hostIndexSet().size( type );
80 int size (
int codim )
const
82 return hostIndexSet().size( codim );
85 template<
class Entity >
86 bool contains (
const Entity &entity )
const
88 return Grid::getRealImplementation( entity ).isContained( hostIndexSet() );
91 Types types (
int codim )
const {
return hostIndexSet().types( codim ); }
93 const std::vector< GeometryType > &geomTypes (
int codim )
const
95 return hostIndexSet().geomTypes( codim );
98 operator bool ()
const {
return bool( hostIndexSet_ ); }
101 const HostIndexSet &hostIndexSet ()
const
104 return *hostIndexSet_;
107 const HostIndexSet *hostIndexSet_;
Index Set Interface base class.
Definition: indexidset.hh:76
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
TypesImp Types
iterator range for geometry types in domain
Definition: indexidset.hh:93
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:115
IndexTypeImp IndexType
The type used for the indices.
Definition: indexidset.hh:90
Provides base classes for index and id sets.
Dune namespace.
Definition: alignment.hh:10
Traits for type conversions and type information.