STARCDMeshReader.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::fileFormats::STARCDMeshReader
29 
30 Description
31  Read PROSTAR vrt/cel/bnd files.
32  The protected data in meshReader are filled.
33 
34  Starting with PROSTAR version 4, the files have become easier to read.
35  - vertices are space-delimited.
36  - the cell format is logical.
37  - trimmed and degenerate cells are saved as polyhedral.
38  - the boundaries corresponds to cells and their faces.
39 
40 Notes
41  - Shell entries are read, yet ignored.
42 
43 SourceFiles
44  STARCDMeshReader.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef STARCDMeshReader_H
49 #define STARCDMeshReader_H
50 
51 #include "meshReader.H"
52 #include "STARCDCore.H"
53 #include "boundaryRegion.H"
54 #include "cellShape.H"
55 #include "IFstream.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 
62 namespace fileFormats
63 {
64 
65 /*---------------------------------------------------------------------------*\
66  Class fileFormats::STARCDMeshReader Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 class STARCDMeshReader
70 :
71  public meshReader,
72  protected STARCDCore
73 {
74  // Private data
75 
76  //- Retain solid cell types
77  bool keepSolids_;
78 
79 
80 protected:
81 
82  // Protected Data
83 
84  //- Cell shapes
86 
87  //- Point labels (imported Point numbering not necessarily contiguous)
89 
90  //- Cell labels (imported Cell numbering not necessarily contiguous)
92 
93  //- Boundary region data
95 
96 
97  // Protected Member Functions
98 
99  //- Read the mesh from the file(s)
100  virtual bool readGeometry(const scalar scaleFactor = 1.0);
101 
102  //- Read points from file, return the max prostar id used.
103  label readPoints(const fileName&, const scalar scaleFactor);
104 
105  //- Read cell connectivities from file
106  virtual void readCells(const fileName&);
107 
108  //- Remove unused points
109  void cullPoints();
110 
111  //- Read boundary (cell/face) definitions
112  void readBoundary(const fileName&);
113 
114  //- Read auxiliary data from constant/{boundaryRegion,cellTable}
115  void readAux(const objectRegistry&);
116 
117 
118 public:
119 
120  // Constructors
121 
122  //- Construct from case name
124  (
125  const fileName& prefix,
126  const objectRegistry& registry,
127  const scalar scaleFactor = 1.0,
128  const bool keepSolids = false
129  );
130 
131 
132  //- Destructor
133  virtual ~STARCDMeshReader() = default;
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace fileFormats
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::boundaryRegion
The boundaryRegion persistent data saved as a Map<dictionary>.
Definition: boundaryRegion.H:72
Foam::fileFormats::STARCDMeshReader::readCells
virtual void readCells(const fileName &)
Read cell connectivities from file.
Definition: STARCDMeshReader.C:217
Foam::fileFormats::STARCDMeshReader::~STARCDMeshReader
virtual ~STARCDMeshReader()=default
Destructor.
STARCDCore.H
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::fileFormats::STARCDMeshReader::readGeometry
virtual bool readGeometry(const scalar scaleFactor=1.0)
Read the mesh from the file(s)
Definition: STARCDMeshReader.C:1012
Foam::fileFormats::STARCDMeshReader::readBoundary
void readBoundary(const fileName &)
Read boundary (cell/face) definitions.
Definition: STARCDMeshReader.C:608
Foam::fileFormats::STARCDCore
Core routines used when reading/writing PROSTAR vrt/cel/bnd files.
Definition: STARCDCore.H:59
Foam::fileFormats::STARCDMeshReader::mapToFoamPointId_
labelList mapToFoamPointId_
Point labels (imported Point numbering not necessarily contiguous)
Definition: STARCDMeshReader.H:87
IFstream.H
Foam::fileFormats::STARCDMeshReader
Read PROSTAR vrt/cel/bnd files. The protected data in meshReader are filled.
Definition: STARCDMeshReader.H:68
Foam::fileFormats::STARCDMeshReader::mapToFoamCellId_
labelList mapToFoamCellId_
Cell labels (imported Cell numbering not necessarily contiguous)
Definition: STARCDMeshReader.H:90
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fileFormats::STARCDMeshReader::cullPoints
void cullPoints()
Remove unused points.
Definition: STARCDMeshReader.C:953
Foam::fileFormats::STARCDMeshReader::readPoints
label readPoints(const fileName &, const scalar scaleFactor)
Read points from file, return the max prostar id used.
Definition: STARCDMeshReader.C:85
Foam::meshReader
This class supports creating polyMeshes with baffles.
Definition: meshReader.H:68
Foam::List< cellShape >
cellShape.H
Foam::fileFormats::STARCDMeshReader::STARCDMeshReader
STARCDMeshReader(const fileName &prefix, const objectRegistry &registry, const scalar scaleFactor=1.0, const bool keepSolids=false)
Construct from case name.
Definition: STARCDMeshReader.C:1036
Foam::fileFormats::STARCDMeshReader::cellShapes_
cellShapeList cellShapes_
Cell shapes.
Definition: STARCDMeshReader.H:84
Foam::fileFormats::STARCDMeshReader::readAux
void readAux(const objectRegistry &)
Read auxiliary data from constant/{boundaryRegion,cellTable}.
Definition: STARCDMeshReader.C:62
meshReader.H
boundaryRegion.H
Foam::fileFormats::STARCDMeshReader::boundaryRegion_
boundaryRegion boundaryRegion_
Boundary region data.
Definition: STARCDMeshReader.H:93