Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / utilities / postProcessing / dataConversion / foamToVTK / surfaceMeshWriter.H
blob2c022d3455de01f8e9bfd1b4fac5f86cbaea50f5
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::surfaceMeshWriter
27 Description
28     Write faces with fields
30 SourceFiles
31     surfaceMeshWriter.C
32     surfaceMeshWriterTemplates.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef surfaceMeshWriter_H
37 #define surfaceMeshWriter_H
39 #include "pointMesh.H"
40 #include "OFstream.H"
41 #include "volFields.H"
42 #include "surfaceFields.H"
43 #include "vtkMesh.H"
44 #include "indirectPrimitivePatch.H"
46 using namespace Foam;
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
53 class volPointInterpolation;
55 /*---------------------------------------------------------------------------*\
56                            Class surfaceMeshWriter Declaration
57 \*---------------------------------------------------------------------------*/
59 class surfaceMeshWriter
61     const vtkMesh& vMesh_;
63     const bool binary_;
65     const indirectPrimitivePatch& pp_;
67     const fileName fName_;
69     std::ofstream os_;
71 //    label nPoints_;
73 //    label nFaces_;
75 public:
77     // Constructors
79         //- Construct from components
80         surfaceMeshWriter
81         (
82             const vtkMesh&,
83             const bool binary,
84             const indirectPrimitivePatch& pp,
85             const word& name,
86             const fileName&
87         );
90     // Member Functions
92         std::ofstream& os()
93         {
94             return os_;
95         }
97 //        label nPoints() const
98 //        {
99 //            return nPoints_;
100 //        }
102 //        label nFaces() const
103 //        {
104 //            return nFaces_;
105 //        }
107 //        //- Write cellIDs
108 //        void writePatchIDs();
110         //- Extract face data
111         template<class Type>
112         tmp<Field<Type> > getFaceField
113         (
114             const GeometricField<Type, fvsPatchField, surfaceMesh>&
115         ) const;
117         //- Write surfaceFields
118         template<class Type>
119         void write
120         (
121             const PtrList<GeometricField<Type, fvsPatchField, surfaceMesh> >&
122         );
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 } // End namespace Foam
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 #ifdef NoRepository
133 #   include "surfaceMeshWriterTemplates.C"
134 #endif
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 #endif
141 // ************************************************************************* //