BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / sampling / sampledSurface / writers / surfaceWriter.H
blobaa9e8fd09514d64f6518317eccb9e2033b79b667
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::surfaceWriter
27 Description
29 SourceFiles
30     surfaceWriter.C
32 \*---------------------------------------------------------------------------*/
34 #ifndef surfaceWriter_H
35 #define surfaceWriter_H
37 #include "volFields.H"
38 #include "typeInfo.H"
39 #include "autoPtr.H"
40 #include "pointField.H"
41 #include "faceList.H"
42 #include "fileName.H"
44 #include "runTimeSelectionTables.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 /*---------------------------------------------------------------------------*\
52                         Class surfaceWriter Declaration
53 \*---------------------------------------------------------------------------*/
55 class surfaceWriter
57 public:
59     //- Runtime type information
60     TypeName("surfaceWriter");
62     // Declare run-time constructor selection table
64         declareRunTimeSelectionTable
65         (
66             autoPtr,
67             surfaceWriter,
68             word,
69             (),
70             ()
71         );
73         declareRunTimeSelectionTable
74         (
75             autoPtr,
76             surfaceWriter,
77             wordDict,
78             (
79                 const dictionary& optDict
80             ),
81             (optDict)
82         );
85     // Selectors
87         //- Return a reference to the selected surfaceWriter
88         static autoPtr<surfaceWriter> New(const word& writeType);
90         //- Return a reference to the selected surfaceWriter
91         //  Select with extra write option
92         static autoPtr<surfaceWriter> New
93         (
94             const word& writeType,
95             const dictionary& writeOptions
96         );
99     // Constructors
101         //- Construct null
102         surfaceWriter();
105     //- Destructor
106     virtual ~surfaceWriter();
109     // Member Functions
111         //- True if the surface format supports geometry in a separate file.
112         //  False if geometry and field must be in a single file
113         virtual bool separateGeometry()
114         {
115             return false;
116         }
119         //- Write single surface geometry to file.
120         virtual void write
121         (
122             const fileName& outputDir,      // <case>/surface/TIME
123             const fileName& surfaceName,    // name of surface
124             const pointField& points,
125             const faceList& faces,
126             const bool verbose = false
127         ) const
128         {}
131         //- Write scalarField for a single surface to file.
132         //  One value per face or vertex (isNodeValues = true)
133         virtual void write
134         (
135             const fileName& outputDir,      // <case>/surface/TIME
136             const fileName& surfaceName,    // name of surface
137             const pointField& points,
138             const faceList& faces,
139             const word& fieldName,          // name of field
140             const Field<scalar>& values,
141             const bool isNodeValues,
142             const bool verbose = false
143         ) const
144         {}
146         //- Write vectorField for a single surface to file.
147         //  One value per face or vertex (isNodeValues = true)
148         virtual void write
149         (
150             const fileName& outputDir,      // <case>/surface/TIME
151             const fileName& surfaceName,    // name of surface
152             const pointField& points,
153             const faceList& faces,
154             const word& fieldName,          // name of field
155             const Field<vector>& values,
156             const bool isNodeValues,
157             const bool verbose = false
158         ) const
159         {}
161         //- Write sphericalTensorField for a single surface to file.
162         //  One value per face or vertex (isNodeValues = true)
163         virtual void write
164         (
165             const fileName& outputDir,      // <case>/surface/TIME
166             const fileName& surfaceName,    // name of surface
167             const pointField& points,
168             const faceList& faces,
169             const word& fieldName,          // name of field
170             const Field<sphericalTensor>& values,
171             const bool isNodeValues,
172             const bool verbose = false
173         ) const
174         {}
176         //- Write symmTensorField for a single surface to file.
177         //  One value per face or vertex (isNodeValues = true)
178         virtual void write
179         (
180             const fileName& outputDir,      // <case>/surface/TIME
181             const fileName& surfaceName,    // name of surface
182             const pointField& points,
183             const faceList& faces,
184             const word& fieldName,          // name of field
185             const Field<symmTensor>& values,
186             const bool isNodeValues,
187             const bool verbose = false
188         ) const
189         {}
191         //- Write tensorField for a single surface to file.
192         //  One value per face or vertex (isNodeValues = true)
193         virtual void write
194         (
195             const fileName& outputDir,      // <case>/surface/TIME
196             const fileName& surfaceName,    // name of surface
197             const pointField& points,
198             const faceList& faces,
199             const word& fieldName,          // name of field
200             const Field<tensor>& values,
201             const bool isNodeValues,
202             const bool verbose = false
203         ) const
204         {}
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 } // End namespace Foam
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 #endif
218 // ************************************************************************* //