Commit 4d0ad4f5 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'issue/mcmg_mapper' into 'master'

use mcmg mapper instead of index set when traversing elements

See merge request spraetor/dune-vtk!12
parents 6a19c03c b41890c4
......@@ -2,6 +2,7 @@
#include <dune/geometry/referenceelements.hh>
#include <dune/grid/common/gridenums.hh>
#include <dune/grid/common/mcmgmapper.hh>
namespace Dune {
......@@ -11,12 +12,12 @@ std::vector<T> DataCollectorInterface<GridView, Derived>
::cellDataImpl (VtkFunction const& fct) const
{
std::vector<T> data(gridView_.size(0) * fct.ncomps());
auto const& indexSet = gridView_.indexSet();
MultipleCodimMultipleGeomTypeMapper<GridView> mapper(gridView_, mcmgElementLayout());
auto localFct = localFunction(fct);
for (auto const& e : elements(gridView_, Partitions::all)) {
localFct.bind(e);
auto refElem = referenceElement<T,GridView::dimension>(e.type());
std::size_t idx = fct.ncomps() * indexSet.index(e);
std::size_t idx = fct.ncomps() * mapper.index(e);
for (int comp = 0; comp < fct.ncomps(); ++comp)
data[idx + comp] = T(localFct.evaluate(comp, refElem.position(0,0)));
localFct.unbind();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment