Forward compatibility: flex
[foam-extend-3.2.git] / applications / utilities / postProcessing / dataConversion / foamToVTK / internalWriter.H
blob71116c419f24921b926d8875129cbad7163b428f
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::internalWriter
27 Description
28     Write fields (internal).
30 SourceFiles
31     internalWriter.C
32     internalWriterTemplates.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef internalWriter_H
37 #define internalWriter_H
39 #include "OFstream.H"
40 #include "volFields.H"
41 #include "pointFields.H"
42 #include "vtkMesh.H"
44 using namespace Foam;
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 class volPointInterpolation;
53 /*---------------------------------------------------------------------------*\
54                            Class internalWriter Declaration
55 \*---------------------------------------------------------------------------*/
57 class internalWriter
59     const vtkMesh& vMesh_;
61     const bool binary_;
63     const fileName fName_;
65     std::ofstream os_;
68 public:
70     // Constructors
72         //- Construct from components
73         internalWriter
74         (
75             const vtkMesh&,
76             const bool binary,
77             const fileName&
78         );
81     // Member Functions
83         std::ofstream& os()
84         {
85             return os_;
86         }
88         //- Write cellIDs
89         void writeCellIDs();
91         //- Write generic GeometricFields
92         template<class Type, template<class> class PatchField, class GeoMesh>
93         void write
94         (
95             const PtrList<GeometricField<Type, PatchField, GeoMesh> >&
96         );
98         //- Interpolate and write volFields
99         template<class Type>
100         void write
101         (
102             const volPointInterpolation&,
103             const PtrList<GeometricField<Type, fvPatchField, volMesh> >&
104         );
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 } // End namespace Foam
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 #ifdef NoRepository
115 #   include "internalWriterTemplates.C"
116 #endif
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 #endif
123 // ************************************************************************* //