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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::surfaceWriters::proxyWriter
29 
30 Description
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 
46 Note
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 
59 SourceFiles
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 
71 namespace Foam
72 {
73 namespace surfaceWriters
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class proxyWriter Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class 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 
96 public:
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  // 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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace surfaceWriters
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
A class for handling file names.
Definition: fileName.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual bool separateGeometry() const
A separate file is required for geometry.
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:1049
virtual fileName write()
Write surface geometry to file.
virtual ~proxyWriter()=default
Destructor.
Abstract definition of a meshed surface defined by faces and points.
Definition: meshedSurf.H:43
const pointField & points
proxyWriter(const word &fileExt)
Construct for a given extension.
A class for handling words, derived from Foam::string.
Definition: word.H:63
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
TypeNameNoDebug("proxy")
Declare type-name, virtual type (without debug switch)
Tensor of scalars, i.e. Tensor<scalar>.
Namespace for OpenFOAM.