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>
12 
14 
15 namespace Dune
16 {
18 
22  template <class GridView, class DataCollector = Vtk::StructuredDataCollector<GridView>>
24  : public VtkWriterInterface<GridView, DataCollector>
25  {
27  using pos_type = typename Super::pos_type;
28 
29  public:
31  using Super::Super;
32 
33  private:
35  virtual void writeSerialFile (std::ofstream& out) const override;
36 
40  virtual void writeParallelFile (std::ofstream& out, std::string const& pfilename, int size) const override;
41 
42  virtual std::string fileExtension () const override
43  {
44  return "vts";
45  }
46 
47  virtual void writeGridAppended (std::ofstream& out, std::vector<std::uint64_t>& blocks) const override;
48 
49  private:
51  using Super::format_;
52  using Super::datatype_;
53  using Super::headertype_;
54 
55  // attached data
56  using Super::pointData_;
57  using Super::cellData_;
58  };
59 
60  // deduction guides
61  template <class GridView, class... Args,
63  VtkStructuredGridWriter(GridView, Args...)
65 
66  template <class DataCollector, class... Args,
68  VtkStructuredGridWriter(DataCollector&, Args...)
70 
71  template <class DataCollector, class... Args,
73  VtkStructuredGridWriter(std::shared_ptr<DataCollector>, Args...)
75 
76 } // end namespace Dune
77 
Definition: writer.hh:13
VtkStructuredGridWriter(GridView, Args...) -> VtkStructuredGridWriter< GridView, Vtk::StructuredDataCollector< GridView >>
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:27
decltype((std::declval< DC & >().update(), std::declval< DC >().numPoints(), std::declval< DC >().numCells(), CheckTypes< typename DC::GridView >{}, true)) IsDataCollector
Definition: concepts.hh:18
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:25