dune-vtk 2.12
Loading...
Searching...
No Matches
datacollectorinterface.impl.hh
Go to the documentation of this file.
1#pragma once
2
4
5namespace Dune::Vtk {
6
7template <class GV, class D, class P>
8 template <class T, class VtkFunction>
9std::vector<T> DataCollectorInterface<GV,D,P>
10 ::cellDataImpl (VtkFunction const& fct) const
11{
12 std::vector<T> data;
13 data.reserve(this->numCells() * fct.numComponents());
14
15 auto localFct = localFunction(fct);
16 for (auto const& e : elements(gridView_, partition)) {
17 localFct.bind(e);
18 auto refElem = referenceElement<T,dim>(e.type());
19 for (int comp = 0; comp < fct.numComponents(); ++comp)
20 data.emplace_back(localFct.evaluate(comp, refElem.position(0,0)));
21 localFct.unbind();
22 }
23 return data;
24}
25
26} // end namespace Dune::Vtk
Definition writer.hh:16