ensightOutputVolField.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-2022 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 
26 InNamespace
27  Foam::ensightOutput
28 
29 Description
30  A collection of functions for writing volField content in ensight format.
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef Foam_ensightOutput_volField_H
35 #define Foam_ensightOutput_volField_H
36 
37 #include "ensightOutput.H"
38 #include "ensightFaces.H"
39 #include "ensightCells.H"
40 #include "volFields.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward Declarations
48 class ensightMesh;
49 
50 namespace ensightOutput
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Namespace ensightOutput
55 \*---------------------------------------------------------------------------*/
56 
57 //- Write volume field component-wise
58 template<class Type>
59 bool writeVolField
60 (
63 
65  ensightFile& os,
66 
68  const GeometricField<Type, fvPatchField, volMesh>& vf,
69 
71  const ensightMesh& ensMesh
72 );
73 
74 //- Write volume field component-wise
75 template<class Type>
76 bool writeVolField
77 (
79  ensightFile& os,
80 
83 
85  const ensightMesh& ensMesh
86 )
87 {
89  return ensightOutput::writeVolField<Type>(scratch, os, vf, ensMesh);
90 }
91 
92 //- Write volume field component-wise, optionally forcing interpolation
93 template<class Type>
94 bool writeVolField
95 (
98 
100  ensightFile& os,
101 
104 
106  const ensightMesh& ensMesh,
107 
109  const bool nodeValues
110 );
111 
112 //- Write volume field component-wise, optionally forcing interpolation
113 template<class Type>
114 bool writeVolField
115 (
118 
121 
123  const ensightMesh& ensMesh,
124 
126  const bool nodeValues
127 )
128 {
130  return ensightOutput::writeVolField<Type>
131  (
132  scratch, os, vf, ensMesh, nodeValues
133  );
134 }
135 
136 //- Write point field component-wise
137 template<class Type>
138 bool writePointField
139 (
142 
144  ensightFile& os,
145 
148 
150  const ensightMesh& ensMesh
151 );
152 
153 //- Write point field component-wise
154 template<class Type>
155 bool writePointField
156 (
158  ensightFile& os,
159 
164  const ensightMesh& ensMesh
165 )
166 {
168  return ensightOutput::writePointField<Type>(scratch, os, pf, ensMesh);
169 }
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace ensightOutput
175 } // End namespace Foam
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #ifdef NoRepository
181 #endif
182 
183 #endif
184 
185 // ************************************************************************* //
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
Definition: ensightFile.H:46
Generic GeometricField class.
Definition: areaFieldsFwd.H:50
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:51
DynamicList< float > floatBufferType
The list type used for component-wise buffering.
Encapsulation of volume meshes for writing in ensight format. It manages cellZones, facesZone, patches.
Definition: ensightMesh.H:78
OBJstream os(runTime.globalPath()/outputName)
bool writePointField(ensightOutput::floatBufferType &scratch, ensightFile &os, const GeometricField< Type, pointPatchField, pointMesh > &pf, const ensightMesh &ensMesh)
Write point field component-wise.
Namespace for OpenFOAM.
bool writeVolField(ensightOutput::floatBufferType &scratch, ensightFile &os, const GeometricField< Type, fvPatchField, volMesh > &vf, const ensightMesh &ensMesh)
Write volume field component-wise.