foam to Tecplot360 converter
[OpenFOAM-1.6.x.git] / applications / utilities / postProcessing / dataConversion / foamToTecplot360 / tecplotWriter.H
blobd614fac20209009f2ba93ac8588085fdd50bdab2
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 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 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::tecplotWriter
28 Description
29     Write binary tecplot files using tecio.
31 SourceFiles
32     tecplotWriter.C
33     tecplotWriterTemplates.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef tecplotWriter_H
38 #define tecplotWriter_H
40 #include "TECIO.h"
41 #include "Time.H"
42 #include "indirectPrimitivePatch.H"
43 #include "volFields.H"
44 #include "surfaceFields.H"
46 using namespace Foam;
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
53 class fvMesh;
55 /*---------------------------------------------------------------------------*\
56                            Class tecplotWriter Declaration
57 \*---------------------------------------------------------------------------*/
59 class tecplotWriter
61     const Time& runTime_;
63 public:
65     // Constructors
67         //- Construct from components
68         tecplotWriter(const Time&);
71     // Member Functions
73         void writeInit
74         (
75             const word& name,
76             const string& varNames,
77             const fileName&,
78             INTEGER4 tecplotFileType
79         ) const;
81         //- Write mesh as polyhedral zone
82         void writePolyhedralZone
83         (
84             const word& zoneName,
85             const INTEGER4 strandID,
86             const fvMesh& mesh,
87             const List<INTEGER4>& varLocArray,
88             INTEGER4 nFaceNodes
89         ) const;
91         //- Write surface as polygonal zone
92         void writePolygonalZone
93         (
94             const word& zoneName,
95             const INTEGER4 strandID,
96             const indirectPrimitivePatch& pp,
97             const List<INTEGER4>& varLocArray
98         ) const;
100         //- Write unordered data (or rather 1D ordered)
101         void writeOrderedZone
102         (
103             const word& zoneName,
104             INTEGER4 strandID,
105             const label n,
106             const List<INTEGER4>& varLocArray
107         ) const;
109         //- Write mesh
110         void writeConnectivity(const fvMesh& mesh) const;
112         //- Write surface
113         void writeConnectivity(const indirectPrimitivePatch& pp) const;
115         void writeEnd() const;
117         //- Write generic Field
118         template<class Type>
119         void writeField(const Field<Type>& fld) const;
122         //- Get either fvPatchField or patchInternalField
123         template<class Type>
124         tmp<Field<Type> > getPatchField
125         (
126             const bool nearCellValue,
127             const GeometricField<Type, fvPatchField, volMesh>& vfld,
128             const label patchI
129         ) const;
131         //- Get mixed field: fvsPatchField for boundary faces and
132         //  internalField for internal faces.
133         template<class Type>
134         tmp<Field<Type> > getFaceField
135         (
136             const GeometricField<Type, fvsPatchField, surfaceMesh>&,
137             const labelList& faceLabels
138         ) const;
140         template<class GeoField>
141         static wordList getNames(const PtrList<GeoField>&);
143         template<class Type>
144         static void getTecplotNames
145         (
146             const wordList& names,
147             const INTEGER4 loc,
148             string& varNames,
149             DynamicList<INTEGER4>& varLocation
150         );
152         template<class GeoField>
153         static void getTecplotNames
154         (
155             const PtrList<GeoField>& flds,
156             const INTEGER4 loc,
157             string& varNames,
158             DynamicList<INTEGER4>& varLocation
159         );
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 } // End namespace Foam
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 #ifdef NoRepository
171 #   include "tecplotWriterTemplates.C"
172 #endif
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 #endif
179 // ************************************************************************* //