BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / applications / utilities / postProcessing / dataConversion / foamToTecplot360 / tecplotWriter.H
blob5b7be5c5f3e0e881a41d92b586e65687cdd34983
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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::tecplotWriter
27 Description
28     Write binary tecplot files using tecio.
30 SourceFiles
31     tecplotWriter.C
32     tecplotWriterTemplates.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef tecplotWriter_H
37 #define tecplotWriter_H
39 #include "TECIO.h"
40 #include "Time.H"
41 #include "indirectPrimitivePatch.H"
42 #include "volFields.H"
43 #include "surfaceFields.H"
45 using namespace Foam;
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace Foam
52 class fvMesh;
54 /*---------------------------------------------------------------------------*\
55                            Class tecplotWriter Declaration
56 \*---------------------------------------------------------------------------*/
58 class tecplotWriter
60     const Time& runTime_;
62 public:
64     // Constructors
66         //- Construct from components
67         tecplotWriter(const Time&);
70     // Member Functions
72         void writeInit
73         (
74             const word& name,
75             const string& varNames,
76             const fileName&,
77             INTEGER4 tecplotFileType
78         ) const;
80         //- Write mesh as polyhedral zone
81         void writePolyhedralZone
82         (
83             const word& zoneName,
84             const INTEGER4 strandID,
85             const fvMesh& mesh,
86             const List<INTEGER4>& varLocArray,
87             INTEGER4 nFaceNodes
88         ) const;
90         //- Write surface as polygonal zone
91         void writePolygonalZone
92         (
93             const word& zoneName,
94             const INTEGER4 strandID,
95             const indirectPrimitivePatch& pp,
96             const List<INTEGER4>& varLocArray
97         ) const;
99         //- Write unordered data (or rather 1D ordered)
100         void writeOrderedZone
101         (
102             const word& zoneName,
103             INTEGER4 strandID,
104             const label n,
105             const List<INTEGER4>& varLocArray
106         ) const;
108         //- Write mesh
109         void writeConnectivity(const fvMesh& mesh) const;
111         //- Write surface
112         void writeConnectivity(const indirectPrimitivePatch& pp) const;
114         void writeEnd() const;
116         //- Write generic Field
117         template<class Type>
118         void writeField(const Field<Type>& fld) const;
121         //- Get either fvPatchField or patchInternalField
122         template<class Type>
123         tmp<Field<Type> > getPatchField
124         (
125             const bool nearCellValue,
126             const GeometricField<Type, fvPatchField, volMesh>& vfld,
127             const label patchI
128         ) const;
130         //- Get mixed field: fvsPatchField for boundary faces and
131         //  internalField for internal faces.
132         template<class Type>
133         tmp<Field<Type> > getFaceField
134         (
135             const GeometricField<Type, fvsPatchField, surfaceMesh>&,
136             const labelList& faceLabels
137         ) const;
139         template<class GeoField>
140         static wordList getNames(const PtrList<GeoField>&);
142         template<class Type>
143         static void getTecplotNames
144         (
145             const wordList& names,
146             const INTEGER4 loc,
147             string& varNames,
148             DynamicList<INTEGER4>& varLocation
149         );
151         template<class GeoField>
152         static void getTecplotNames
153         (
154             const PtrList<GeoField>& flds,
155             const INTEGER4 loc,
156             string& varNames,
157             DynamicList<INTEGER4>& varLocation
158         );
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 #ifdef NoRepository
170 #   include "tecplotWriterTemplates.C"
171 #endif
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 #endif
178 // ************************************************************************* //