Forward compatibility: flex
[foam-extend-3.2.git] / applications / utilities / postProcessing / dataConversion / foamToVTK / faMeshWriter.H
blob948ae5c4d8aacb12580d11c76d4b699ea5927122
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::faMeshWriter
27 Description
28     Write Finite Area fields
30 SourceFiles
31     faMeshWriter.C
32     faMeshWriterTemplates.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef faMeshWriter_H
37 #define faMeshWriter_H
39 #include "faMesh.H"
40 #include "OFstream.H"
41 #include "areaFields.H"
42 #include "indirectPrimitivePatch.H"
43 #include "PrimitivePatchInterpolationTemplate.H"
45 using namespace Foam;
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace Foam
52 class volPointInterpolation;
54 /*---------------------------------------------------------------------------*\
55                            Class faMeshWriter Declaration
56 \*---------------------------------------------------------------------------*/
58 class faMeshWriter
60     //- Reference to FA mesh
61     const faMesh& aMesh_;
63     //- Write in binary format
64     const bool binary_;
66     //- Output stream
67     std::ofstream os_;
70 public:
72     // Constructors
74         //- Construct from components
75         faMeshWriter
76         (
77             const faMesh&,
78             const bool binary,
79             const fileName&
80         );
83     // Member Functions
85         //- Return stream
86         std::ofstream& os()
87         {
88             return os_;
89         }
91         //- Write areaField
92         template<class Type>
93         void write
94         (
95             const GeometricField<Type, faPatchField, areaMesh>&
96         );
98         //- Write list of area fields
99         template<class Type>
100         void write
101         (
102             const PtrList<GeometricField<Type, faPatchField, areaMesh> >&
103         );
105         //- Interpolate and write areaField
106         template<class Type>
107         void write
108         (
109             const PrimitivePatchInterpolation<indirectPrimitivePatch>&,
110             const GeometricField<Type, faPatchField, areaMesh>&
111         );
113         //- Interpolate and write areaFields
114         template<class Type>
115         void write
116         (
117             const PrimitivePatchInterpolation<indirectPrimitivePatch>&,
118             const PtrList<GeometricField<Type, faPatchField, areaMesh> >&
119         );
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 } // End namespace Foam
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 #ifdef NoRepository
130 #   include "faMeshWriterTemplates.C"
131 #endif
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 #endif
138 // ************************************************************************* //