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-2017 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::fileFormats::FLMAsurfaceFormat
28 
29 Description
30  Provide a means of writing AVL/FIRE FLMA format.
31 
32 SourceFiles
33  FLMAsurfaceFormat.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef FLMAsurfaceFormat_H
38 #define FLMAsurfaceFormat_H
39 
40 #include "MeshedSurface.H"
41 #include "MeshedSurfaceProxy.H"
42 #include "FIRECore.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 namespace fileFormats
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class fileFormats::FLMAsurfaceFormat Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class Face>
57 :
58  public MeshedSurface<Face>,
59  public FIRECore
60 {
61  // Private Member Functions
62 
63  static inline void writeShell(OSstream& os, const Face& f);
64  static inline void writeType(OSstream& os, const Face& f);
65 
66 
67 protected:
68 
69  // Protected Member Functions
70 
71  //- Write surface mesh components by proxy
72  static void write
73  (
74  OSstream& os,
75  const MeshedSurfaceProxy<Face>& surf
76  );
77 
78 
79  //- Write surface mesh components by proxy with/without compression
80  static void write
81  (
82  bool compress,
83  const fileName& filename,
84  const MeshedSurfaceProxy<Face>& surf
85  );
86 
87 
88 public:
89 
90  // Constructors
91 
92  //- Construct null
93  FLMAsurfaceFormat() = default;
94 
95 
96  //- Destructor
97  virtual ~FLMAsurfaceFormat() = default;
98 
99 
100  // Static Member Functions
101 
102  //- Write surface mesh components by proxy
103  static void write
104  (
105  const fileName& filename,
106  const MeshedSurfaceProxy<Face>& surf,
107  const dictionary& options = dictionary::null
108  );
109 
110 
111  // Member Functions
112 
113  //- Write surface mesh as flma file
114  virtual void write
115  (
116  const fileName& name,
117  const dictionary& options = dictionary::null
118  ) const
119  {
120  write(name, MeshedSurfaceProxy<Face>(*this), options);
121  }
122 
123 };
124 
125 
126 /*---------------------------------------------------------------------------*\
127  Class FLMAZsurfaceFormat Declaration
128 \*---------------------------------------------------------------------------*/
129 
130 template<class Face>
131 class FLMAZsurfaceFormat
132 :
133  public FLMAsurfaceFormat<Face>
134 {
135 public:
136 
137  // Constructors
138 
139  //- Construct null
140  FLMAZsurfaceFormat() = default;
141 
142 
143  //- Destructor
144  virtual ~FLMAZsurfaceFormat() = default;
145 
146 
147  // Static Member Functions
148 
149  //- Write surface mesh components by proxy
150  static void write
151  (
152  const fileName& filename,
153  const MeshedSurfaceProxy<Face>& surf,
154  const dictionary& options = dictionary::null
155  );
156 
157 
158  // Member Functions
159 
160  //- Write surface mesh as flmaz file
161  virtual void write
162  (
163  const fileName& name,
164  const dictionary& options = dictionary::null
165  ) const
166  {
167  write(name, MeshedSurfaceProxy<Face>(*this), options);
168  }
169 
170 };
171 
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 } // End namespace fileFormats
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #ifdef NoRepository
181 # include "FLMAsurfaceFormat.C"
182 #endif
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
MeshedSurfaceProxy.H
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::fileFormats::FLMAZsurfaceFormat::~FLMAZsurfaceFormat
virtual ~FLMAZsurfaceFormat()=default
Destructor.
Foam::fileFormats::FLMAsurfaceFormat
Provide a means of writing AVL/FIRE FLMA format.
Definition: FLMAsurfaceFormat.H:55
FIRECore.H
Foam::MeshedSurfaceProxy
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
Definition: MeshedSurface.H:78
Foam::dictionary::null
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:385
FLMAsurfaceFormat.C
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::fileFormats::FLMAsurfaceFormat::write
static void write(OSstream &os, const MeshedSurfaceProxy< Face > &surf)
Write surface mesh components by proxy.
Definition: FLMAsurfaceFormat.C:157
Foam::OSstream
Generic output stream.
Definition: OSstream.H:54
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::fileFormats::FLMAsurfaceFormat::FLMAsurfaceFormat
FLMAsurfaceFormat()=default
Construct null.
f
labelList f(nPoints)
Foam::fileFormats::FIRECore
Core routines used when reading/writing AVL/FIRE files.
Definition: FIRECore.H:60
Foam::fileFormats::FLMAZsurfaceFormat::write
static void write(const fileName &filename, const MeshedSurfaceProxy< Face > &surf, const dictionary &options=dictionary::null)
Write surface mesh components by proxy.
Definition: FLMAsurfaceFormat.C:376
Foam::fileFormats::FLMAsurfaceFormat::~FLMAsurfaceFormat
virtual ~FLMAsurfaceFormat()=default
Destructor.
Foam::MeshedSurface
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: triSurfaceTools.H:80
Foam::fileFormats::FLMAZsurfaceFormat::FLMAZsurfaceFormat
FLMAZsurfaceFormat()=default
Construct null.
Foam::fileFormats::FLMAZsurfaceFormat
Definition: FLMAsurfaceFormat.H:130
MeshedSurface.H