5#include <dune/geometry/referenceelements.hh>
6#include <dune/grid/common/partitionset.hh>
16 template <
class Gr
idView>
46 std::vector<T> data(this->
numPoints() * 3);
47 auto const& indexSet =
gridView_.indexSet();
49 auto geometry = element.geometry();
50 auto refElem = referenceElement<T,dim>(element.type());
53 for (
unsigned int i = 0; i < element.subEntities(
dim); ++i) {
54 std::size_t idx = 3 * indexSet.subIndex(element, i,
dim);
55 auto v = geometry.global(refElem.position(i,
dim));
56 for (std::size_t j = 0; j < v.size(); ++j)
57 data[idx + j] = T(v[j]);
58 for (std::size_t j = v.size(); j < 3u; ++j)
62 for (
unsigned int i = 0; i < element.subEntities(
dim-1); ++i) {
63 std::size_t idx = 3 * (indexSet.subIndex(element, i,
dim-1) +
gridView_.size(
dim));
64 auto v = geometry.global(refElem.position(i,
dim-1));
65 for (std::size_t j = 0; j < v.size(); ++j)
66 data[idx + j] = T(v[j]);
67 for (std::size_t j = v.size(); j < 3u; ++j)
92 std::int64_t old_o = 0;
93 auto const& indexSet =
gridView_.indexSet();
96 for (
unsigned int j = 0; j < c.subEntities(
dim); ++j) {
98 std::int64_t point_idx = indexSet.subIndex(c,k,
dim);
101 for (
unsigned int j = 0; j < c.subEntities(
dim-1); ++j) {
103 std::int64_t point_idx = (indexSet.subIndex(c,k,
dim-1) +
gridView_.size(
dim));
113 template <
class T,
class GlobalFunction>
116 std::vector<T> data(this->
numPoints() * fct.numComponents());
117 auto const& indexSet =
gridView_.indexSet();
118 auto localFct = localFunction(fct);
122 auto refElem = referenceElement(e.geometry());
123 for (
unsigned int j = 0; j < e.subEntities(
dim); ++j) {
124 int k = cellType.permutation(j);
125 std::size_t idx = fct.numComponents() * indexSet.subIndex(e, k,
dim);
126 for (
int comp = 0; comp < fct.numComponents(); ++comp)
127 data[idx + comp] = T(localFct.evaluate(comp, refElem.position(k,
dim)));
129 for (
unsigned int j = 0; j < e.subEntities(
dim-1); ++j) {
130 int k = cellType.permutation(e.subEntities(
dim) + j);
131 std::size_t idx = fct.numComponents() * (indexSet.subIndex(e, k,
dim-1) +
gridView_.size(
dim));
132 for (
int comp = 0; comp < fct.numComponents(); ++comp)
133 data[idx + comp] = T(localFct.evaluate(comp, refElem.position(k,
dim-1)));
std::uint64_t numPoints() const
Return the number of points in (this partition of the) grid.
Definition: datacollectorinterface.hh:58
GridViewType GridView
Definition: datacollectorinterface.hh:25
std::uint64_t numCells() const
Return the number of cells in (this partition of the) grid.
Definition: datacollectorinterface.hh:52
Implementation of DataCollector for quadratic cells, with continuous data.
Definition: quadraticdatacollector.hh:19
std::vector< T > pointsImpl() const
Return a vector of point coordinates.
Definition: quadraticdatacollector.hh:44
QuadraticDataCollector(GridView const &gridView)
Definition: quadraticdatacollector.hh:28
std::vector< T > pointDataImpl(GlobalFunction const &fct) const
Evaluate the fct at element vertices and edge centers in the same order as the point coords.
Definition: quadraticdatacollector.hh:114
Cells cellsImpl() const
Return cell types, offsets, and connectivity.
Definition: quadraticdatacollector.hh:85
std::uint64_t numPointsImpl() const
Return number of vertices + number of edge.
Definition: quadraticdatacollector.hh:33
std::uint64_t numCellsImpl() const
Return number of grid cells.
Definition: quadraticdatacollector.hh:75
Definition: unstructureddatacollector.hh:14
std::vector< std::int64_t > offsets
Definition: unstructureddatacollector.hh:16
std::vector< std::int64_t > connectivity
Definition: unstructureddatacollector.hh:17
std::vector< std::uint8_t > types
Definition: unstructureddatacollector.hh:15
Definition: unstructureddatacollector.hh:23
@ dim
Definition: datacollectorinterface.hh:28
static constexpr auto partition
The partitionset to collect data from.
Definition: datacollectorinterface.hh:23
Cells cells() const
Return cell types, offsets, and connectivity.
Definition: unstructureddatacollector.hh:36
GridView gridView_
Definition: datacollectorinterface.hh:133
Mapping of Dune geometry types to VTK cell types.
Definition: types.hh:160
@ QUADRATIC
Definition: types.hh:163
std::uint8_t type() const
Return VTK Cell type.
Definition: types.hh:203
int permutation(int idx) const
Return a permutation of Dune elemenr vertices to conform to VTK element numbering.
Definition: types.hh:209