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 >
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;
44 explicit IndexSet (
const HostIndexSet &hostIndexSet )
45 : hostIndexSet_( &hostIndexSet )
48 IndexSet (
const This &other )
49 : hostIndexSet_( other.hostIndexSet_ )
52 const This &operator= (
const This &other )
54 hostIndexSet_ = other.hostIndexSet_;
62 IndexType
index (
const typename Traits::template Codim< cc >::Entity &entity )
const
64 return Grid::getRealImplementation( entity ).index( hostIndexSet() );
68 IndexType
subIndex (
const typename Traits::template Codim< cc >::Entity &entity,
int i,
unsigned int codim )
const
70 return Grid::getRealImplementation( entity ).subIndex( hostIndexSet(), i, codim );
73 IndexType size ( GeometryType type )
const
75 return hostIndexSet().size( type );
78 int size (
int codim )
const
80 return hostIndexSet().size( codim );
83 template<
class Entity >
84 bool contains (
const Entity &entity )
const
86 return Grid::getRealImplementation( entity ).isContained( hostIndexSet() );
89 const std::vector< GeometryType > &geomTypes (
int codim )
const
91 return hostIndexSet().geomTypes( codim );
94 operator bool ()
const {
return bool( hostIndexSet_ ); }
97 const HostIndexSet &hostIndexSet ()
const
100 return *hostIndexSet_;
103 const HostIndexSet *hostIndexSet_;
Index Set Interface base class.
Definition: indexidset.hh:78
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...
Definition: indexidset.hh:107
IndexTypeImp IndexType
The type used for the indices.
Definition: indexidset.hh:85
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:146
bool contains(const EntityType &e) const
Return true if the given entity is contained in .
Definition: indexidset.hh:228
Provides base classes for index and id sets.
Dune namespace.
Definition: alignment.hh:14
Traits for type conversions and type information.