Go to the documentation of this file.
3 #ifndef DUNE_GRID_COMMON_UNIVERSALMAPPER_HH
4 #define DUNE_GRID_COMMON_UNIVERSALMAPPER_HH
9 #include <dune/common/deprecated.hh>
13 #warning "<dune/grid/common/universalmapper.hh> is deprecated in DUNE 2.6"
40 template <
typename G,
typename IDS,
typename IndexType=
int>
42 public Mapper<G,UniversalMapper<G,IDS> >
44 typedef typename IDS::IdType IdType;
70 template<
class EntityType>
73 IdType
id = ids.id(e);
74 typename std::map<IdType,Index>::iterator it = index_.find(
id);
75 if (it!=index_.end())
return it->second;
89 Index subIndex (
const typename G::Traits::template Codim<0>::Entity& e,
int i,
int cc)
const
91 IdType
id = ids.subId(e,i,cc);
92 typename std::map<IdType,Index>::iterator it = index_.find(
id);
93 if (it!=index_.end())
return it->second;
119 template<
class EntityType>
122 IdType
id = ids.id(e);
123 typename std::map<IdType,Index>::iterator it = index_.find(
id);
124 if (it!=index_.end())
141 bool contains (
const typename G::Traits::template Codim<0>::Entity& e,
int i,
int cc,
Index& result)
const
143 IdType
id = ids.subId(e,i,cc);
144 typename std::map<IdType,Index>::iterator it = index_.find(
id);
145 if (it!=index_.end())
171 mutable std::map<IdType,Index> index_;
183 template <
typename G>
192 :
UniversalMapper<G,typename G::Traits::GlobalIdSet>(grid,grid.globalIdSet())
202 template <
typename G>
212 :
UniversalMapper<G,typename G::Traits::LocalIdSet>(grid,grid.localIdSet())
bool contains(const typename G::Traits::template Codim< 0 >::Entity &e, int i, int cc, Index &result) const
Returns true if the entity is contained in the index set.
Definition: universalmapper.hh:141
bool contains(const EntityType &e, Index &result) const
Returns true if the entity is contained in the index set.
Definition: universalmapper.hh:120
void clear()
Definition: universalmapper.hh:161
Provides classes with basic mappers which are used to attach data to a grid.
const IDS & idset
Definition: universalmapper.hh:58
Index subIndex(const typename G::Traits::template Codim< 0 >::Entity &e, int i, int cc) const
Map subentity of codim 0 entity to array index.
Definition: universalmapper.hh:89
Universal mapper based on global ids.
Definition: universalmapper.hh:184
DUNE_DEPRECATED_MSG("GlobalUniversalMapper is deprecated in DUNE 2.6") GlobalUniversalMapper(const G &grid)
Definition: universalmapper.hh:190
DUNE_DEPRECATED_MSG("UniversalMapper is deprecated in DUNE 2.6") UniversalMapper(const G &grid
Construct mapper from grid and one of its id sets.
DUNE_DEPRECATED_MSG("LocalUniversalMapper is deprecated in DUNE 2.6") LocalUniversalMapper(const G &grid)
The constructor.
Definition: universalmapper.hh:210
Implements a mapper for an arbitrary subset of entities.
Definition: universalmapper.hh:41
void update()
Recalculates map after mesh adaptation.
Definition: universalmapper.hh:156
int Index
Number type used for indices.
Definition: mapper.hh:111
Mapper interface.
Definition: mapper.hh:107
Index index(const EntityType &e) const
Map entity to array index.
Definition: universalmapper.hh:71
Include standard header files.
Definition: agrid.hh:58
Universal mapper based on local ids.
Definition: universalmapper.hh:203
int size() const
Return total number of entities in the entity set managed by the mapper.
Definition: universalmapper.hh:106
IndexType Index
Number type used for indices.
Definition: universalmapper.hh:48