Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / utilities / postProcessing / dataConversion / foamToVTK / internalWriter.H
blob206069a98a5b90353cec9b9d3439b6a78922631b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-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::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_;
67 public:
69     // Constructors
71         //- Construct from components
72         internalWriter
73         (
74             const vtkMesh&,
75             const bool binary,
76             const fileName&
77         );
80     // Member Functions
82         std::ofstream& os()
83         {
84             return os_;
85         }
87         //- Write cellIDs
88         void writeCellIDs();
90         //- Write generic GeometricFields
91         template<class Type, template<class> class PatchField, class GeoMesh>
92         void write
93         (
94             const PtrList<GeometricField<Type, PatchField, GeoMesh> >&
95         );
97         //- Interpolate and write volFields
98         template<class Type>
99         void write
100         (
101             const volPointInterpolation&,
102             const PtrList<GeometricField<Type, fvPatchField, volMesh> >&
103         );
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 } // End namespace Foam
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 #ifdef NoRepository
114 #   include "internalWriterTemplates.C"
115 #endif
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 #endif
122 // ************************************************************************* //