1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Various functions for collecting and writing binary data.
34 \*---------------------------------------------------------------------------*/
36 #ifndef writeFunctions_H
37 #define writeFunctions_H
39 #include "floatScalar.H"
40 #include "DynamicList.H"
41 #include "volFieldsFwd.H"
42 #include "pointFieldsFwd.H"
44 #include "volPointInterpolation.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class writeFuns Declaration
53 \*---------------------------------------------------------------------------*/
57 // Private member functions
59 // Swap halves of word.
61 static void swapWord(label& word32);
62 static void swapWords(const label nWords, label* words32);
67 // Write ascii or binary. If binary optionally in-place swaps argument
69 static void write(std::ostream&, const bool, List<floatScalar>&);
70 static void write(std::ostream&, const bool, DynamicList<floatScalar>&);
71 static void write(std::ostream&, const bool, labelList&);
72 static void write(std::ostream&, const bool, DynamicList<label>&);
77 static void writeHeader
84 static void writeCellDataHeader
91 static void writePointDataHeader
99 // Convert to VTK and store
101 static void insert(const scalar&, DynamicList<floatScalar>&);
102 static void insert(const point&, DynamicList<floatScalar>&);
103 static void insert(const sphericalTensor&, DynamicList<floatScalar>&);
104 static void insert(const symmTensor&, DynamicList<floatScalar>&);
105 static void insert(const tensor&, DynamicList<floatScalar>&);
108 //- Append elements to DynamicList
109 static void insert(const labelList&, DynamicList<label>&);
111 static void insert(const List<Type>&, DynamicList<floatScalar>&);
113 //- Write volField with cell values (including decomposed cells)
119 const GeometricField<Type, fvPatchField, volMesh>&,
123 //- Write pointField on all mesh points. Interpolate to cell centre
124 // for decomposed cell centres.
130 const GeometricField<Type, pointPatchField, pointMesh>&,
134 //- Write interpolated field on points and original cell values on
135 // decomposed cell centres.
141 const GeometricField<Type, fvPatchField, volMesh>&,
142 const GeometricField<Type, pointPatchField, pointMesh>&,
146 //- Write generic GeometricFields
147 template<class Type, template<class> class PatchField, class GeoMesh>
152 const PtrList<GeometricField<Type, PatchField, GeoMesh> >&,
156 //- Interpolate and write volFields
162 const volPointInterpolation&,
163 const PtrList<GeometricField<Type, fvPatchField, volMesh> >&,
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 } // End namespace Foam
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 # include "writeFunsTemplates.C"
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 // ************************************************************************* //