Go to the documentation of this file.
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>
66 static_assert(EntityType::codimension == c,
"Entity of wrong codim passed to SingleCodimSingleGeomTypeMapper");
78 int i,
unsigned int codim)
const
81 DUNE_THROW(
GridError,
"Id of wrong codim requested from SingleCodimSingleGeomTypeMapper");
82 return is.subIndex(e,i,codim);
104 template<
class EntityType>
119 bool contains (
const typename GV::template Codim<0>::Entity& e,
int i,
int cc,
Index& result)
const
132 const typename GV::IndexSet& is;
153 template <
typename G,
int c>
175 template <
typename G,
int c>
Different resources needed by all grid implementations.
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:77
Provides classes with basic mappers which are used to attach data to a grid.
Include standard header files.
Definition: agrid.hh:59
Implementation class for a single codim and single geometry type mapper.
Definition: scsgmapper.hh:38
Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid< dim, dimworld, ct, GridFamily > &grid)
leaf grid view for the given grid
Definition: common/grid.hh:878
Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid< dim, dimworld, ct, GridFamily > &grid, int level)
level grid view for the given grid and level.
Definition: common/grid.hh:861
LeafSingleCodimSingleGeomTypeMapper(const G &grid)
The constructor.
Definition: scsgmapper.hh:159
int size() const
Return total number of entities in the entity set managed by the mapper.
Definition: scsgmapper.hh:93
Index index(const EntityType &e) const
Map entity to array index.
Definition: scsgmapper.hh:64
bool contains(const EntityType &e, Index &result) const
Returns true if the entity is contained in the index set.
Definition: scsgmapper.hh:105
GV::IndexSet::IndexType Index
Number type used for indices.
Definition: scsgmapper.hh:44
Single codim and single geometry type mapper for entities of one level.
Definition: scsgmapper.hh:176
Mapper interface.
Definition: mapper.hh:107
void update()
Recalculates map after mesh adaptation.
Definition: scsgmapper.hh:127
Base class for exceptions in Dune grid modules.
Definition: exceptions.hh:16
G::LevelGridView ::IndexSet::IndexType Index
Number type used for indices.
Definition: mapper.hh:111
SingleCodimSingleGeomTypeMapper(const GV &gridView)
Construct mapper from grid and one of its index sets.
Definition: scsgmapper.hh:50
LevelSingleCodimSingleGeomTypeMapper(const G &grid, int level)
Definition: scsgmapper.hh:182
Single codim and single geometry type mapper for leaf entities.
Definition: scsgmapper.hh:154
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:119