4 #ifndef DUNE_MCMGMAPPER_HH
5 #define DUNE_MCMGMAPPER_HH
10 #include <dune/geometry/referenceelements.hh>
11 #include <dune/geometry/type.hh>
12 #include <dune/geometry/typeindex.hh>
101 template <
typename GV,
template<
int>
class Layout>
103 public Mapper<typename GV::Grid,MultipleCodimMultipleGeomTypeMapper<GV,Layout> >
109 #ifndef __INTEL_COMPILER
125 : gridView(gridView_),
126 is(gridView.indexSet()),
127 offset(GlobalGeometryTypeIndex::
size(GV::dimension)),
138 : gridView(gridView_),
139 is(gridView.indexSet()),
140 offset(GlobalGeometryTypeIndex::
size(GV::dimension))
152 template<
class EntityType>
153 int map (
const EntityType& e)
const
156 return is.index(e) + offset[GlobalGeometryTypeIndex::index(gt)];
166 int map (
const typename GV::template Codim<0>::Entity& e,
int i,
unsigned int codim)
const
168 GeometryType gt=ReferenceElements<double,GV::dimension>::general(e.type()).type(i,codim);
169 assert(GlobalGeometryTypeIndex::index(gt) < n);
170 return is.subIndex(e, i, codim) + offset[GlobalGeometryTypeIndex::index(gt)];
192 template<
class EntityType>
193 bool contains (
const EntityType& e,
int& result)
const
195 if(!is.contains(e) || !layout.contains(e.type()))
212 bool contains (
const typename GV::template Codim<0>::Entity& e,
int i,
int cc,
int& result)
const
214 result = this->
map(e,i,cc);
224 for (
unsigned int codim = 0; codim <= GV::dimension; ++codim)
227 typedef std::vector<GeometryType> GTV;
228 const GTV >v = is.geomTypes(codim);
229 for (
typename GTV::const_iterator it = gtv.begin(); it != gtv.end(); ++it)
232 if (layout.contains(*it))
234 offset[GlobalGeometryTypeIndex::index(*it)] = n;
246 const typename GV::IndexSet& is;
248 std::vector<int> offset;
249 mutable Layout<GV::dimension> layout;
267 template <
typename G,
template<
int>
class Layout>
278 :
Base(grid.leafView())
290 :
Base(grid.leafView(),layout)
306 template <
typename G,
template<
int>
class Layout>
317 :
Base(grid.levelGridView(level))
330 :
Base(grid.levelGridView(level),layout)