dune-vtk 2.12
Loading...
Searching...
No Matches
unstructureddatacollector.hh
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <vector>
5
8
9namespace Dune::Vtk
10{
17
18 // tag to indicate whether point IDs should be written
19 template <bool = true>
20 struct WritePointIDs {};
21
22
23 template <class GridView, class Derived, class Partition = Partitions::InteriorBorder>
25 : public DataCollectorInterface<GridView, Derived, Partition>
26 {
28
29 public:
30 using Super::dim;
31 using Super::partition;
32
33 public:
37
38 template <bool b>
43
45 Cells cells () const
46 {
47 return this->asDerived().cellsImpl();
48 }
49
52 {
53 if (writePointIDs_)
54 return this->asDerived().pointIdsImpl();
55 else
57 }
58
59 protected:
60 // default implementation
62 {
63 return {};
64 }
65
66 private:
67 bool writePointIDs_ = false;
68 };
69
70} // end namespace Dune::Vtk
Definition writer.hh:16
Base class for data collectors in a CRTP style.
Definition datacollectorinterface.hh:18
@ dim
Definition datacollectorinterface.hh:27
static constexpr auto partition
The partitionset to collect data from.
Definition datacollectorinterface.hh:24
GV GridView
Type of the bound grid view.
Definition datacollectorinterface.hh:21
Derived & asDerived()
Definition datacollectorinterface.hh:117
GridView const & gridView() const
Return the bound grid view.
Definition datacollectorinterface.hh:39
Definition unstructureddatacollector.hh:12
std::vector< std::int64_t > offsets
Definition unstructureddatacollector.hh:14
std::vector< std::int64_t > connectivity
Definition unstructureddatacollector.hh:15
std::vector< std::uint8_t > types
Definition unstructureddatacollector.hh:13
Definition unstructureddatacollector.hh:20
Definition unstructureddatacollector.hh:26
std::vector< std::uint64_t > pointIdsImpl() const
Definition unstructureddatacollector.hh:61
UnstructuredDataCollectorInterface(GridView const &gridView)
Definition unstructureddatacollector.hh:34
Cells cells() const
Return cell types, offsets, and connectivity.
Definition unstructureddatacollector.hh:45
std::vector< std::uint64_t > pointIds() const
Return parallel unique IDs for each point in the grid.
Definition unstructureddatacollector.hh:51
UnstructuredDataCollectorInterface(GridView const &gridView, WritePointIDs< b >)
Definition unstructureddatacollector.hh:39