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-2020 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  \heading Output file locations
35 
36  The \c rootdir normally corresponds to something like
37  \c postProcessing/<name>
38 
39  \subheading 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 | File compression | no | false
55  \endtable
56 
57 SourceFiles
58  proxySurfaceWriter.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef proxySurfaceWriter_H
63 #define proxySurfaceWriter_H
64 
65 #include "surfaceWriter.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 namespace surfaceWriters
72 {
73 
74 /*---------------------------------------------------------------------------*\
75  Class proxyWriter Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 class proxyWriter
79 :
80  public surfaceWriter
81 {
82  // Private Data
83 
84  //- The file extension associated with the proxy
85  word fileExtension_;
86 
87  //- Output stream option
88  IOstreamOption streamOpt_;
89 
90  //- Format options
91  dictionary options_;
92 
93 
94 public:
95 
96  //- Declare type-name, virtual type (without debug switch)
97  TypeNameNoDebug("proxy");
98 
99 
100  // Constructors
101 
102  //- Construct for a given extension
103  explicit proxyWriter(const word& fileExt);
104 
105  //- Construct for a given extension, with some output options
106  proxyWriter(const word& fileExt, const dictionary& options);
107 
108  //- Construct from components, taking extension from outputPath
110  (
111  const meshedSurf& surf,
112  const fileName& outputPath,
113  bool parallel = Pstream::parRun(),
114  const dictionary& options = dictionary()
115  );
116 
117  //- Construct from components, taking extension from outputPath
119  (
120  const pointField& points,
121  const faceList& faces,
122  const fileName& outputPath,
123  bool parallel = Pstream::parRun(),
124  const dictionary& options = dictionary()
125  );
126 
127 
128  //- Destructor
129  virtual ~proxyWriter() = default;
130 
131 
132  // Member Functions
133 
134  //- A separate file is required for geometry.
135  virtual bool separateGeometry() const
136  {
137  return true;
138  }
139 
140  //- Write surface geometry to file.
141  virtual fileName write(); // override
142 
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace surfaceWriters
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
Foam::surfaceWriters::proxyWriter::TypeNameNoDebug
TypeNameNoDebug("proxy")
Declare type-name, virtual type (without debug switch)
Foam::Tensor< scalar >
Foam::SymmTensor< scalar >
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::surfaceWriter
Base class for surface writers.
Definition: surfaceWriter.H:111
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::UPstream::parRun
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:415
Foam::meshedSurf
Abstract definition of a meshed surface defined by faces and points.
Definition: meshedSurf.H:49
Foam::surfaceWriters::proxyWriter::write
virtual fileName write()
Write surface geometry to file.
Definition: proxySurfaceWriter.C:103
surfaceWriter.H
Foam::surfaceWriters::proxyWriter
A surfaceWriter that writes the geometry via the MeshedSurfaceProxy, but which does not support any f...
Definition: proxySurfaceWriter.H:92
Foam::Field< vector >
Foam::IOstreamOption
The IOstreamOption is a simple container for options an IOstream can normally have.
Definition: IOstreamOption.H:63
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::SphericalTensor< scalar >
Foam::surfaceWriters::proxyWriter::~proxyWriter
virtual ~proxyWriter()=default
Destructor.
Foam::surfaceWriters::proxyWriter::proxyWriter
proxyWriter(const word &fileExt)
Construct for a given extension.
Definition: proxySurfaceWriter.C:47
Foam::Vector< scalar >
Foam::List< face >
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::surfaceWriters::proxyWriter::declareSurfaceWriterWriteMethod
declareSurfaceWriterWriteMethod(label)
Foam::surfaceWriters::proxyWriter::separateGeometry
virtual bool separateGeometry() const
A separate file is required for geometry.
Definition: proxySurfaceWriter.H:149