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-2019 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 SourceFiles
50  proxySurfaceWriter.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef proxySurfaceWriter_H
55 #define proxySurfaceWriter_H
56 
57 #include "surfaceWriter.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 namespace surfaceWriters
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class proxyWriter Declaration
68 \*---------------------------------------------------------------------------*/
69 
70 class proxyWriter
71 :
72  public surfaceWriter
73 {
74  // Private Data
75 
76  //- The file extension associated with the proxy
77  word fileExtension_;
78 
79  //- Format options
80  dictionary options_;
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeNameNoDebug("proxy");
87 
88 
89  // Constructors
90 
91  //- Construct for a given extension
92  explicit proxyWriter(const word& fileExt);
93 
94  //- Construct for a given extension, with some output options
95  proxyWriter(const word& fileExt, const dictionary& options);
96 
97  //- Construct from components, taking extension from outputPath
99  (
100  const meshedSurf& surf,
101  const fileName& outputPath,
102  bool parallel = Pstream::parRun(),
103  const dictionary& options = dictionary()
104  );
105 
106  //- Construct from components, taking extension from outputPath
108  (
109  const pointField& points,
110  const faceList& faces,
111  const fileName& outputPath,
112  bool parallel = Pstream::parRun(),
113  const dictionary& options = dictionary()
114  );
115 
116 
117  //- Destructor
118  virtual ~proxyWriter() = default;
119 
120 
121  // Member Functions
122 
123  //- A separate file is required for geometry.
124  virtual bool separateGeometry() const
125  {
126  return true;
127  }
128 
129  //- Write surface geometry to file.
130  virtual fileName write(); // override
131 
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace surfaceWriters
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
Foam::surfaceWriters::proxyWriter::TypeNameNoDebug
TypeNameNoDebug("proxy")
Runtime type information.
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:414
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:97
surfaceWriter.H
Foam::surfaceWriters::proxyWriter
A surfaceWriter that writes the geometry via the MeshedSurfaceProxy, but which does not support any f...
Definition: proxySurfaceWriter.H:69
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::Field< vector >
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:123