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-2020 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 FLMAsurfaceFormat_H
49#define 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;
104
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 as flma file
125 virtual void write
126 (
127 const fileName& name,
128 IOstreamOption streamOpt = IOstreamOption(),
129 const dictionary& options = dictionary::null
130 ) const
131 {
132 write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
133 }
134};
135
136
137/*---------------------------------------------------------------------------*\
138 Class FLMAZsurfaceFormat Declaration
139\*---------------------------------------------------------------------------*/
140
141template<class Face>
143:
144 public FLMAsurfaceFormat<Face>
145{
146public:
147
148 // Constructors
149
150 //- Default construct
151 FLMAZsurfaceFormat() = default;
152
153
154 //- Destructor
155 virtual ~FLMAZsurfaceFormat() = default;
156
157
158 // Static Functions
159
160 //- Write surface mesh components by proxy
161 static void write
162 (
163 const fileName& filename,
164 const MeshedSurfaceProxy<Face>& surf,
165 IOstreamOption /*ignored*/ = IOstreamOption(),
166 const dictionary& /*unused*/ = dictionary::null
167 );
168
169
170 // Member Functions
171
172 //- Write surface mesh as flmaz file
173 virtual void write
174 (
175 const fileName& name,
176 IOstreamOption streamOpt = IOstreamOption(),
177 const dictionary& options = dictionary::null
178 ) const
179 {
180 write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
181 }
182};
183
184
185// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186
187} // End namespace fileFormats
188} // End namespace Foam
189
190// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191
192#ifdef NoRepository
193# include "FLMAsurfaceFormat.C"
194#endif
195
196// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197
198#endif
199
200// ************************************************************************* //
The IOstreamOption is 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.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:99
Generic output stream using a standard (STL) stream.
Definition: OSstream.H:57
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Core routines used when reading/writing AVL/FIRE files.
Definition: FIRECore.H:61
virtual void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
Write surface mesh as flmaz file.
virtual ~FLMAZsurfaceFormat()=default
Destructor.
FLMAZsurfaceFormat()=default
Default construct.
Provide a means of writing AVL/FIRE FLMA format.
virtual void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
Write surface mesh as flma file.
FLMAsurfaceFormat()=default
Default construct.
virtual ~FLMAsurfaceFormat()=default
Destructor.
A class for handling file names.
Definition: fileName.H:76
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
runTime write()
labelList f(nPoints)