6 #ifndef DUNE_GRID_COMMON_INDEXIDSET_HH 7 #define DUNE_GRID_COMMON_INDEXIDSET_HH 10 #include <dune/common/exceptions.hh> 22 #include <dune/common/bartonnackmanifcheck.hh> 76 template<
class Gr
idImp,
class IndexSetImp,
class IndexTypeImp,
class TypesImp >
81 typedef typename std::remove_const< GridImp >::type::Traits Traits;
98 static const int dimension = std::remove_const< GridImp >::type::dimension;
115 CHECK_INTERFACE_IMPLEMENTATION((asImp().
template index<cc>(e)));
116 return asImp().template index<cc>(e);
128 template<
class Entity>
132 CHECK_INTERFACE_IMPLEMENTATION((asImp().
template index<cc>(e)));
133 return asImp().template index<cc>(e);
154 int i,
unsigned int codim )
const 156 CHECK_INTERFACE_IMPLEMENTATION((asImp().
template subIndex< cc >(e,i,codim)));
157 return asImp().template subIndex< cc >(e,i,codim);
181 template<
class Entity >
185 return asImp().template subIndex< cc >( e, i, codim );
213 CHECK_INTERFACE_IMPLEMENTATION( (asImp().
types( codim )) );
214 return asImp().types( codim );
225 CHECK_INTERFACE_IMPLEMENTATION((asImp().
size(type)));
226 return asImp().size(type);
238 CHECK_INTERFACE_IMPLEMENTATION((asImp().
size(codim)));
239 return asImp().size(codim);
247 template<
class Entity>
250 CHECK_INTERFACE_IMPLEMENTATION((asImp().
contains(e)));
251 return asImp().contains(e);
266 IndexSetImp& asImp () {
return static_cast<IndexSetImp &
> (*this);}
268 const IndexSetImp& asImp ()
const {
return static_cast<const IndexSetImp &
>(*this);}
271 #undef CHECK_INTERFACE_IMPLEMENTATION 272 #undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION 279 template<
class Gr
idImp,
class IndexSetImp>
281 :
public IndexSet< GridImp, IndexSetImp >
284 typedef typename std::remove_const< GridImp >::type::Traits Traits;
304 Types types (
int codim )
const {
return asImp().geomTypes( codim ); }
313 auto size (
const int codim )
const 315 using SizeType = std::decay_t<decltype( Base::size( Dune::GeometryType() ) )>;
326 IndexSetImp &asImp () {
return static_cast< IndexSetImp &
>( *this );}
327 const IndexSetImp &asImp ()
const {
return static_cast< const IndexSetImp &
>( *this ); }
445 template<
class Gr
idImp,
class IdSetImp,
class IdTypeImp>
450 using Traits =
typename std::remove_const< GridImp >::type::Traits;
462 static constexpr
auto dimension = std::remove_const< GridImp >::type::dimension;
465 template<
class Entity>
469 return asImp().template id<cc>(e);
476 return asImp().template id<cc>(e);
483 return asImp().subId(e,i,codim);
498 IdSetImp& asImp () {
return static_cast<IdSetImp &
> (*this);}
500 const IdSetImp& asImp ()
const {
return static_cast<const IdSetImp &
>(*this);}
505 #endif // DUNE_GRID_COMMON_INDEXIDSET_HH Export the type of the entity used as parameter in the id(...) method.
Definition: common/indexidset.hh:457
Types types(int codim) const
Definition: common/indexidset.hh:304
Base::Types Types
Definition: common/indexidset.hh:290
bool contains(const Entity &e) const
Return true if the given entity is contained in .
Definition: common/indexidset.hh:248
concept IdSet
Model of an id set.
Definition: concepts/indexidset.hh:105
Types types(int codim) const
obtain all geometry types of entities in domain
Definition: common/indexidset.hh:211
IdSet & operator=(const IdSet &)=delete
Forbid the assignment operator.
auto size(GeometryType type) const
Return total number of entities of given geometry type in entity set .
Definition: common/indexidset.hh:223
Index Set Interface base class.
Definition: common/grid.hh:348
Base::IndexType IndexType
The type used for the indices.
Definition: common/indexidset.hh:288
IndexType subIndex(const typename Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
Map a subentity to an index.
Definition: common/indexidset.hh:153
IdTypeImp IdType
Type used to represent an id.
Definition: common/indexidset.hh:453
auto size(const int codim) const
Return total number of entities of given codim in the entity set . This is simply a sum over all geom...
Definition: common/indexidset.hh:313
Traits ::template Codim< cc >::Entity Entity
Definition: common/indexidset.hh:88
static const int dimension
dimension of the grid (maximum allowed codimension)
Definition: common/indexidset.hh:98
auto size(int codim) const
Return total number of entities of given codim in the entity set . This is simply a sum over all geom...
Definition: common/indexidset.hh:236
IdType id(const Entity &e) const
Get id of an entity. This method is simpler to use than the one below.
Definition: common/indexidset.hh:466
IdType id(const typename Codim< cc >::Entity &e) const
Get id of an entity of codim cc. Unhandy because template parameter must be supplied explicitly...
Definition: common/indexidset.hh:474
Different resources needed by all grid implementations.
typename Traits::template Codim< cc >::Entity Entity
Definition: common/indexidset.hh:458
static constexpr auto dimension
dimension of the grid (maximum allowed codimension)
Definition: common/indexidset.hh:462
IdType subId(const typename Codim< 0 >::Entity &e, int i, unsigned int codim) const
Get id of subentity i of co-dimension codim of a co-dimension 0 entity.
Definition: common/indexidset.hh:481
IndexTypeImp IndexType
The type used for the indices.
Definition: common/indexidset.hh:92
Provide default implementation of method if IndexSet.
Definition: common/indexidset.hh:280
Include standard header files.
Definition: agrid.hh:59
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: common/indexidset.hh:113
static const int dimension
dimension of the grid (maximum allowed codimension)
Definition: common/indexidset.hh:293
static constexpr int codimension
Know your own codimension.
Definition: common/entity.hh:106
IndexType index(const Entity &e) const
Map entity to index. Easier to use than the above because codimension template parameter need not be ...
Definition: common/indexidset.hh:129
Wrapper class for entities.
Definition: common/entity.hh:65
IndexSet & operator=(const IndexSet &)=delete
Forbid the assignment operator.
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
Export the type of the entity used as parameter in the index(...) method.
Definition: common/indexidset.hh:86
TypesImp Types
iterator range for geometry types in domain
Definition: common/indexidset.hh:95
Id Set Interface.
Definition: common/grid.hh:349
concept IndexSet
Model of an index set.
Definition: concepts/indexidset.hh:55