Loading...
Searching...
No Matches
foamVtkInternalWriter.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016-2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::vtk::internalWriter
28
29Description
30 Write an OpenFOAM volume (internal) geometry and internal fields
31 as a vtu file or a legacy vtk file.
32
33 The file output states are managed by the Foam::vtk::fileWriter class.
34 FieldData (eg, TimeValue) must appear before any geometry pieces.
35
36Note
37 Parallel output is combined into a single Piece without point merging,
38 which is similar to using multi-piece data sets, but allows more
39 convenient creation as a streaming process.
40 In the future, the duplicate points at processor connections
41 may be addressed using ghost points.
42
43See Also
44 Foam::vtk::internalMeshWriter
45
46SourceFiles
47 foamVtkInternalWriter.txx
48
49\*---------------------------------------------------------------------------*/
50
51#ifndef Foam_vtk_internalWriter_H
52#define Foam_vtk_internalWriter_H
53
55#include "volFields.H"
56#include "pointFields.H"
57
58// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59
60namespace Foam
61{
62
63// Forward Declarations
65
66namespace vtk
67{
69/*---------------------------------------------------------------------------*\
70 Class vtk::internalWriter Declaration
71\*---------------------------------------------------------------------------*/
72
74:
76{
77public:
78
79 // Generated Methods
80
81 //- No copy construct
82 internalWriter(const internalWriter&) = delete;
83
84 //- No copy assignment
85 void operator=(const internalWriter&) = delete;
86
87
88 // Constructors
89
90 //- Construct from components (default format INLINE_BASE64),
101
102 //- Construct from components (default format INLINE_BASE64),
103 // The file name is with/without an extension.
105 (
106 const polyMesh& mesh,
107 const vtk::vtuCells& cells,
108 const fileName& file,
110 )
111 :
113 {}
114
115 //- Construct from components (default format INLINE_BASE64),
116 // The file name is with/without an extension.
118 (
119 const polyMesh& mesh,
120 const vtk::vtuCells& cells,
122 const fileName& file,
125 :
127 {}
128
129
130 //- Destructor
131 virtual ~internalWriter() = default;
132
133
134 // Member Functions
135
136 // Write
137
138 //- Write point field
139 // Interpolate to originating cell centre for decomposed cells.
140 template<class Type, template<class> class PatchField>
141 void write
142 (
144 );
145
146 //- Write the internal field (CellData)
147 template<class Type>
148 void write
149 (
151 );
152
153 //- Write the volume field (internal part)
154 template<class Type, template<class> class PatchField>
155 void write
156 (
158 );
159
160 //- Write internal field with point interpolation
161 template<class Type>
162 void write
163 (
166 );
167
168 //- Write volume field with point interpolation
169 template<class Type>
170 void write
174 );
175};
176
177
178// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179
180} // End namespace vtk
181} // End namespace Foam
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185#ifdef NoRepository
186 #include "foamVtkInternalWriter.txx"
187#endif
188
189// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191#endif
192
193// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
static bool parRun(const bool on) noexcept
Set as parallel run on/off.
Definition UPstream.H:1669
A class for handling file names.
Definition fileName.H:75
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
Interpolate from cell centres to points (vertices) using inverse distance weighting.
vtk::outputOptions opts() const noexcept
The output options in use.
bool parallel() const noexcept
Parallel output requested?
Write an OpenFOAM volume (internal) geometry and internal fields as a vtu file or a legacy vtk file.
internalMeshWriter(const internalMeshWriter &)=delete
File extension for given output type.
virtual ~internalWriter()=default
Destructor.
void write(const GeometricField< Type, PatchField, volMesh > &field)
Write the volume field (internal part).
void write(const DimensionedField< Type, volMesh > &vfield, const volPointInterpolation &pInterp)
Write internal field with point interpolation.
void write(const GeometricField< Type, fvPatchField, volMesh > &vfield, const volPointInterpolation &pInterp)
Write volume field with point interpolation.
internalWriter(const internalWriter &)=delete
No copy construct.
internalWriter(const polyMesh &mesh, const vtk::vtuCells &cells, const vtk::outputOptions opts=vtk::formatType::INLINE_BASE64)
Construct from components (default format INLINE_BASE64),.
void write(const DimensionedField< Type, volMesh > &field)
Write the internal field (CellData).
internalWriter(const polyMesh &mesh, const vtk::vtuCells &cells, const vtk::outputOptions opts, const fileName &file, bool parallel=UPstream::parRun())
Construct from components (default format INLINE_BASE64),.
void operator=(const internalWriter &)=delete
No copy assignment.
void write(const GeometricField< Type, PatchField, pointMesh > &field)
Write point field.
internalWriter(const polyMesh &mesh, const vtk::vtuCells &cells, const fileName &file, bool parallel=UPstream::parRun())
Construct from components (default format INLINE_BASE64),.
Encapsulated combinations of output format options. This is primarily useful when defining the output...
A deep-copy description of an OpenFOAM volume mesh in data structures suitable for VTK UnstructuredGr...
rDeltaTY field()
autoPtr< vtk::internalWriter > internalWriter
dynamicFvMesh & mesh
autoPtr< volPointInterpolation > pInterp
const cellShapeList & cells
Namespace for handling VTK output. Contains classes and functions for writing VTK file content.
@ INLINE_BASE64
XML inline base64, base64Formatter.
Definition foamVtkCore.H:91
Namespace for OpenFOAM.
runTime write()