foamVtkPatchWriter.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-2021 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::patchWriter
28
29Description
30 Write OpenFOAM patches and patch fields in VTP or legacy vtk format.
31
32 The file output states are managed by the Foam::vtk::fileWriter class.
33 FieldData (eg, TimeValue) must appear before any geometry pieces.
34
35Note
36 Parallel output is combined into a single Piece without point merging,
37 which is similar to using multi-piece data sets, but allows more
38 convenient creation as a streaming process.
39 In the future, the duplicate points at processor connections
40 may be addressed using ghost points.
41
42See Also
43 Foam::vtk::patchMeshWriter
44
45SourceFiles
46 foamVtkPatchWriterTemplates.C
47
48\*---------------------------------------------------------------------------*/
49
50#ifndef Foam_vtk_patchWriter_H
51#define Foam_vtk_patchWriter_H
52
54#include "volFields.H"
55#include "pointFields.H"
57
58// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59
60namespace Foam
61{
62namespace vtk
63{
64
65/*---------------------------------------------------------------------------*\
66 Class vtk::patchWriter Declaration
67\*---------------------------------------------------------------------------*/
69class patchWriter
70:
72{
73 // Private Member Data
74
75 //- Use internal field value instead of patch value
76 bool useNearCellValue_;
77
78
79 // Private Member Functions
80
81 //- No copy construct
82 patchWriter(const patchWriter&) = delete;
83
84 //- No copy assignment
85 void operator=(const patchWriter&) = delete;
86
87
88public:
89
90 // Constructors
91
92 //- Construct from components (default format INLINE_BASE64)
93 //
94 // \param useNearCellValue to use cell instead of patch values
96 (
97 const polyMesh& mesh,
98 const labelList& patchIDs,
100 const bool useNearCellValue = false
101 )
102 :
104 useNearCellValue_(useNearCellValue)
105 {}
106
107 //- Construct from components (default format INLINE_BASE64),
108 //- and open the file for writing.
109 // The file name is with/without an extension.
111 (
112 const polyMesh& mesh,
113 const labelList& patchIDs,
114 const fileName& file,
116 )
117 :
119 useNearCellValue_(false)
120 {}
121
122 //- Construct from components (default format INLINE_BASE64),
123 //- and open the file for writing.
124 // The file name is with/without an extension.
126 (
127 const polyMesh& mesh,
128 const labelList& patchIDs,
130 const fileName& file,
132 )
133 :
135 useNearCellValue_(false)
136 {}
137
138 //- Construct from components and open the file for writing.
139 // The file name is with/without an extension.
140 //
141 // \param useNearCellValue to use cell instead of patch values
143 (
144 const polyMesh& mesh,
145 const labelList& patchIDs,
147 const bool useNearCellValue,
148 const fileName& file,
150 )
151 :
153 useNearCellValue_(useNearCellValue)
154 {}
155
156
157 //- Destructor
158 virtual ~patchWriter() = default;
159
160
161 // Member Functions
162
163 // Write
164
165 //- Write point field
166 template<class Type, template<class> class PatchField>
167 void write
168 (
170 );
171
172 //- Write volume field
173 template<class Type, template<class> class PatchField>
174 void write
175 (
177 );
178
179 //- Write volume field with point interpolation
180 template<class Type>
181 void write
182 (
185 );
186
187 //- Write volume field with point interpolation
188 template<class Type>
189 void write
190 (
193 );
194};
195
196
197// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198
199} // End namespace vtk
200} // End namespace Foam
201
202// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203
204#ifdef NoRepository
206#endif
207
208// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209
210#endif
211
212// ************************************************************************* //
Generic GeometricField class.
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:433
A class for handling file names.
Definition: fileName.H:76
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
vtk::outputOptions opts() const noexcept
The output options in use.
bool parallel() const noexcept
Parallel output requested?
Encapsulated combinations of output format options. This is primarily useful when defining the output...
Write OpenFOAM patches and patch fields in VTP or legacy vtk format.
const labelList & patchIDs() const noexcept
The patch IDs.
Write OpenFOAM patches and patch fields in VTP or legacy vtk format.
virtual ~patchWriter()=default
Destructor.
void write(const GeometricField< Type, fvPatchField, volMesh > &field, const PrimitivePatchInterpolation< primitivePatch > *pInterp)
Write volume field with point interpolation.
rDeltaTY field()
dynamicFvMesh & mesh
autoPtr< volPointInterpolation > pInterp
@ INLINE_BASE64
XML inline base64, base64Formatter.
Namespace for OpenFOAM.
runTime write()