dune-vtk  0.2
vtkstructuredgridwriter.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <array>
4 #include <iosfwd>
5 #include <map>
6 
7 #include <dune/vtk/filewriter.hh>
8 #include <dune/vtk/function.hh>
9 #include <dune/vtk/types.hh>
11 
13 
14 namespace Dune
15 {
17 
21  template <class GridView, class DataCollector = Vtk::StructuredDataCollector<GridView>>
23  : public VtkWriterInterface<GridView, DataCollector>
24  {
26  using pos_type = typename Super::pos_type;
27 
28  public:
30  using Super::Super;
31 
32  private:
34  virtual void writeSerialFile (std::ofstream& out) const override;
35 
39  virtual void writeParallelFile (std::ofstream& out, std::string const& pfilename, int size) const override;
40 
41  virtual std::string fileExtension () const override
42  {
43  return "vts";
44  }
45 
46  virtual void writeGridAppended (std::ofstream& out, std::vector<std::uint64_t>& blocks) const override;
47 
48  private:
50  using Super::format_;
51  using Super::datatype_;
52  using Super::headertype_;
53 
54  // attached data
55  using Super::pointData_;
56  using Super::cellData_;
57  };
58 
59  // deduction guides
60  template <class GridView,
61  class = std::void_t<typename GridView::IndexSet>>
64 
65  template <class DataCollector,
66  class = std::void_t<typename DataCollector::GridView>>
69 
70  template <class DataCollector,
71  class = std::void_t<typename DataCollector::GridView>>
74 
75 } // end namespace Dune
76 
Definition: datacollectorinterface.hh:9
VtkStructuredGridWriter(GridView const &, Vtk::FormatTypes=Vtk::FormatTypes::BINARY, Vtk::DataTypes=Vtk::DataTypes::FLOAT32) -> VtkStructuredGridWriter< GridView, Vtk::StructuredDataCollector< GridView >>
FormatTypes
Type used for representing the output format.
Definition: types.hh:21
@ BINARY
Definition: types.hh:23
DataTypes
Definition: types.hh:50
@ FLOAT32
Definition: types.hh:56
Interface for file writers for the Vtk XML file formats.
Definition: vtkwriterinterface.hh:25
std::shared_ptr< DataCollector > dataCollector_
Definition: vtkwriterinterface.hh:260
Vtk::FormatTypes format_
Definition: vtkwriterinterface.hh:262
std::vector< VtkFunction > pointData_
Definition: vtkwriterinterface.hh:268
std::vector< VtkFunction > cellData_
Definition: vtkwriterinterface.hh:269
Vtk::DataTypes headertype_
Definition: vtkwriterinterface.hh:264
Vtk::DataTypes datatype_
Definition: vtkwriterinterface.hh:263
typename std::ostream::pos_type pos_type
Definition: vtkwriterinterface.hh:35
File-Writer for StructuredGrid VTK .vts files.
Definition: vtkstructuredgridwriter.hh:24