1 #ifndef DUNE_FEM_GRIDPART_IDGRIDPART_INDEXSET_HH 2 #define DUNE_FEM_GRIDPART_IDGRIDPART_INDEXSET_HH 7 #include <dune/geometry/type.hh> 23 template<
class Gr
idFamily >
28 namespace __IdIndexSet
34 template<
class Gr
idFamily >
38 typedef typename std::remove_const< GridFamily >::type::Traits
Traits;
43 static const int dimension = HostIndexSetType::dimension;
51 typedef typename HostIndexSetType::IndexType
IndexType;
53 typedef typename HostIndexSetType::Types
Types;
56 : hostIndexSet_( hostIndexSet )
64 const std::vector< GeometryType > &
geomTypes (
int codim )
const 69 template<
class Entity >
72 return hostIndexSet().contains( entity.impl().hostEntity() );
75 IndexType
size ( GeometryType type )
const 80 IndexType
size (
int codim )
const 85 template<
class Entity >
88 return index< Entity::codimension >( entity );
94 return hostIndexSet().template index< codim >( entity.impl().hostEntity() );
97 template<
class Entity >
100 return subIndex< Entity::codimension >( entity, i, cd );
103 template<
int codim >
106 return hostIndexSet().template subIndex< codim >( entity.impl().hostEntity(), i, cd );
111 return hostIndexSet_;
115 const HostIndexSetType &hostIndexSet_;
123 template<
class Gr
idFamily >
132 using BaseType::hostIndexSet;
135 : BaseType ( hostIndexSet )
146 hostIndexSet().insertEntity( entity.impl().hostEntity() );
151 hostIndexSet().removeEntity( entity.impl().hostEntity() );
173 return const_cast< HostIndexSetType &
>( BaseType::hostIndexSet() );
182 template<
class Gr
idFamily >
190 : BaseType ( hostIndexSet )
229 template<
class GridFamily,
230 class HostIndexSet =
typename std::remove_const< GridFamily >::type::Traits::HostGridPartType::IndexSetType,
235 typedef typename std::conditional< adaptive,
237 typename std::conditional< consecutive,
251 template<
class Gr
idFamily >
261 : BaseType ( hostIndexSet )
267 namespace Capabilities
270 template<
class Gr
idFamily >
275 template<
class Gr
idFamily >
280 template<
class Gr
idFamily >
302 #endif // #ifndef DUNE_FEM_GRIDPART_IDGRIDPART_INDEXSET_HH IndexType subIndex(const typename Codim< codim >::Entity &entity, int i, unsigned int cd) const
Definition: idgridpart/indexset.hh:104
std::remove_const< GridFamily >::type::Traits Traits
Definition: idgridpart/indexset.hh:38
IndexType subIndex(const Entity &entity, int i, unsigned int cd) const
Definition: idgridpart/indexset.hh:98
Traits::template Codim< codim >::Entity Entity
Definition: idgridpart/indexset.hh:48
static constexpr PersistentIndexSetInterface * map(IndexSetType &indexSet) noexcept
Definition: idgridpart/indexset.hh:290
void restore()
Definition: idgridpart/indexset.hh:156
bool consecutive() const
Definition: idgridpart/indexset.hh:138
IndexType index(const typename Codim< codim >::Entity &entity) const
Definition: idgridpart/indexset.hh:92
const HostIndexSetType & hostIndexSet() const
Definition: idgridpart/indexset.hh:109
IndexSet(const HostIndexSetType &hostIndexSet)
Definition: idgridpart/indexset.hh:55
Traits::HostGridPartType::IndexSetType HostIndexSetType
Definition: idgridpart/indexset.hh:41
IndexType index(const Entity &entity) const
Definition: idgridpart/indexset.hh:86
Definition: idgridpart/indexset.hh:233
int numberOfHoles(int codim) const
Definition: idgridpart/indexset.hh:198
AdaptiveIndexSet(const typename BaseType::HostIndexSetType &hostIndexSet)
Definition: idgridpart/indexset.hh:189
specialize with true if index set implements the interface for consecutive index sets ...
Definition: common/indexset.hh:46
void read(InStreamInterface< T > &stream)
Definition: idgridpart/indexset.hh:165
int oldIndex(int hole, GeometryType type) const
Definition: idgridpart/indexset.hh:203
IdIndexSet(const typename BaseType::HostIndexSetType &hostIndexSet)
Definition: idgridpart/indexset.hh:260
int numberOfHoles(GeometryType type) const
Definition: idgridpart/indexset.hh:193
Definition: idgridpart/indexset.hh:24
void insertEntity(const typename BaseType::template Codim< 0 >::Entity &entity)
Definition: idgridpart/indexset.hh:144
int newIndex(int hole, GeometryType type) const
Definition: idgridpart/indexset.hh:213
void backup() const
Definition: idgridpart/indexset.hh:154
HostIndexSetType::Types Types
Definition: idgridpart/indexset.hh:53
void write(OutStreamInterface< T > &stream)
Definition: idgridpart/indexset.hh:159
static const int dimension
Definition: idgridpart/indexset.hh:43
Definition: coordinate.hh:4
std::conditional< adaptive, AdaptiveIndexSet< GridFamily >, typename std::conditional< consecutive, ConsecutiveIndexSet< GridFamily >, IndexSet< GridFamily > >::type >::type Type
Definition: idgridpart/indexset.hh:241
specialize with true if index set implements the interface for adaptive index sets ...
Definition: common/indexset.hh:69
abstract interface for an input stream
Definition: streams.hh:177
ConsecutiveIndexSet(const HostIndexSetType &hostIndexSet)
Definition: idgridpart/indexset.hh:134
int oldIndex(int hole, int codim) const
Definition: idgridpart/indexset.hh:208
IndexType size(GeometryType type) const
Definition: idgridpart/indexset.hh:75
Definition: idgridpart/indexset.hh:35
Definition: idgridpart/indexset.hh:124
IndexType size(int codim) const
Definition: idgridpart/indexset.hh:80
HostIndexSetType & hostIndexSet()
Definition: idgridpart/indexset.hh:171
Types types(int codim) const
Definition: idgridpart/indexset.hh:59
void resize()
Definition: idgridpart/indexset.hh:140
capability for persistent index sets
Definition: persistentindexset.hh:90
Definition: idgridpart/indexset.hh:46
bool contains(const Entity &entity) const
Definition: idgridpart/indexset.hh:70
bool compress()
Definition: idgridpart/indexset.hh:142
HostIndexSetType::IndexType IndexType
Definition: idgridpart/indexset.hh:51
int newIndex(int hole, int codim) const
Definition: idgridpart/indexset.hh:218
Definition: idgridpart/indexset.hh:183
BaseType::HostIndexSetType HostIndexSetType
Definition: idgridpart/indexset.hh:130
virtual base class for persistent index sets
Definition: persistentindexset.hh:34
void removeEntity(const typename BaseType::template Codim< 0 >::Entity &entity)
Definition: idgridpart/indexset.hh:149
abstract interface for an output stream
Definition: streams.hh:44
const std::vector< GeometryType > & geomTypes(int codim) const
Definition: idgridpart/indexset.hh:64