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;
128 template<
class Entity>
154 int i,
unsigned int codim )
const
181 template<
class Entity >
214 return asImp().types( codim );
223 auto size (GeometryType type)
const
226 return asImp().size(type);
239 return asImp().size(codim);
247 template<
class Entity>
251 return asImp().contains(
e);
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() ) )>;
318 for(GeometryType gt :
types(codim))
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);}
Include standard header files.
Definition agrid.hh:60
Wrapper class for entities.
Definition common/entity.hh:66
static constexpr int codimension
Know your own codimension.
Definition common/entity.hh:106
Index Set Interface base class.
Definition common/indexidset.hh:78
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
auto size(GeometryType type) const
Return total number of entities of given geometry type in entity set .
Definition common/indexidset.hh:223
IndexType subIndex(const Entity &e, int i, unsigned int codim) const
Map a subentity to an index.
Definition common/indexidset.hh:182
static const int dimension
dimension of the grid (maximum allowed codimension)
Definition common/indexidset.hh:98
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
TypesImp Types
iterator range for geometry types in domain
Definition common/indexidset.hh:95
Types types(int codim) const
obtain all geometry types of entities in domain
Definition common/indexidset.hh:211
IndexSet(const IndexSet &)=delete
Forbid the copy constructor.
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
IndexSet & operator=(const IndexSet &)=delete
Forbid the assignment operator.
IndexTypeImp IndexType
The type used for the indices.
Definition common/indexidset.hh:92
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
bool contains(const Entity &e) const
Return true if the given entity is contained in .
Definition common/indexidset.hh:248
Id Set Interface.
Definition common/indexidset.hh:447
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
static constexpr auto dimension
dimension of the grid (maximum allowed codimension)
Definition common/indexidset.hh:462
IdSet(const IdSet &)=delete
Forbid the copy constructor.
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
IdTypeImp IdType
Type used to represent an id.
Definition common/indexidset.hh:453
IdSet & operator=(const IdSet &)=delete
Forbid the assignment operator.
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
Export the type of the entity used as parameter in the index(...) method.
Definition common/indexidset.hh:87
Traits::template Codim< cc >::Entity Entity
Definition common/indexidset.hh:88
Provide default implementation of method if IndexSet.
Definition common/indexidset.hh:282
Base::IndexType IndexType
The type used for the indices.
Definition common/indexidset.hh:288
Base::Types Types
Definition common/indexidset.hh:290
static const int dimension
dimension of the grid (maximum allowed codimension)
Definition common/indexidset.hh:293
Types types(int codim) const
Definition common/indexidset.hh:304
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
Export the type of the entity used as parameter in the id(...) method.
Definition common/indexidset.hh:457
typename Traits::template Codim< cc >::Entity Entity
Definition common/indexidset.hh:458
Different resources needed by all grid implementations.