dune-vtk 2.12
Loading...
Searching...
No Matches
vtkwriter.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
3#pragma once
4
9
10#define DUNE_VTK_DISABLE_DEPRECATION_WARNING
15#undef DUNE_VTK_DISABLE_DEPRECATION_WARNING
16
17#if HAVE_DUNE_SPGRID
18#include <dune/grid/spgrid.hh>
20#endif
21
23#include <dune/grid/yaspgrid.hh>
26
27namespace Dune::Vtk
28{
29 namespace Impl
30 {
31 // The default writer assumes an unstructured grid
32 template <class GridView, class Grid>
33 struct VtkWriterImpl
34 {
35 using type = Vtk::UnstructuredGridWriter<GridView, Vtk::CellTypeDataCollector<GridView>>;
36 };
37 }
38
40
47 template <class GridView>
49 : public Impl::VtkWriterImpl<GridView, typename GridView::Grid>::type
50 {
52
53 public:
54 using Super::Super;
55 };
56
57 // deduction guide
58 template <class GridView,
62
63
64 namespace Impl
65 {
66 // A structured grid with coordinates in x, y, and z direction with arbitrary spacing
67 template <class GridView, int dim, class Coordinates>
68 struct VtkWriterImpl<GridView, YaspGrid<dim,Coordinates>>
69 {
71 };
72
73#if HAVE_DUNE_SPGRID
74 // A structured grid with coordinates in x, y, and z direction with arbitrary spacing
75 template <class GridView, class ct, int dim, template <int> class Ref, class Comm>
76 struct VtkWriterImpl<GridView, SPGrid<ct,dim,Ref,Comm>>
77 {
79 };
80#endif
81
82 // A structured grid with coordinates in x, y, and z direction with arbitrary spacing
83 template <class GridView, int dim, class ct>
84 struct VtkWriterImpl<GridView, YaspGrid<dim,TensorProductCoordinates<ct,dim>>>
85 {
87 };
88
89 // A transformed structured grid has structured connectivity but unstructured point
90 // coordinates.
91 template <class GridView, int dim, class Coordinates, class CoordFunction, class Allocator>
92 struct VtkWriterImpl<GridView, GeometryGrid<YaspGrid<dim,Coordinates>, CoordFunction, Allocator>>
93 {
95 };
96
97 } // end namespace Impl
98} // end namespace Dune::Vtk
99
100namespace Dune
101{
102 template <class GridView>
103 class [[deprecated("Use Vtk::VtkWriter instead.")]] VtkWriter
104 : public Vtk::VtkWriter<GridView>
105 {
107 public:
108 using Base::Base;
109 };
110
111#pragma GCC diagnostic push
112#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
113 // deduction guide
114 template <class GridView,
118#pragma GCC diagnostic pop
119
120} // end namespace Dune
Definition datacollector.hh:19
FormatTypes
Type used for representing the output format.
Definition types.hh:21
DataTypes
Definition types.hh:53
size_type dim() const
Implementation of DataCollector for cells, with continuous data.
Definition celltypedatacollector.hh:20
Default choice of VTK Writer for several grid types.
Definition vtkwriter.hh:50
Definition vtkwriter.hh:105
File-Writer for VTK .vtu files.
Definition unstructuredgridwriter.hh:25