5 #ifndef DUNE_IDENTITYGRID_INDEXSETS_HH 6 #define DUNE_IDENTITYGRID_INDEXSETS_HH 19 template<
class Gr
idImp>
22 IdentityGridLevelIndexSet<GridImp>,
23 typename std::remove_const<GridImp>::type::HostGridType::LevelGridView::IndexSet::IndexType,
24 typename std::remove_const<GridImp>::type::HostGridType::LevelGridView::IndexSet::Types
29 typedef typename std::remove_const<GridImp>::type::HostGridType
HostGrid;
30 typedef typename HostGrid::LevelGridView::IndexSet::Types
Types;
32 constexpr
static int dim = GridImp::dimension;
38 return grid_->hostgrid_->levelIndexSet(
level_).template index<codim>(
grid_->template getHostEntity<codim>(e));
46 return grid_->hostgrid_->levelIndexSet(
level_).subIndex(
grid_->template getHostEntity<cc>(e), i, codim);
51 std::size_t
size (
int codim)
const {
52 return grid_->hostgrid_->levelIndexSet(
level_).size(codim);
59 return grid_->hostgrid_->levelIndexSet(
level_).size(type);
65 return grid_->hostgrid_->levelIndexSet(
level_).types(codim);
69 template<
class EntityType>
72 return grid_->hostgrid_->levelIndexSet(
level_).contains(
grid_->template getHostEntity<EntityType::codimension>(e));
76 void update(
const GridImp& grid,
int level)
89 template<
class Gr
idImp>
92 IdentityGridLeafIndexSet<GridImp>,
93 typename std::remove_const<GridImp>::type::HostGridType::LeafGridView::IndexSet::IndexType,
94 typename std::remove_const<GridImp>::type::HostGridType::LeafGridView::IndexSet::Types
97 typedef typename std::remove_const<GridImp>::type::HostGridType HostGrid;
101 typedef typename HostGrid::LevelGridView::IndexSet::Types
Types;
107 constexpr
static int dim = std::remove_const<GridImp>::type::dimension;
124 return grid_->hostgrid_->leafIndexSet().template index<codim>(
grid_->template getHostEntity<codim>(e));
136 return grid_->hostgrid_->leafIndexSet().subIndex(
grid_->template getHostEntity<cc>(e),i, codim);
143 return grid_->hostgrid_->leafIndexSet().size(type);
148 std::size_t
size (
int codim)
const 150 return grid_->hostgrid_->leafIndexSet().size(codim);
156 return grid_->hostgrid_->leafIndexSet().types(codim);
160 template<
class EntityType>
163 return grid_->hostgrid_->leafIndexSet().contains(
grid_->template getHostEntity<EntityType::codimension>(e));
181 template <
class Gr
idImp>
183 public IdSet<GridImp,IdentityGridGlobalIdSet<GridImp>,
184 typename std::remove_const<GridImp>::type::HostGridType::Traits::GlobalIdSet::IdType>
187 typedef typename std::remove_const<GridImp>::type::HostGridType HostGrid;
195 typedef typename HostGrid::Traits::GlobalIdSet::IdType
IdType;
207 return grid_->hostgrid_->globalIdSet().id(e.impl().hostEntity_);
219 return grid_->hostgrid_->globalIdSet().subId(e.impl().hostEntity_,i, codim);
233 template<
class Gr
idImp>
235 public IdSet<GridImp,IdentityGridLocalIdSet<GridImp>,
236 typename std::remove_const<GridImp>::type::HostGridType::Traits::LocalIdSet::IdType>
240 typedef typename std::remove_const<GridImp>::type::HostGridType HostGrid;
245 typedef typename HostGrid::Traits::LocalIdSet::IdType
IdType;
261 return grid_->hostgrid_->localIdSet().id(e.impl().hostEntity_);
273 return grid_->hostgrid_->localIdSet().subId(e.impl().hostEntity_,i,codim);
static constexpr int dim
Definition: identitygridindexsets.hh:107
Definition: identitygridindexsets.hh:234
Definition: identitygridindexsets.hh:20
concept Entity
Model of a grid entity.
Definition: concepts/entity.hh:119
IdentityGridLeafIndexSet(const GridImp &grid)
constructor stores reference to a grid and level
Definition: identitygridindexsets.hh:111
IdType id(const typename std::remove_const< GridImp >::type::Traits::template Codim< cd >::Entity &e) const
get id of an entity
Definition: identitygridindexsets.hh:258
void update()
Definition: identitygridindexsets.hh:278
Index Set Interface base class.
Definition: common/grid.hh:348
HostGrid::Traits::LocalIdSet::IdType IdType
define the type used for persistent local ids
Definition: identitygridindexsets.hh:245
HostGrid::LevelGridView::IndexSet::Types Types
Definition: identitygridindexsets.hh:101
Definition: identitygridindexsets.hh:182
std::remove_const< const Dune::IdentityGrid< HostGrid > >::type::HostGridType::Traits::GlobalIdSet::IdType IdType
Type used to represent an id.
Definition: common/indexidset.hh:453
int level_
Definition: identitygridindexsets.hh:85
std::size_t size(int codim) const
get number of entities of given codim, type and on this level
Definition: identitygridindexsets.hh:51
int subIndex(const typename std::remove_const< GridImp >::type::Traits::template Codim< cc >::Entity &e, int i, int codim) const
get index of subEntity of a codim 0 entity
Definition: identitygridindexsets.hh:134
Types types(int codim) const
Deliver all geometry types used in this grid.
Definition: identitygridindexsets.hh:154
std::remove_const< GridImp >::type::HostGridType HostGrid
Definition: identitygridindexsets.hh:29
void update(const GridImp &grid)
Definition: identitygridindexsets.hh:169
IdentityGridGlobalIdSet(const GridImp &g)
constructor stores reference to a grid
Definition: identitygridindexsets.hh:192
GridImp * grid_
Definition: identitygridindexsets.hh:175
Types types(int codim) const
Deliver all geometry types used in this grid.
Definition: identitygridindexsets.hh:63
GridImp * grid_
Definition: identitygridindexsets.hh:83
void update(const GridImp &grid, int level)
Set up the index set.
Definition: identitygridindexsets.hh:76
void update()
Definition: identitygridindexsets.hh:224
int subIndex(const typename GridImp::Traits::template Codim< cc >::Entity &e, int i, int codim) const
get index of subEntity of a codim 0 entity
Definition: identitygridindexsets.hh:44
bool contains(const EntityType &e) const
Return true if the given entity is contained in the index set.
Definition: identitygridindexsets.hh:70
IdentityGridLocalIdSet(const GridImp &g)
constructor stores reference to a grid
Definition: identitygridindexsets.hh:249
Include standard header files.
Definition: agrid.hh:59
IdType id(const typename std::remove_const< GridImp >::type::Traits::template Codim< cd >::Entity &e) const
get id of an entity
Definition: identitygridindexsets.hh:204
const GridImp * grid_
Definition: identitygridindexsets.hh:227
int index(const typename GridImp::Traits::template Codim< codim >::Entity &e) const
get index of an entity
Definition: identitygridindexsets.hh:36
static constexpr int dim
Definition: identitygridindexsets.hh:32
Provides base classes for index and id sets.
const GridImp * grid_
Definition: identitygridindexsets.hh:281
int index(const typename std::remove_const< GridImp >::type::template Codim< codim >::Entity &e) const
get index of an entity
Definition: identitygridindexsets.hh:122
bool contains(const EntityType &e) const
Return true if the given entity is contained in the index set.
Definition: identitygridindexsets.hh:161
std::size_t size(GeometryType type) const
get number of entities of given codim, type and on this level
Definition: identitygridindexsets.hh:57
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
Definition: identitygridindexsets.hh:90
IdType subId(const typename std::remove_const< GridImp >::type::template Codim< 0 >::Entity &e, int i, int codim) const
get id of subEntity
Definition: identitygridindexsets.hh:270
std::remove_const< const Dune::IdentityGrid< HostGrid > >::type::HostGridType::LevelGridView::IndexSet::Types Types
iterator range for geometry types in domain
Definition: common/indexidset.hh:95
HostGrid::Traits::GlobalIdSet::IdType IdType
define the type used for persistent indices
Definition: identitygridindexsets.hh:195
HostGrid::LevelGridView::IndexSet::Types Types
Definition: identitygridindexsets.hh:30
std::size_t size(GeometryType type) const
get number of entities of given type
Definition: identitygridindexsets.hh:141
Id Set Interface.
Definition: common/grid.hh:349
std::size_t size(int codim) const
get number of entities of given codim
Definition: identitygridindexsets.hh:148
IdType subId(const typename std::remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e, int i, int codim) const
get id of subEntity
Definition: identitygridindexsets.hh:216