Loading...
Searching...
No Matches
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-2024 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
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");
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 = UPstream::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 = UPstream::parRun(),
126 const dictionary& options = dictionary()
127 );
128
129
130 //- Destructor
131 virtual ~proxyWriter() = default;
132
133
134 // Factory Methods
135
136 //- Optional select construct proxy writer.
137 // Return nullptr if the specified type is not supported.
138 static autoPtr<surfaceWriter> TryNew(const word& writeType);
139
140 //- Optional select construct proxy writer with extra write options.
141 // Return nullptr if the specified type is not supported.
143 (
144 const word& writeType,
145 const dictionary& writeOptions
146 );
147
148
149 // Member Functions
150
151 //- A separate file is required for geometry.
152 virtual bool separateGeometry() const
153 {
154 return true;
155 }
156
157 //- Write surface geometry to file.
158 virtual fileName write(); // override
159
166};
167
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171} // End namespace surfaceWriters
172} // End namespace Foam
173
174// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175
176#endif
177
178// ************************************************************************* //
A simple container for options an IOstream can normally have.
static bool parRun(const bool on) noexcept
Set as parallel run on/off.
Definition UPstream.H:1669
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A class for handling file names.
Definition fileName.H:75
Abstract definition of a meshed surface defined by faces and points.
Definition meshedSurf.H:44
surfaceWriter()
Default construct.
A surfaceWriter that writes the geometry via the MeshedSurfaceProxy, but which does not support any f...
declareSurfaceWriterWriteMethod(sphericalTensor)
static autoPtr< surfaceWriter > TryNew(const word &writeType)
Optional select construct proxy writer.
virtual bool separateGeometry() const
A separate file is required for geometry.
proxyWriter(const word &fileExt)
Construct for a given extension.
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:66
const pointField & points
Namespace for surface writers.
Namespace for OpenFOAM.
List< face > faceList
List of faces.
Definition faceListFwd.H:41
Tensor< scalar > tensor
Definition symmTensor.H:57
vectorField pointField
pointField is a vectorField.
Vector< scalar > vector
Definition vector.H:57
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition symmTensor.H:55
#define declareSurfaceWriterWriteMethod(Type)
#define TypeNameNoDebug(TypeNameString)
Declare a ClassNameNoDebug() with extra virtual type info.
Definition typeInfo.H:61