4 #ifndef DUNE_MCMGMAPPER_HH
5 #define DUNE_MCMGMAPPER_HH
10 #include <dune/geometry/type.hh>
11 #include <dune/geometry/referenceelements.hh>
100 template <
typename GV,
template<
int>
class Layout>
102 public Mapper<typename GV::Grid,MultipleCodimMultipleGeomTypeMapper<GV,Layout> >
108 #ifndef __INTEL_COMPILER
124 : is(gridView.indexSet()), layout(layout)
134 : is(gridView.indexSet())
144 template<
class EntityType>
145 int map (
const EntityType& e)
const
147 return is.index(e) + offset.find(e.type())->second;
157 int map (
const typename GV::template Codim<0>::Entity& e,
int i,
unsigned int codim)
const
159 GeometryType gt=GenericReferenceElements<double,GV::dimension>::general(e.type()).type(i,codim);
160 return is.subIndex(e,i,codim) + offset.find(gt)->second;
182 template<
class EntityType>
183 bool contains (
const EntityType& e,
int& result)
const
185 if(!is.contains(e) || !layout.contains(e.type()))
202 bool contains (
const typename GV::template Codim<0>::Entity& e,
int i,
int cc,
int& result)
const
204 result = this->
map(e,i,cc);
214 for (
int c=0; c<=GV::dimension; c++)
219 for (
int c=0; c<=GV::dimension; c++)
220 for (
size_t i=0; i<is.geomTypes(c).size(); i++)
221 if (layout.contains(is.geomTypes(c)[i]))
223 offset[is.geomTypes(c)[i]] = n;
224 n += is.size(is.geomTypes(c)[i]);
230 const typename GV::IndexSet& is;
231 std::map<GeometryType,int> offset;
232 mutable Layout<GV::dimension> layout;
250 template <
typename G,
template<
int>
class Layout>
261 :
Base(grid.leafView())
273 :
Base(grid.leafView(),layout)
289 template <
typename G,
template<
int>
class Layout>
300 :
Base(grid.levelView(level))
313 :
Base(grid.levelView(level),layout)