dune-vtk 2.8
Loading...
Searching...
No Matches
unstructureddatacollector.hh
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <vector>
5
6#include <dune/grid/common/partitionset.hh>
8
9namespace Dune
10{
11 namespace Vtk
12 {
13 struct Cells
14 {
15 std::vector<std::uint8_t> types;
16 std::vector<std::int64_t> offsets;
17 std::vector<std::int64_t> connectivity;
18 };
19
20 template <class GridView, class Derived, class Partition = Partitions::InteriorBorder>
22 : public DataCollectorInterface<GridView, Derived, Partition>
23 {
25
26 public:
27 using Super::dim;
28 using Super::partition;
29
30 public:
32 : Super(gridView)
33 {}
34
36 Cells cells () const
37 {
38 return this->asDerived().cellsImpl();
39 }
40
41 std::vector<std::uint64_t> pointIds () const
42 {
43 return this->asDerived().pointIdsImpl();
44 }
45
46 protected:
47 // default implementation
48 std::vector<std::uint64_t> pointIdsImpl () const
49 {
50 return {};
51 }
52
53 protected:
54 using Super::gridView_;
55 };
56
57 } // end namespace Vtk
58} // end namespace Dune
Definition: writer.hh:13
Base class for data collectors in a CRTP style.
Definition: datacollectorinterface.hh:20
static constexpr auto partition
The partitionset to collect data from.
Definition: datacollectorinterface.hh:23
Derived & asDerived()
Definition: datacollectorinterface.hh:106
GridViewType GridView
Definition: datacollectorinterface.hh:25
@ dim
Definition: datacollectorinterface.hh:28
GridView gridView_
Definition: datacollectorinterface.hh:133
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
std::vector< std::uint64_t > pointIdsImpl() const
Definition: unstructureddatacollector.hh:48
UnstructuredDataCollectorInterface(GridView const &gridView)
Definition: unstructureddatacollector.hh:31
Cells cells() const
Return cell types, offsets, and connectivity.
Definition: unstructureddatacollector.hh:36
std::vector< std::uint64_t > pointIds() const
Definition: unstructureddatacollector.hh:41