dune-vtk  0.2
vtkwriter.hh
Go to the documentation of this file.
1 #pragma once
2 
7 
8 #if HAVE_DUNE_SPGRID
9 #include <dune/grid/spgrid.hh>
11 #endif
12 
13 #include <dune/grid/geometrygrid.hh>
14 #include <dune/grid/yaspgrid.hh>
16 
17 namespace Dune
18 {
19  namespace Impl
20  {
21  // The default writer assumes an unstructured grid
22  template <class GridView, class Grid>
23  struct VtkWriterImpl
24  {
25  using type = VtkUnstructuredGridWriter<GridView>;
26  };
27  }
28 
30 
37  template <class GridView>
38  class VtkWriter
39  : public Impl::VtkWriterImpl<GridView, typename GridView::Grid>::type
40  {
42 
43  public:
44  using Super::Super;
45  };
46 
47  // deduction guide
48  template <class GridView,
49  class = std::void_t<typename GridView::IndexSet>>
52 
53 
54  namespace Impl
55  {
56  // A structured grid with coordinates in x, y, and z direction with arbitrary spacing
57  template <class GridView, int dim, class Coordinates>
58  struct VtkWriterImpl<GridView, YaspGrid<dim,Coordinates>>
59  {
61  };
62 
63 #if HAVE_DUNE_SPGRID
64  // A structured grid with coordinates in x, y, and z direction with arbitrary spacing
65  template <class GridView, class ct, int dim, template <int> class Ref, class Comm>
66  struct VtkWriterImpl<GridView, SPGrid<ct,dim,Ref,Comm>>
67  {
69  };
70 #endif
71 
72  // A structured grid with coordinates in x, y, and z direction with arbitrary spacing
73  template <class GridView, int dim, class ct>
74  struct VtkWriterImpl<GridView, YaspGrid<dim,TensorProductCoordinates<ct,dim>>>
75  {
77  };
78 
79  // A transformed structured grid has structured connectivity but unstructured point
80  // coordinates.
81  template <class GridView, int dim, class Coordinates, class CoordFunction, class Allocator>
82  struct VtkWriterImpl<GridView, GeometryGrid<YaspGrid<dim,Coordinates>, CoordFunction, Allocator>>
83  {
85  };
86 
87  } // end namespace Impl
88 } // end namespace Dune
Definition: writer.hh:13
VtkWriter(GridView const &, Vtk::FormatTypes=Vtk::FormatTypes::BINARY, Vtk::DataTypes=Vtk::DataTypes::FLOAT32) -> VtkWriter< GridView >
FormatTypes
Type used for representing the output format.
Definition: types.hh:21
DataTypes
Definition: types.hh:52
Default choice of VTK Writer for several grid types.
Definition: vtkwriter.hh:40
File-Writer for RectilinearGrid VTK .vtr files.
Definition: vtkrectilineargridwriter.hh:25
File-Writer for StructuredGrid VTK .vts files.
Definition: vtkstructuredgridwriter.hh:25
File-Writer for VTK .vtu files.
Definition: vtkunstructuredgridwriter.hh:25