FIREMeshReader.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-2018 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::FIREMeshReader
28 
29 Description
30  Read AVL/FIRE fpma, fpmb files.
31 
32 Note
33  Does not handle compressed versions (fpmaz, fpmbz) of these files.
34 
35 SourceFiles
36  FIREMeshReader.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef FIREMeshReader_H
41 #define FIREMeshReader_H
42 
43 #include "meshReader.H"
44 #include "FIRECore.H"
45 #include "labelList.H"
46 #include "IFstream.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 // Forward declarations
53 class polyMesh;
54 
55 namespace fileFormats
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class fileFormats::FIREMeshReader Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class FIREMeshReader
63 :
64  public meshReader,
65  public FIRECore
66 {
67 
68 protected:
69 
70  // Protected Data
71 
74 
77 
78 
79  // Protected Member Functions
80 
81  //- No copy construct
82  FIREMeshReader(const FIREMeshReader&) = delete;
83 
84  //- No copy assignment
85  void operator=(const FIREMeshReader&) = delete;
86 
87 
88  //- Read the mesh from the file(s)
89  virtual bool readGeometry(const scalar scaleFactor = 1.0);
90 
91  //- Read points from file
92  void readPoints(ISstream&, const scalar scaleFactor = 1.0);
93 
94  //- Read points from file
95  void readFaces(ISstream&);
96 
97  //- Read cell connectivities from file
98  void readCells(ISstream&);
99 
100  //- Read cell/face selections from file
101  void readSelections(ISstream&);
102 
103  //-
104  void reorganize();
105 
106  void addPatches(polyMesh&) const;
107 
108 
109 public:
110 
111  // Constructors
112 
113  //- Construct by reading file, optionally with scaling
114  FIREMeshReader(const fileName&, const scalar scaleFactor = 1.0);
115 
116 
117  //- Destructor
118  virtual ~FIREMeshReader() = default;
119 
120 
121  // Member Functions
122 
123  //- Create and return polyMesh
124  virtual autoPtr<polyMesh> mesh(const objectRegistry&);
125 
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace fileFormats
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
A class for handling file names.
Definition: fileName.H:71
void readSelections(ISstream &)
Read cell/face selections from file.
void readPoints(ISstream &, const scalar scaleFactor=1.0)
Read points from file.
void readFaces(ISstream &)
Read points from file.
FIREMeshReader(const FIREMeshReader &)=delete
No copy construct.
void operator=(const FIREMeshReader &)=delete
No copy assignment.
void addPatches(polyMesh &) const
virtual autoPtr< polyMesh > mesh(const objectRegistry &)
Create and return polyMesh.
Generic input stream using a standard (STL) stream.
Definition: ISstream.H:51
virtual ~FIREMeshReader()=default
Destructor.
Read AVL/FIRE fpma, fpmb files.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:73
void readCells(ISstream &)
Read cell connectivities from file.
Core routines used when reading/writing AVL/FIRE files.
Definition: FIRECore.H:55
Registry of regIOobjects.
This class supports creating polyMeshes with baffles.
Definition: meshReader.H:64
virtual bool readGeometry(const scalar scaleFactor=1.0)
Read the mesh from the file(s)
Namespace for OpenFOAM.