Loading...
Searching...
No Matches
FLMAsurfaceFormat.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) 2016-2024 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::fileFormats::FLMAsurfaceFormat
28
29Description
30 Provide a means of writing AVL/FIRE FLMA format.
31
32 Output stream options:
33 - ASCII only
34 - compression : ignored
35
36 Output dictionary options: ignored
37
38Note
39 The internal logic is still a bit odd (2020-02) since compressed files
40 must have a \b .flmaz ending.
41 To be revisited in the future.
42
43SourceFiles
44 FLMAsurfaceFormat.C
45
46\*---------------------------------------------------------------------------*/
47
48#ifndef Foam_FLMAsurfaceFormat_H
49#define Foam_FLMAsurfaceFormat_H
50
51#include "MeshedSurface.H"
52#include "MeshedSurfaceProxy.H"
53#include "FIRECore.H"
54
55// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57namespace Foam
58{
59namespace fileFormats
60{
61
62/*---------------------------------------------------------------------------*\
63 Class fileFormats::FLMAsurfaceFormat Declaration
64\*---------------------------------------------------------------------------*/
65
66template<class Face>
68:
69 public MeshedSurface<Face>,
70 public FIRECore
71{
72 // Private Member Functions
73
74 static inline void writeShell(OSstream& os, const Face& f);
75 static inline void writeType(OSstream& os, const Face& f);
76
77
78protected:
79
80 // Protected Member Functions
81
82 //- Write surface mesh components (by proxy)
83 static void write
84 (
85 OSstream& os,
86 const MeshedSurfaceProxy<Face>& surf
87 );
88
89 //- Write surface mesh components (by proxy) with/without compression
90 static void write
91 (
93 const fileName& filename,
94 const MeshedSurfaceProxy<Face>& surf
95 );
96
97
98public:
99
100 // Constructors
101
102 //- Default construct
103 FLMAsurfaceFormat() = default;
105
106 //- Destructor
107 virtual ~FLMAsurfaceFormat() = default;
108
109
110 // Static Functions
111
112 //- Write surface mesh components (by proxy)
113 static void write
114 (
115 const fileName& filename,
116 const MeshedSurfaceProxy<Face>& surf,
117 IOstreamOption /*ignored*/ = IOstreamOption(),
118 const dictionary& /*unused*/ = dictionary::null
119 );
120
121
122 // Member Functions
123
124 //- Write surface mesh to file (by proxy)
125 virtual void write
126 (
127 const fileName& name,
128 IOstreamOption streamOpt = IOstreamOption(),
129 const dictionary& options = dictionary::null
130 ) const override
131 {
132 write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
133 }
134
135 //- Write surface mesh to file (by proxy)
136 virtual void write
137 (
138 const fileName& name,
139 const word& fileType, /* ignored */
140 IOstreamOption streamOpt = IOstreamOption(),
141 const dictionary& options = dictionary::null
142 ) const override
143 {
144 write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
146};
147
148
149/*---------------------------------------------------------------------------*\
150 Class FLMAZsurfaceFormat Declaration
151\*---------------------------------------------------------------------------*/
152
153template<class Face>
154class FLMAZsurfaceFormat
155:
156 public FLMAsurfaceFormat<Face>
157{
158public:
159
160 // Constructors
161
162 //- Default construct
164
165
166 //- Destructor
167 virtual ~FLMAZsurfaceFormat() = default;
168
169
170 // Static Functions
171
172 //- Write surface mesh components (by proxy)
173 static void write
175 const fileName& filename,
176 const MeshedSurfaceProxy<Face>& surf,
177 IOstreamOption /*ignored*/ = IOstreamOption(),
178 const dictionary& /*unused*/ = dictionary::null
179 );
181
182 // Member Functions
183
184 //- Write surface mesh as flmaz file (by proxy)
185 virtual void write
186 (
187 const fileName& name,
188 IOstreamOption streamOpt = IOstreamOption(),
189 const dictionary& options = dictionary::null
190 ) const override
191 {
192 write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
193 }
194
195 //- Write surface mesh as flmaz file (by proxy)
196 virtual void write
197 (
198 const fileName& name,
199 const word& fileType, /* ignored */
200 IOstreamOption streamOpt = IOstreamOption(),
201 const dictionary& options = dictionary::null
202 ) const override
203 {
204 write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
205 }
206};
207
208
209// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210
211} // End namespace fileFormats
212} // End namespace Foam
213
214// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216#ifdef NoRepository
217# include "FLMAsurfaceFormat.C"
218#endif
219
220// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221
222#endif
223
224// ************************************************************************* //
A simple container for options an IOstream can normally have.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED).
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
friend class MeshedSurface
Generic output stream using a standard (STL) stream.
Definition OSstream.H:53
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition dictionary.H:487
FIRECore()=default
Construct null.
virtual ~FLMAZsurfaceFormat()=default
Destructor.
FLMAZsurfaceFormat()=default
Default construct.
virtual void write(const fileName &name, const word &fileType, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const override
Write surface mesh as flmaz file (by proxy).
virtual void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const override
Write surface mesh as flmaz file (by proxy).
FLMAsurfaceFormat()=default
Default construct.
virtual void write(const fileName &name, const word &fileType, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const override
Write surface mesh to file (by proxy).
virtual ~FLMAsurfaceFormat()=default
Destructor.
virtual void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const override
Write surface mesh to file (by proxy).
A class for handling file names.
Definition fileName.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
OBJstream os(runTime.globalPath()/outputName)
Namespace to isolate specifics for file formats, and some common utilities.
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
runTime write()
labelList f(nPoints)