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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::fileFormats::STARCDMeshReader
29
30Description
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
40Notes
41 - Shell entries are read, yet ignored.
42
43SourceFiles
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
59namespace Foam
60{
61
62namespace fileFormats
63{
64
65/*---------------------------------------------------------------------------*\
66 Class fileFormats::STARCDMeshReader Declaration
67\*---------------------------------------------------------------------------*/
70:
71 public meshReader,
72 protected STARCDCore
73{
74 // Private data
75
76 //- Retain solid cell types
77 bool keepSolids_;
78
79
80protected:
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
118public:
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// ************************************************************************* //
The boundaryRegion persistent data saved as a Map<dictionary>.
Core routines used when reading/writing PROSTAR vrt/cel/bnd files.
Definition: STARCDCore.H:60
Read PROSTAR vrt/cel/bnd files. The protected data in meshReader are filled.
label readPoints(const fileName &, const scalar scaleFactor)
Read points from file, return the max prostar id used.
labelList mapToFoamPointId_
Point labels (imported Point numbering not necessarily contiguous)
boundaryRegion boundaryRegion_
Boundary region data.
virtual ~STARCDMeshReader()=default
Destructor.
virtual bool readGeometry(const scalar scaleFactor=1.0)
Read the mesh from the file(s)
void cullPoints()
Remove unused points.
void readBoundary(const fileName &)
Read boundary (cell/face) definitions.
cellShapeList cellShapes_
Cell shapes.
virtual void readCells(const fileName &)
Read cell connectivities from file.
labelList mapToFoamCellId_
Cell labels (imported Cell numbering not necessarily contiguous)
void readAux(const objectRegistry &)
Read auxiliary data from constant/{boundaryRegion,cellTable}.
A class for handling file names.
Definition: fileName.H:76
This class supports creating polyMeshes with baffles.
Definition: meshReader.H:69
Registry of regIOobjects.
Namespace for OpenFOAM.