BUGFIX: Illegal use of uninitialised value (backport)
[foam-extend-3.2.git] / applications / utilities / postProcessing / dataConversion / foamToVTK / faMeshWriter.H
blobfab3454a49c7101395400f9ab4a2f7e8c6f6c5a3
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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 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
19     for more details.
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
25 Class
26     Foam::faMeshWriter
28 Description
29     Write Finite Area fields
31 SourceFiles
32     faMeshWriter.C
33     faMeshWriterTemplates.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef faMeshWriter_H
38 #define faMeshWriter_H
40 #include "faMesh.H"
41 #include "OFstream.H"
42 #include "areaFields.H"
43 #include "indirectPrimitivePatch.H"
44 #include "PrimitivePatchInterpolation.H"
46 using namespace Foam;
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
53 class volPointInterpolation;
55 /*---------------------------------------------------------------------------*\
56                            Class faMeshWriter Declaration
57 \*---------------------------------------------------------------------------*/
59 class faMeshWriter
61     //- Reference to FA mesh
62     const faMesh& aMesh_;
64     //- Write in binary format
65     const bool binary_;
67     //- Output stream
68     std::ofstream os_;
71 public:
73     // Constructors
75         //- Construct from components
76         faMeshWriter
77         (
78             const faMesh&,
79             const bool binary,
80             const fileName&
81         );
84     // Member Functions
86         //- Return stream
87         std::ofstream& os()
88         {
89             return os_;
90         }
92         //- Write areaField
93         template<class Type>
94         void write
95         (
96             const GeometricField<Type, faPatchField, areaMesh>&
97         );
99         //- Write list of area fields
100         template<class Type>
101         void write
102         (
103             const PtrList<GeometricField<Type, faPatchField, areaMesh> >&
104         );
106         //- Interpolate and write areaField
107         template<class Type>
108         void write
109         (
110             const PrimitivePatchInterpolation<indirectPrimitivePatch>&,
111             const GeometricField<Type, faPatchField, areaMesh>&
112         );
114         //- Interpolate and write areaFields
115         template<class Type>
116         void write
117         (
118             const PrimitivePatchInterpolation<indirectPrimitivePatch>&,
119             const PtrList<GeometricField<Type, faPatchField, areaMesh> >&
120         );
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 } // End namespace Foam
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 #ifdef NoRepository
131 #   include "faMeshWriterTemplates.C"
132 #endif
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 #endif
139 // ************************************************************************* //