1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::meshReaders::STARCD
29 Read pro-STAR vrt/cel/bnd files.
30 The protected data in meshReader are filled.
32 Starting with pro-STAR version 4, the files have become easier to read.
33 - vertices are space-delimited.
34 - the cell format is logical.
35 - trimmed and degenerate cells are saved as polyhedral.
36 - the boundaries corresponds to cells and their faces.
41 \*---------------------------------------------------------------------------*/
43 #ifndef STARCDMeshReader_H
44 #define STARCDMeshReader_H
46 # include "meshReader.H"
47 # include "boundaryRegion.H"
48 # include "cellShape.H"
49 # include "IFstream.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 /*---------------------------------------------------------------------------*\
60 Class meshReaders::STARCD Declaration
61 \*---------------------------------------------------------------------------*/
72 static const char* defaultBoundaryName;
73 static const char* defaultSolidBoundaryName;
75 //- Face addressing from pro-STAR faces -> OpenFOAM faces
76 static const int starToFoamFaceAddr[4][6];
79 cellShapeList cellShapes_;
81 //- Point labels (imported Point numbering not necessarily contiguous)
82 labelList mapToFoamPointId_;
84 //- Cell labels (imported Cell numbering not necessarily contiguous)
85 labelList mapToFoamCellId_;
87 //- Boundary region data
88 boundaryRegion boundaryRegion_;
91 // Protected Member Functions
93 //- Disallow default bitwise copy construct
94 STARCD(const STARCD&);
96 //- Disallow default bitwise assignment
97 void operator=(const STARCD&);
99 //- Read the mesh from the file(s)
100 virtual bool readGeometry(const scalar scaleFactor = 1.0);
102 //- Read points from file
103 void readPoints(const fileName&, const scalar scaleFactor);
105 //- Read cell connectivities from file
106 virtual void readCells(const fileName&);
108 //- Remove unused points
111 //- Read boundary (cell/face) definitions
112 void readBoundary(const fileName&);
114 //- Read auxiliary data from constant/{boundaryRegion,cellTable}
115 void readAux(const objectRegistry&);
117 //- Read and discard to newline
118 static void readToNewline(IFstream&);
121 static bool readHeader(IFstream&, word fileSignature);
130 starcdBaffleType = 3,
153 //- Keep solids (default false)
154 static bool keepSolids;
159 //- Construct from case name
162 const fileName& prefix,
163 const objectRegistry&,
164 const scalar scaleFactor = 1.0
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 } // End namespace meshReaders
176 } // End namespace Foam
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 // ************************************************************************* //