3 #ifndef DUNE_GRID_COMMON_SCSGMAPPER_HH
4 #define DUNE_GRID_COMMON_SCSGMAPPER_HH
37 template <
typename GV,
int c>
39 public Mapper<typename GV::Grid,SingleCodimSingleGeomTypeMapper<GV,c>, typename GV::IndexSet::IndexType >
44 typedef typename GV::IndexSet::IndexType
Index;
51 : is(gridView.indexSet())
54 if (is.types(c).size() != 1)
55 DUNE_THROW(
GridError,
"mapper treats only a single codim and a single geometry type");
63 template<
class EntityType>
64 Index DUNE_DEPRECATED_MSG(
"Will be removed after dune-grid-2.4. Use method 'index' instead!")
map (const EntityType& e)
const
66 static_assert(EntityType::codimension == c,
"Entity of wrong codim passed to SingleCodimSingleGeomTypeMapper");
75 template<
class EntityType>
76 Index
index (
const EntityType& e)
const
78 static_assert(EntityType::codimension == c,
"Entity of wrong codim passed to SingleCodimSingleGeomTypeMapper");
89 Index DUNE_DEPRECATED_MSG(
"Will be removed after dune-grid-2.4. Use method 'subIndex' instead!")
map (const typename GV::template Codim<0>::
Entity& e,
90 int i,
unsigned int codim)
const
93 DUNE_THROW(
GridError,
"Id of wrong codim requested from SingleCodimSingleGeomTypeMapper");
94 return is.subIndex(e,i,codim);
104 Index
subIndex (
const typename GV::template Codim<0>::Entity& e,
105 int i,
unsigned int codim)
const
108 DUNE_THROW(
GridError,
"Id of wrong codim requested from SingleCodimSingleGeomTypeMapper");
109 return is.subIndex(e,i,codim);
131 template<
class EntityType>
132 bool contains (
const EntityType& e, Index& result)
const
146 bool contains (
const typename GV::template Codim<0>::Entity& e,
int i,
int cc, Index& result)
const
159 const typename GV::IndexSet& is;
180 template <
typename G,
int c>
202 template <
typename G,
int c>
void update()
Recalculates map after mesh adaptation.
Definition: scsgmapper.hh:154
Single codim and single geometry type mapper for leaf entities.
Definition: scsgmapper.hh:181
Wrapper class for entities.
Definition: common/entity.hh:61
Mapper interface.
Definition: mapper.hh:108
Provides classes with basic mappers which are used to attach data to a grid.
int size() const
Return total number of entities in the entity set managed by the mapper.
Definition: scsgmapper.hh:120
bool contains(const EntityType &e, Index &result) const
Returns true if the entity is contained in the index set.
Definition: scsgmapper.hh:132
Base class for exceptions in Dune grid modules.
Definition: exceptions.hh:16
Different resources needed by all grid implementations.
Implementation class for a single codim and single geometry type mapper.
Definition: scsgmapper.hh:38
GV::IndexSet::IndexType Index
Number type used for indices.
Definition: scsgmapper.hh:44
Index map(const EntityType &e) const
Map entity to array index.
Definition: scsgmapper.hh:64
Single codim and single geometry type mapper for entities of one level.
Definition: scsgmapper.hh:203
bool contains(const typename GV::template Codim< 0 >::Entity &e, int i, int cc, Index &result) const
Returns true if the entity is contained in the index set.
Definition: scsgmapper.hh:146
Include standard header files.
Definition: agrid.hh:59
LevelSingleCodimSingleGeomTypeMapper(const G &grid, int level)
Definition: scsgmapper.hh:209
Index index(const EntityType &e) const
Map entity to array index.
Definition: scsgmapper.hh:76
LeafSingleCodimSingleGeomTypeMapper(const G &grid)
The constructor.
Definition: scsgmapper.hh:186
Index subIndex(const typename GV::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
Map subentity of codim 0 entity to array index.
Definition: scsgmapper.hh:104
SingleCodimSingleGeomTypeMapper(const GV &gridView)
Construct mapper from grid and one of its index sets.
Definition: scsgmapper.hh:50