DOC: Corrected class names in the file descriptions
[freefoam.git] / applications / utilities / postProcessing / dataConversion / foamToVTK / writeFuns.H
blob8b7679df093f1756160fe910ca247fbe5d553bf0
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::writeFuns
27 Description
28     Various functions for collecting and writing binary data.
30 SourceFiles
31     writeFuns.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef writeFuns_H
36 #define writeFuns_H
38 #include <OpenFOAM/floatScalar.H>
39 #include <OpenFOAM/DynamicList.H>
40 #include <finiteVolume/volFieldsFwd.H>
41 #include <OpenFOAM/pointFieldsFwd.H>
42 #include "vtkMesh.H"
43 #include <finiteVolume/volPointInterpolation.H>
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 /*---------------------------------------------------------------------------*\
51                            Class writeFuns Declaration
52 \*---------------------------------------------------------------------------*/
54 class writeFuns
56     // Private member functions
58         // Swap halves of word.
60             static void swapWord(label& word32);
61             static void swapWords(const label nWords, label* words32);
64 public:
66     // Write ascii or binary. If binary optionally in-place swaps argument
68         static void write(std::ostream&, const bool, List<floatScalar>&);
69         static void write(std::ostream&, const bool, DynamicList<floatScalar>&);
70         static void write(std::ostream&, const bool, labelList&);
71         static void write(std::ostream&, const bool, DynamicList<label>&);
74     // Write header
76         static void writeHeader(std::ostream&, const bool, const string&);
77         static void writeCellDataHeader(std::ostream&, const label, const label);
78         static void writePointDataHeader
79         (
80             std::ostream&,
81             const label,
82             const label
83         );
86     // Convert to VTK and store
88         static void insert(const scalar&, DynamicList<floatScalar>&);
89         static void insert(const point&, DynamicList<floatScalar>&);
90         static void insert(const sphericalTensor&, DynamicList<floatScalar>&);
91         static void insert(const symmTensor&, DynamicList<floatScalar>&);
92         static void insert(const tensor&, DynamicList<floatScalar>&);
95     //- Append elements to DynamicList
96     static void insert(const labelList&, DynamicList<label>&);
97     template<class Type>
98     static void insert(const List<Type>&, DynamicList<floatScalar>&);
100     //- Write volField with cell values (including decomposed cells)
101     template<class Type>
102     static void write
103     (
104         std::ostream&,
105         const bool binary,
106         const GeometricField<Type, fvPatchField, volMesh>&,
107         const vtkMesh&
108     );
110     //- Write pointField on all mesh points. Interpolate to cell centre
111     //  for decomposed cell centres.
112     template<class Type>
113     static void write
114     (
115         std::ostream&,
116         const bool binary,
117         const GeometricField<Type, pointPatchField, pointMesh>&,
118         const vtkMesh&
119     );
121     //- Write interpolated field on points and original cell values on
122     //  decomposed cell centres.
123     template<class Type>
124     static void write
125     (
126         std::ostream&,
127         const bool binary,
128         const GeometricField<Type, fvPatchField, volMesh>&,
129         const GeometricField<Type, pointPatchField, pointMesh>&,
130         const vtkMesh&
131     );
133     //- Write generic GeometricFields
134     template<class Type, template<class> class PatchField, class GeoMesh>
135     static void write
136     (
137         std::ostream&,
138         const bool binary,
139         const PtrList<GeometricField<Type, PatchField, GeoMesh> >&,
140         const vtkMesh&
141     );
143     //- Interpolate and write volFields
144     template<class Type>
145     static void write
146     (
147         std::ostream&,
148         const bool binary,
149         const volPointInterpolation&,
150         const PtrList<GeometricField<Type, fvPatchField, volMesh> >&,
151         const vtkMesh&
152     );
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 } // End namespace Foam
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 #ifdef NoRepository
163 #   include "writeFunsTemplates.C"
164 #endif
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 #endif
170 // ************************ vim: set sw=4 sts=4 et: ************************ //