FIRECore.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 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::FIRECore
28
29Description
30 Core routines used when reading/writing AVL/FIRE files.
31
32SourceFiles
33 FIRECore.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef FIRECore_H
38#define FIRECore_H
39
40#include "point.H"
41#include "string.H"
42#include "labelList.H"
43#include "pointField.H"
44#include "IOstreams.H"
45#include "Enum.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51// forward declarations
52class polyMesh;
53
54namespace fileFormats
55{
56
57/*---------------------------------------------------------------------------*\
58 Class fileFormats::FIRECore Declaration
59\*---------------------------------------------------------------------------*/
61class FIRECore
62{
63public:
64
65 // Public Data, Declarations
66
67 //- Selection Types
68 enum selectionType
69 {
70 cellSelection = 2,
72 };
73
74 //- Shape-Type for FIRE (FLMA) files
75 enum shapeType
76 {
82 firePyr = 6,
84 };
85
86 //- Enumeration defining the file extensions for 3D types
87 enum fileExt3d
88 {
93 };
94
95
96 //- Integer type (binary format)
97 typedef int32_t fireInt_t;
98
99 //- Float type (binary format)
100 typedef double fireReal_t;
101
102
103protected:
104
105 // Protected Data
108
109
110 // Protected Member Functions
111
112 //- Construct null
113 FIRECore() = default;
114
115
116 //- Read points.
117 // This is the first thing to do when reading FPMA,FPMB,FLMA files.
118 // Return the number of points read.
119 //
120 // The file format is as follows:
121 // \verbatim
122 // NUMBER_OF_VERTICES
123 // x0 y0 z0 x1 y1 z1 ... xN-1 yN-1 zN-1
124 // \endverbatim
125 static label readPoints(ISstream&, pointField&);
126
127public:
128
129 // Public Member Functions
130
131 //- Resolve base file-name for the given file-type
133 (
134 const fileName& baseName,
135 const enum fileExt3d
136 );
137
138
139 //- Get an integer (ascii or binary)
140 static label getFireLabel(ISstream&);
141
142 //- Get an point x/y/z (ascii or binary)
143 static point getFirePoint(ISstream&);
144
145 //- Extract a string (ascii or binary)
146 static std::string getFireString(ISstream&);
147
148
149 //- Write an integer (ascii or binary)
150 static void putFireLabel(OSstream&, const label);
151
152 //- Write multiple integers (ascii or binary)
153 static void putFireLabels(OSstream&, const labelUList&);
154
155 //- Write an on-the-fly list of integers (ascii or binary)
156 static void putFireLabels
157 (
158 OSstream&,
159 const label count,
160 const label start
161 );
162
163
164 //- Write a point x/y/z (ascii or binary)
165 static void putFirePoint(OSstream&, const point&);
166
167 //- Write a string (ascii or binary)
168 static void putFireString(OSstream&, const std::string&);
169
170};
171
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175} // End namespace fileFormats
176} // End namespace Foam
177
178// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179
180#endif
181
182// ************************************************************************* //
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
Generic input stream using a standard (STL) stream.
Definition: ISstream.H:58
Generic output stream using a standard (STL) stream.
Definition: OSstream.H:57
Face selection method for createBaffles.
Definition: faceSelection.H:59
Core routines used when reading/writing AVL/FIRE files.
Definition: FIRECore.H:61
selectionType
Selection Types.
Definition: FIRECore.H:68
static const Enum< fileExt3d > file3dExtensions
Definition: FIRECore.H:106
static std::string getFireString(ISstream &)
Extract a string (ascii or binary)
Definition: FIRECore.C:138
double fireReal_t
Float type (binary format)
Definition: FIRECore.H:99
static void putFireLabel(OSstream &, const label)
Write an integer (ascii or binary)
Definition: FIRECore.C:202
shapeType
Shape-Type for FIRE (FLMA) files.
Definition: FIRECore.H:75
static fileName fireFileName(const fileName &baseName, const enum fileExt3d)
Resolve base file-name for the given file-type.
Definition: FIRECore.C:79
static point getFirePoint(ISstream &)
Get an point x/y/z (ascii or binary)
Definition: FIRECore.C:109
static void putFireString(OSstream &, const std::string &)
Write a string (ascii or binary)
Definition: FIRECore.C:334
fileExt3d
Enumeration defining the file extensions for 3D types.
Definition: FIRECore.H:87
static void putFireLabels(OSstream &, const labelUList &)
Write multiple integers (ascii or binary)
Definition: FIRECore.C:225
static label readPoints(ISstream &, pointField &)
Read points.
Definition: FIRECore.C:48
int32_t fireInt_t
Integer type (binary format)
Definition: FIRECore.H:96
FIRECore()=default
Construct null.
static void putFirePoint(OSstream &, const point &)
Write a point x/y/z (ascii or binary)
Definition: FIRECore.C:305
static label getFireLabel(ISstream &)
Get an integer (ascii or binary)
Definition: FIRECore.C:88
A class for handling file names.
Definition: fileName.H:76
Namespace for OpenFOAM.