5 #ifndef DUNE_MAPPER2_HH
6 #define DUNE_MAPPER2_HH
10 #include <dune/common/bartonnackmanifcheck.hh>
109 template <
typename G,
typename MapperImp>
118 template<
class EntityType>
119 int map (
const EntityType& e)
const
121 CHECK_INTERFACE_IMPLEMENTATION((asImp().
map(e)));
122 return asImp().map(e);
133 int map (
const typename G::Traits::template Codim<0>::Entity& e,
135 unsigned int codim)
const
137 CHECK_INTERFACE_IMPLEMENTATION((asImp().
map(e,i,codim)));
138 return asImp().map(e,i,codim);
151 CHECK_INTERFACE_IMPLEMENTATION((asImp().
size()));
152 return asImp().size();
163 template<
class EntityType>
164 bool contains (
const EntityType& e,
int& result)
const
166 CHECK_INTERFACE_IMPLEMENTATION((asImp().
contains(e,result )));
167 return asImp().contains(e,result );
180 bool contains (
const typename G::Traits::template Codim<0>::Entity& e,
int i,
int cc,
int& result)
const
182 CHECK_INTERFACE_IMPLEMENTATION((asImp().
contains(e,i,cc,result)))
183 return asImp().contains(e,i,cc,result);
190 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().
update()));
195 MapperImp& asImp () {
return static_cast<MapperImp &
> (*this);}
197 const MapperImp& asImp ()
const {
return static_cast<const MapperImp &
>(*this);}
202 #undef CHECK_INTERFACE_IMPLEMENTATION
203 #undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
int size() const
Return total number of entities in the entity set managed by the mapper.
Definition: mapper.hh:149
void update()
Reinitialize mapper after grid has been modified.
Definition: mapper.hh:188
Mapper interface.
Definition: mapper.hh:110
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:164
int map(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:133
int map(const EntityType &e) const
Map entity to array index.
Definition: mapper.hh:119
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:180