5 #ifndef DUNE_GRID_COMMON_SCSGMAPPER_HH 6 #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;
50 using size_type = decltype(std::declval<typename GV::IndexSet>().
size(0));
58 , indexSet_(&gridView_.indexSet())
61 if (indexSet_->types(c).size() != 1)
62 DUNE_THROW(
GridError,
"mapper treats only a single codim and a single geometry type");
70 template<
class EntityType>
73 static_assert(EntityType::codimension == c,
"Entity of wrong codim passed to SingleCodimSingleGeomTypeMapper");
74 return indexSet_->index(e);
85 int i,
unsigned int codim)
const 88 DUNE_THROW(
GridError,
"Id of wrong codim requested from SingleCodimSingleGeomTypeMapper");
89 return indexSet_->subIndex(e,i,codim);
102 return indexSet_->size(c);
111 template<
class EntityType>
139 gridView_ = gridView;
140 indexSet_ = &gridView_.indexSet();
150 gridView_ = std::move(gridView);
151 indexSet_ = &gridView_.indexSet();
concept Entity
Model of a grid entity.
Definition: concepts/entity.hh:119
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:84
size_type size() const
Return total number of entities in the entity set managed by the mapper.
Definition: scsgmapper.hh:100
GV::IndexSet::IndexType Index
Number type used for indices.
Definition: scsgmapper.hh:44
void update(const GV &gridView)
Recalculates indices after grid adaptation.
Definition: scsgmapper.hh:137
Provides classes with basic mappers which are used to attach data to a grid.
Different resources needed by all grid implementations.
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:126
Index index(const EntityType &e) const
Map entity to array index.
Definition: scsgmapper.hh:71
void update(GV &&gridView)
Recalculates indices after grid adaptation.
Definition: scsgmapper.hh:148
Include standard header files.
Definition: agrid.hh:59
decltype(std::declval< typename GV::IndexSet >().size(0)) size_type
Number type used for the overall size (the return value of the 'size' method)
Definition: scsgmapper.hh:50
Base class for exceptions in Dune grid modules.
Definition: exceptions.hh:18
Implementation class for a single codim and single geometry type mapper.
Definition: scsgmapper.hh:38
SingleCodimSingleGeomTypeMapper(const GV &gridView)
Construct mapper from grid and one of its index sets.
Definition: scsgmapper.hh:56
bool contains(const EntityType &e, Index &result) const
Returns true if the entity is contained in the index set.
Definition: scsgmapper.hh:112
concept IndexSet
Model of an index set.
Definition: concepts/indexidset.hh:55
Mapper interface.
Definition: mapper.hh:109