1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
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
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/>.
25 Foam::starcdSurfaceWriter
28 A surfaceWriter for STARCD files.
30 The geometry is written via the MeshedSurfaceProxy, the fields
31 are written in a trivial ASCII format with ID and VALUE as
32 so-called user data. These \c .usr files can be read into proSTAR
33 with these types of commands. For element data:
35 getuser FILENAME.usr cell scalar free
36 getuser FILENAME.usr cell vector free
40 getuser FILENAME.usr vertex scalar free
41 getuser FILENAME.usr vertex vector free
45 Only scalar and vector fields are supported directly.
46 A sphericalTensor is written as a scalar.
47 Other field types are not written.
52 \*---------------------------------------------------------------------------*/
54 #ifndef starcdSurfaceWriter_H
55 #define starcdSurfaceWriter_H
57 #include "surfaceWriter.H"
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 /*---------------------------------------------------------------------------*\
65 Class starcdSurfaceWriter Declaration
66 \*---------------------------------------------------------------------------*/
68 class starcdSurfaceWriter
72 // Private Member Functions
75 static inline void writeData(Ostream&, const Type&);
78 //- Templated write operation
82 const fileName& outputDir,
83 const fileName& surfaceName,
84 const pointField& points,
85 const faceList& faces,
86 const word& fieldName,
87 const Field<Type>& values,
88 const bool isNodeValues,
95 //- Runtime type information
102 starcdSurfaceWriter();
106 virtual ~starcdSurfaceWriter();
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()
118 //- Write single surface geometry to file.
121 const fileName& outputDir,
122 const fileName& surfaceName,
123 const pointField& points,
124 const faceList& faces,
125 const bool verbose = false
128 //- Write scalarField for a single surface to file.
129 // One value per face or vertex (isNodeValues = true)
132 const fileName& outputDir, // <case>/surface/TIME
133 const fileName& surfaceName, // name of surface
134 const pointField& points,
135 const faceList& faces,
136 const word& fieldName, // name of field
137 const Field<scalar>& values,
138 const bool isNodeValues,
139 const bool verbose = false
142 //- Write vectorField for a single surface to file.
143 // One value per face or vertex (isNodeValues = true)
146 const fileName& outputDir, // <case>/surface/TIME
147 const fileName& surfaceName, // name of surface
148 const pointField& points,
149 const faceList& faces,
150 const word& fieldName, // name of field
151 const Field<vector>& values,
152 const bool isNodeValues,
153 const bool verbose = false
156 //- Write sphericalTensorField for a single surface to file.
157 // One value per face or vertex (isNodeValues = true)
160 const fileName& outputDir, // <case>/surface/TIME
161 const fileName& surfaceName, // name of surface
162 const pointField& points,
163 const faceList& faces,
164 const word& fieldName, // name of field
165 const Field<sphericalTensor>& values,
166 const bool isNodeValues,
167 const bool verbose = false
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 } // End namespace Foam
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 // ************************************************************************* //