The open source CFD toolbox
proxySurfaceWriter.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011 OpenFOAM Foundation
9 Copyright (C) 2015-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::surfaceWriters::proxyWriter
29
30Description
31 A surfaceWriter that writes the geometry via the MeshedSurfaceProxy,
32 but which does not support any fields.
33
34 \section Output file locations
35
36 The \c rootdir normally corresponds to something like
37 \c postProcessing/<name>
38
39 \subsection Geometry
40 \verbatim
41 rootdir
42 -- timeName
43 -- surfaceName.{obj|stl|..}
44 \endverbatim
45
46Note
47 The formatOptions for proxy are file-type dependent.
48
49 The following stream options are read and passed through,
50 but not necessarily used by the corresponding backend.
51 \table
52 Property | Description | Required | Default
53 format | ascii/binary | no | ascii
54 compression | Use file compression | no | false
55 scale | Output geometry scaling | no | 1
56 transform | Output coordinate transform | no |
57 \endtable
58
59SourceFiles
60 proxySurfaceWriter.C
61
62\*---------------------------------------------------------------------------*/
63
64#ifndef Foam_surfaceWriters_proxyWriter_H
65#define Foam_surfaceWriters_proxyWriter_H
66
67#include "surfaceWriter.H"
68
69// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70
71namespace Foam
72{
73namespace surfaceWriters
74{
75
76/*---------------------------------------------------------------------------*\
77 Class proxyWriter Declaration
78\*---------------------------------------------------------------------------*/
79
80class proxyWriter
81:
82 public surfaceWriter
83{
84 // Private Data
85
86 //- The file extension associated with the proxy
87 word fileExtension_;
88
89 //- Output stream option
90 IOstreamOption streamOpt_;
91
92 //- Format options
93 dictionary options_;
94
95
96public:
97
98 //- Declare type-name, virtual type (without debug switch)
99 TypeNameNoDebug("proxy");
100
101
102 // Constructors
103
104 //- Construct for a given extension
105 explicit proxyWriter(const word& fileExt);
106
107 //- Construct for a given extension, with some output options
108 proxyWriter(const word& fileExt, const dictionary& options);
109
110 //- Construct from components, taking extension from outputPath
112 (
113 const meshedSurf& surf,
114 const fileName& outputPath,
115 bool parallel = Pstream::parRun(),
116 const dictionary& options = dictionary()
117 );
118
119 //- Construct from components, taking extension from outputPath
121 (
122 const pointField& points,
123 const faceList& faces,
124 const fileName& outputPath,
125 bool parallel = Pstream::parRun(),
126 const dictionary& options = dictionary()
127 );
128
129
130 //- Destructor
131 virtual ~proxyWriter() = default;
132
133
134 // Member Functions
135
136 //- A separate file is required for geometry.
137 virtual bool separateGeometry() const
138 {
139 return true;
140 }
141
142 //- Write surface geometry to file.
143 virtual fileName write(); // override
144
151};
152
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156} // End namespace surfaceWriters
157} // End namespace Foam
158
159// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160
161#endif
162
163// ************************************************************************* //
The IOstreamOption is a simple container for options an IOstream can normally have.
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:433
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling file names.
Definition: fileName.H:76
Abstract definition of a meshed surface defined by faces and points.
Definition: meshedSurf.H:50
Base class for surface writers.
A surfaceWriter that writes the geometry via the MeshedSurfaceProxy, but which does not support any f...
declareSurfaceWriterWriteMethod(sphericalTensor)
virtual bool separateGeometry() const
A separate file is required for geometry.
virtual ~proxyWriter()=default
Destructor.
TypeNameNoDebug("proxy")
Declare type-name, virtual type (without debug switch)
virtual fileName write()
Write surface geometry to file.
A class for handling words, derived from Foam::string.
Definition: word.H:68
const pointField & points
Namespace for OpenFOAM.
#define declareSurfaceWriterWriteMethod(Type)
#define TypeNameNoDebug(TypeNameString)
Declare a ClassNameNoDebug() with extra virtual type info.
Definition: typeInfo.H:68