3 #ifndef DUNE_GRID_COMMON_MAPPER_HH
4 #define DUNE_GRID_COMMON_MAPPER_HH
8 #include <dune/common/deprecated.hh>
9 #include <dune/common/bartonnackmanifcheck.hh>
107 template <
typename G,
typename MapperImp,
typename IndexType=
int>
119 template<
class EntityType>
120 Index DUNE_DEPRECATED_MSG(
"Will be removed after dune-grid-2.4. Use method 'index' instead!")
map (const EntityType& e)
const
122 CHECK_INTERFACE_IMPLEMENTATION((asImp().
map(e)));
123 return asImp().map(e);
132 template<
class EntityType>
133 Index
index (
const EntityType& e)
const
135 CHECK_INTERFACE_IMPLEMENTATION((asImp().
map(e)));
136 return asImp().index(e);
147 Index DUNE_DEPRECATED_MSG(
"Will be removed after dune-grid-2.4. Use method 'index' instead!")
map (const typename G::Traits::template Codim<0>::
Entity& e,
149 unsigned int codim)
const
151 CHECK_INTERFACE_IMPLEMENTATION((asImp().
map(e,i,codim)));
152 return asImp().map(e,i,codim);
162 Index
subIndex (
const typename G::Traits::template Codim<0>::Entity& e,
164 unsigned int codim)
const
166 CHECK_INTERFACE_IMPLEMENTATION((asImp().
map(e,i,codim)));
167 return asImp().subIndex(e,i,codim);
180 CHECK_INTERFACE_IMPLEMENTATION((asImp().
size()));
181 return asImp().size();
192 template<
class EntityType>
193 bool contains (
const EntityType& e,
int& result)
const
195 CHECK_INTERFACE_IMPLEMENTATION((asImp().
contains(e,result )));
196 return asImp().contains(e,result );
209 bool contains (
const typename G::Traits::template Codim<0>::Entity& e,
int i,
int cc,
int& result)
const
211 CHECK_INTERFACE_IMPLEMENTATION((asImp().
contains(e,i,cc,result)))
212 return asImp().contains(e,i,cc,result);
219 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().
update()));
224 MapperImp& asImp () {
return static_cast<MapperImp &
> (*this);}
226 const MapperImp& asImp ()
const {
return static_cast<const MapperImp &
>(*this);}
231 #undef CHECK_INTERFACE_IMPLEMENTATION
232 #undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
void update()
Reinitialize mapper after grid has been modified.
Definition: mapper.hh:217
Wrapper class for entities.
Definition: common/entity.hh:61
bool contains(const EntityType &e, int &result) const
Returns true if the entity is contained in the index set and at the same time the array index is retu...
Definition: mapper.hh:193
Mapper interface.
Definition: mapper.hh:108
IndexType Index
Number type used for indices.
Definition: mapper.hh:112
bool contains(const typename G::Traits::template Codim< 0 >::Entity &e, int i, int cc, int &result) const
Returns true if the subentity is contained in the index set and at the same time the array index is r...
Definition: mapper.hh:209
int size() const
Return total number of entities in the entity set managed by the mapper.
Definition: mapper.hh:178
Index map(const EntityType &e) const
Map entity to array index.
Definition: mapper.hh:120
Index index(const EntityType &e) const
Map entity to array index.
Definition: mapper.hh:133
Include standard header files.
Definition: agrid.hh:59
Index subIndex(const typename G::Traits::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
Map subentity i of codim cc of a codim 0 entity to array index.
Definition: mapper.hh:162