1 #ifndef DUNE_FEM_GRIDPART_COMMON_INDEXSET_HH 2 #define DUNE_FEM_GRIDPART_COMMON_INDEXSET_HH 8 #include <dune/common/deprecated.hh> 10 #include <dune/geometry/type.hh> 24 template<
class Traits >
26 template<
class Traits >
28 template<
class Traits >
33 namespace Capabilities
45 template<
class IndexSet >
48 template<
class Traits >
54 static const bool v = decltype(
__isConsecutive( std::declval< IndexSet >() ) )::value;
68 template<
class IndexSet >
71 template<
class Traits >
74 static std::false_type __isAdaptive ( ... );
77 static const bool v = decltype( __isAdaptive( std::declval< IndexSet >() ) )::value;
84 template<
class IndexSet >
89 template<
class IndexSet >
94 #endif // #ifndef DOXYGEN 108 template<
class Traits >
113 static const int dimension = Traits::dimension;
115 template<
int codim >
126 typedef typename Traits::Types
Types;
135 return impl().types( codim );
139 const std::vector< GeometryType > &
geomTypes (
int codim )
const 140 DUNE_DEPRECATED_MSG(
"IndexSet::geomTypes(codim) is deprecated, use IndexSet::types(codim) instead")
142 return impl().geomTypes( codim );
146 template<
class Entity >
149 return impl().contains( entity );
153 IndexType
size ( GeometryType type )
const 155 return impl().size( type );
159 IndexType
size (
int codim )
const 161 return impl().size( codim );
165 template<
class Entity >
166 IndexType
index (
const Entity &entity )
const 168 return index< Entity::codimension >( entity );
172 template<
int codim >
173 IndexType
index (
const typename Codim< codim >::Entity &entity )
const 175 return impl().template index< codim >( entity );
179 template<
class Entity >
180 IndexType
subIndex (
const Entity &entity,
int i,
unsigned int cd )
const 182 return subIndex< Entity::codimension >( entity, i, cd );
186 template<
int codim >
187 IndexType
subIndex (
const typename Codim< codim >::Entity &entity,
int i,
unsigned int cd )
const 189 return impl().template subIndex< codim >( entity, i, cd );
193 const typename Traits::IndexSetType &
impl ()
const 195 return static_cast< const typename Traits::IndexSetType &
>( *this );
209 template<
class Traits >
216 using BaseType::impl;
239 void insertEntity (
const typename BaseType::template Codim< 0 >::Entity &entity )
241 impl().insertEntity( entity );
245 void removeEntity (
const typename BaseType::template Codim< 0 >::Entity &entity )
247 impl().removeEntity( entity );
251 void backup ()
const { impl().backup(); }
260 impl().write( stream );
267 impl().read( stream );
273 typename Traits::IndexSetType &
impl ()
275 const typename Traits::IndexSetType &impl = BaseType::impl();
276 return const_cast< typename Traits::IndexSetType &
>( impl );
290 template<
class Traits >
297 using BaseType::impl;
309 return impl().numberOfHoles( type );
315 return impl().oldIndex( hole, type );
321 return impl().newIndex( hole, type );
328 int numberOfHoles (
int codim )
const 329 DUNE_DEPRECATED_MSG(
"AdaptiveIndexSet::numberOfHoles(int) is deprecated, use AdaptiveIndexSet::numberOfHoles(type) instead")
331 return impl().numberOfHoles( codim );
334 int oldIndex (
int hole,
int codim )
const 335 DUNE_DEPRECATED_MSG(
"AdaptiveIndexSet::oldIndex(int, int) is deprecated, use AdaptiveIndexSet::oldIndex(int, type) instead")
337 return impl().oldIndex( hole, codim );
340 int newIndex (
int hole,
int codim )
const 341 DUNE_DEPRECATED_MSG(
"AdaptiveIndexSet::newIndex(int) is deprecated, use AdaptiveIndexSet::newIndex(int, type) instead")
343 return impl().numberOfHoles( hole, codim );
346 #endif // #ifndef DOXYGEN 353 #endif // #ifndef DUNE_FEM_GRIDPART_COMMON_INDEXSET_HH
Definition: common/indexset.hh:116
interface documentation for (grid part) index sets
Definition: common/indexset.hh:25
Traits::IndexSetType & impl()
Definition: common/indexset.hh:273
bool contains(const Entity &entity) const
return true if entity has index
Definition: common/indexset.hh:147
int numberOfHoles(GeometryType type) const
return number of holes for given type
Definition: common/indexset.hh:307
IndexType index(const Entity &entity) const
return index for given entity
Definition: common/indexset.hh:166
int newIndex(int hole, GeometryType type) const
return new index for given hole and type
Definition: common/indexset.hh:319
Types types(int codim) const
return range of geometry types
Definition: common/indexset.hh:133
void removeEntity(const typename BaseType::template Codim< 0 >::Entity &entity)
please doc me
Definition: common/indexset.hh:245
IndexType index(const typename Codim< codim >::Entity &entity) const
return index for given entity
Definition: common/indexset.hh:173
specialize with true if index set implements the interface for consecutive index sets ...
Definition: common/indexset.hh:46
static std::true_type __isConsecutive(const ConsecutiveIndexSet< Traits > &)
IndexType subIndex(const Entity &entity, int i, unsigned int cd) const
return index for given subentity
Definition: common/indexset.hh:180
void insertEntity(const typename BaseType::template Codim< 0 >::Entity &entity)
please doc me
Definition: common/indexset.hh:239
extended interface for adaptive, consecutive index sets
Definition: common/indexset.hh:29
void backup() const
please doc me
Definition: common/indexset.hh:251
void read(InStreamInterface< T > &stream)
please doc me
Definition: common/indexset.hh:265
void write(OutStreamInterface< T > &stream) const
please doc me
Definition: common/indexset.hh:258
Definition: coordinate.hh:4
int oldIndex(int hole, GeometryType type) const
return old index for given hole and type
Definition: common/indexset.hh:313
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
IndexType size(int codim) const
return number of entities of given codimension
Definition: common/indexset.hh:159
void resize()
please doc me
Definition: common/indexset.hh:233
IndexType size(GeometryType type) const
return number of entities of given type
Definition: common/indexset.hh:153
Traits::template Codim< codim >::Entity Entity
entity type
Definition: common/indexset.hh:119
IndexType subIndex(const typename Codim< codim >::Entity &entity, int i, unsigned int cd) const
return index for given subentity
Definition: common/indexset.hh:187
bool compress()
please doc me
Definition: common/indexset.hh:236
static constexpr bool consecutive() noexcept
please doc me
Definition: common/indexset.hh:226
const Traits::IndexSetType & impl() const
Definition: common/indexset.hh:193
Traits::IndexType IndexType
index type
Definition: common/indexset.hh:123
void restore()
please doc me
Definition: common/indexset.hh:254
Traits::Types Types
geometry type range type
Definition: common/indexset.hh:126
static const bool v
Definition: common/indexset.hh:54
const std::vector< GeometryType > & geomTypes(int codim) const
return vector of geometry types used of given codimension
Definition: common/indexset.hh:139
abstract interface for an output stream
Definition: streams.hh:44
extended interface for consecutive index sets
Definition: common/indexset.hh:27