5#ifndef DUNE_GEOGRID_INDEXSETS_HH
6#define DUNE_GEOGRID_INDEXSETS_HH
10#include <dune/common/typetraits.hh>
26 template<
class Gr
id,
class HostIndexSet >
28 :
public Dune::IndexSet< Grid, IndexSet< Grid, HostIndexSet >, typename HostIndexSet::IndexType, typename HostIndexSet::Types >
33 typedef typename std::remove_const< Grid >::type::Traits Traits;
35 typedef typename Traits::HostGrid HostGrid;
46 explicit IndexSet (
const HostIndexSet &hostIndexSet )
47 : hostIndexSet_( &hostIndexSet )
61 IndexType index (
const typename Traits::template Codim< cc >::Entity &entity )
const
63 return entity.impl().index( hostIndexSet() );
67 IndexType subIndex (
const typename Traits::template Codim< cc >::Entity &entity,
int i,
unsigned int codim )
const
69 return entity.impl().subIndex( hostIndexSet(), i, codim );
74 return hostIndexSet().size( type );
77 std::size_t
size (
int codim )
const
79 return hostIndexSet().size( codim );
82 template<
class Entity >
85 return entity.impl().isContained( hostIndexSet() );
88 Types types (
int codim )
const {
return hostIndexSet().types( codim ); }
90 const std::vector< GeometryType > &
geomTypes (
int codim )
const
92 return hostIndexSet().geomTypes( codim );
95 explicit operator bool ()
const {
return bool( hostIndexSet_ ); }
97 void reset () { hostIndexSet_ =
nullptr; }
98 void reset (
const HostIndexSet &hostIndexSet ) { hostIndexSet_ = &hostIndexSet; }
101 const HostIndexSet &hostIndexSet ()
const
104 return *hostIndexSet_;
107 const HostIndexSet *hostIndexSet_ =
nullptr;
Provides base classes for index and id sets.
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
TypesImp Types
iterator range for geometry types in domain
Definition: indexidset.hh:95
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:113
IndexTypeImp IndexType
The type used for the indices.
Definition: indexidset.hh:92
DUNE-conform implementation of the entity.
Definition: geometrygrid/entity.hh:694
Definition: geometrygrid/indexsets.hh:29
std::size_t size(GeometryType type) const
Definition: geometrygrid/indexsets.hh:72
IndexSet & operator=(const This &)=delete
Types types(int codim) const
Definition: geometrygrid/indexsets.hh:88
IndexSet(const This &)=delete
void reset(const HostIndexSet &hostIndexSet)
Definition: geometrygrid/indexsets.hh:98
void reset()
Definition: geometrygrid/indexsets.hh:97
static const int dimension
Definition: geometrygrid/indexsets.hh:38
const std::vector< GeometryType > & geomTypes(int codim) const
Definition: geometrygrid/indexsets.hh:90
IndexType subIndex(const typename Traits::template Codim< cc >::Entity &entity, int i, unsigned int codim) const
Definition: geometrygrid/indexsets.hh:67
bool contains(const Entity &entity) const
Definition: geometrygrid/indexsets.hh:83
IndexSet(const HostIndexSet &hostIndexSet)
Definition: geometrygrid/indexsets.hh:46
Base::Types Types
Definition: geometrygrid/indexsets.hh:42
std::size_t size(int codim) const
Definition: geometrygrid/indexsets.hh:77
Base::IndexType IndexType
Definition: geometrygrid/indexsets.hh:40
IndexType index(const typename Traits::template Codim< cc >::Entity &entity) const
Definition: geometrygrid/indexsets.hh:61