dune-vtk 2.12
Loading...
Searching...
No Matches
rectilineargridwriter.hh
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <iosfwd>
5#include <map>
6
8#include <dune/vtk/types.hh>
12
13namespace Dune::Vtk
14{
16
20 template <class GridView, class DataCollector = StructuredDataCollector<GridView>>
22 : public VtkWriterBase<GridView, DataCollector>
23 {
25 using pos_type = typename Super::pos_type;
26
27 public:
29 using Super::Super;
30
31 private:
33 virtual void writeSerialFile (std::ofstream& out) const override;
34
38 virtual void writeParallelFile (std::ofstream& out, std::string const& pfilename, int size) const override;
39
40 void writeCoordinates (std::ofstream& out, std::vector<pos_type>& offsets,
41 std::optional<std::size_t> timestep = {}) const;
42
43 template <class T>
44 std::array<std::uint64_t, 3> writeCoordinatesAppended (std::ofstream& out) const;
45
46 virtual std::string fileExtension () const override
47 {
48 return "vtr";
49 }
50
51 virtual void writeGridAppended (std::ofstream& out, std::vector<std::uint64_t>& blocks) const override;
52
53 private:
55 using Super::format_;
56 using Super::datatype_;
58
59 // attached data
61 using Super::cellData_;
62 };
63
64 // deduction guides
65 template <class GridView, class... Args,
69
70 template <class DataCollector, class... Args,
72 RectilinearGridWriter(DataCollector&, Args...)
74
75 template <class DataCollector, class... Args,
77 RectilinearGridWriter(DataCollector&&, Args...)
79
80 template <class DataCollector, class... Args,
84
85} // end namespace Dune::Vtk
86
Definition writer.hh:16
decltype((std::declval< GV >().grid(), std::declval< GV >().indexSet(), std::declval< GV >().size(0), std::declval< GV >().size(std::declval< Dune::GeometryType >()), CheckTypes< typename GV::Grid, typename GV::IndexSet >{}, true)) IsGridView
Definition concepts.hh:25
decltype((std::declval< DC & >().update(), std::declval< DC >().numPoints(), std::declval< DC >().numCells(), CheckTypes< typename DC::GridView >{}, true)) IsDataCollector
Definition concepts.hh:16
int size() const
Base class for file writers for the Vtk XML file formats.
Definition vtkwriterbase.hh:26
std::vector< VtkFunction > pointData_
Definition vtkwriterbase.hh:322
Vtk::DataTypes datatype_
Definition vtkwriterbase.hh:317
typename std::ostream::pos_type pos_type
Definition vtkwriterbase.hh:39
Vtk::FormatTypes format_
Definition vtkwriterbase.hh:316
std::vector< VtkFunction > cellData_
Definition vtkwriterbase.hh:323
Vtk::DataTypes headertype_
Definition vtkwriterbase.hh:318
std::shared_ptr< DataCollector > dataCollector_
Definition vtkwriterbase.hh:314
File-Writer for RectilinearGrid VTK .vtr files.
Definition rectilineargridwriter.hh:23