Read PROSTAR vrt/cel/bnd files. The protected data in meshReader are filled. More...
#include <STARCDMeshReader.H>


Public Member Functions | |
| STARCDMeshReader (const fileName &prefix, const objectRegistry ®istry, const scalar scaleFactor=1.0, const bool keepSolids=false) | |
| Construct from case name. | |
| virtual | ~STARCDMeshReader ()=default |
| Destructor. | |
| Public Member Functions inherited from meshReader | |
| meshReader (const fileName &, const scalar scaling=1.0) | |
| Construct from fileName. | |
| virtual | ~meshReader ()=default |
| Destructor. | |
| virtual autoPtr< polyMesh > | mesh (const objectRegistry &) |
| Create and return polyMesh. | |
| void | writeAux (const objectRegistry &) const |
| Write auxiliary information. | |
| void | writeMesh (const polyMesh &, IOstreamOption streamOpt=IOstreamOption(IOstreamOption::BINARY)) const |
| Write mesh. | |
Protected Member Functions | |
| virtual bool | readGeometry (const scalar scaleFactor=1.0) |
| Read the mesh from the file(s). | |
| label | readPoints (const fileName &, const scalar scaleFactor) |
| Read points from file, return the max prostar id used. | |
| virtual void | readCells (const fileName &) |
| Read cell connectivities from file. | |
| void | cullPoints () |
| Remove unused points. | |
| void | readBoundary (const fileName &) |
| Read boundary (cell/face) definitions. | |
| void | readAux (const objectRegistry &) |
| Read auxiliary data from constant/{boundaryRegion,cellTable}. | |
| Protected Member Functions inherited from STARCDCore | |
| STARCDCore ()=default | |
| Construct null. | |
Protected Attributes | |
| cellShapeList | cellShapes_ |
| Cell shapes. | |
| labelList | mapToFoamPointId_ |
| Point labels (imported Point numbering not necessarily contiguous). | |
| labelList | mapToFoamCellId_ |
| Cell labels (imported Cell numbering not necessarily contiguous). | |
| boundaryRegion | boundaryRegion_ |
| Boundary region data. | |
| Protected Attributes inherited from meshReader | |
| fileName | geometryFile_ |
| Referenced filename. | |
| scalar | scaleFactor_ |
| Geometry scaling. | |
| pointField | points_ |
| Points supporting the mesh. | |
| labelList | origCellId_ |
| Lookup original Cell number for a given cell. | |
| List< List< cellFaceIdentifier > > | boundaryIds_ |
| Identify boundary faces by cells and their faces. | |
| wordList | patchTypes_ |
| Boundary patch types. | |
| wordList | patchNames_ |
| Boundary patch names. | |
| wordList | patchPhysicalTypes_ |
| Boundary patch physical types. | |
| labelList | patchStarts_ |
| Polyhedral mesh boundary patch start indices and dimensions. | |
| labelList | patchSizes_ |
| label | nInternalFaces_ |
| Number of internal faces for polyMesh. | |
| faceList | meshFaces_ |
| Global face list for polyMesh. | |
| faceListList | cellFaces_ |
| List of faces for every cell. | |
| faceList | baffleFaces_ |
| List of each baffle face. | |
| labelList | cellTableId_ |
| Cell table id for each cell. | |
| cellTable | cellTable_ |
| Cell table persistent data saved as a dictionary. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from meshReader | |
| static void | warnDuplicates (const word &context, const wordList &) |
| Warn about repeated names. | |
| Protected Types inherited from STARCDCore | |
| enum | fileHeader { HEADER_CEL , HEADER_VRT , HEADER_BND } |
| Enumeration defining the file headers. More... | |
| enum | fileExt { CEL_FILE , VRT_FILE , BND_FILE , INP_FILE } |
| Enumeration defining the file extensions. More... | |
| enum | matlType { starcdFluidType = 1 , starcdSolidType = 2 , starcdBaffleType = 3 , starcdShellType = 4 , starcdLineType = 5 , starcdPointType = 6 } |
| Basic material type for STARCD/PROSTAR files. More... | |
| enum | shapeType { starcdPoint = 1 , starcdLine = 2 , starcdShell = 3 , starcdHex = 11 , starcdPrism = 12 , starcdTet = 13 , starcdPyr = 14 , starcdPoly = 255 } |
| Shape-Type for STARCD/PROSTAR files. More... | |
| Static Protected Member Functions inherited from STARCDCore | |
| static bool | readHeader (IFstream &is, const enum fileHeader header) |
| Read header and check signature PROSTAR_(CELL|VERTEX|BOUNDARY). | |
| static void | writeHeader (Ostream &os, const enum fileHeader header) |
| Write header for fileType (CELL|VERTEX|BOUNDARY). | |
| static fileName | starFileName (const fileName &baseName, const enum fileExt ext) |
| Resolve base file-name for the given file-type. | |
| static void | removeFiles (const fileName &baseName) |
| Remove existing PROSTAR files for the given base file-name. | |
| static label | readPoints (IFstream &is, List< point > &points, List< label > &ids) |
| Read points from a (.vrt) file, return the max prostar id used. | |
| static void | writePoints (Ostream &os, const UList< point > &points, const scalar scaleFactor=1.0) |
| Write header and points to (.vrt) file, optionally with scaling. | |
| Static Protected Attributes inherited from STARCDCore | |
| static const Map< FixedList< int, 6 > > | starToFoamFaceAddr |
| Face addressing from PROSTAR faces to OpenFOAM faces. | |
| static const Map< FixedList< int, 6 > > | foamToStarFaceAddr |
| Face addressing from OpenFOAM faces to PROSTAR faces. | |
| static const char *const | defaultBoundaryName |
| The name for default (unassigned) boundaries. | |
| static const char *const | defaultSolidBoundaryName |
| The name we have chosen for default (unassigned) solid boundaries. | |
Read PROSTAR vrt/cel/bnd files. The protected data in meshReader are filled.
Starting with PROSTAR version 4, the files have become easier to read.
Notes
Definition at line 64 of file STARCDMeshReader.H.
| STARCDMeshReader | ( | const fileName & | prefix, |
| const objectRegistry & | registry, | ||
| const scalar | scaleFactor = 1.0, | ||
| const bool | keepSolids = false ) |
Construct from case name.
Definition at line 1032 of file STARCDMeshReader.C.
References cellShapes_, mapToFoamCellId_, mapToFoamPointId_, and readAux().

|
virtualdefault |
Destructor.
|
protectedvirtual |
Read the mesh from the file(s).
Implements meshReader.
Definition at line 1009 of file STARCDMeshReader.C.
References STARCDCore::BND_FILE, STARCDCore::CEL_FILE, cullPoints(), meshReader::geometryFile_, readBoundary(), readCells(), readPoints(), STARCDCore::starFileName(), and STARCDCore::VRT_FILE.

|
protected |
Read points from file, return the max prostar id used.
Original Point number for a given vertex
might need again in the future // labelList origPointId(nPoints); // origPointId = -1;
Definition at line 77 of file STARCDMeshReader.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, IOstream::good(), STARCDCore::HEADER_VRT, Foam::Info, token::isLabel(), token::labelToken(), mapToFoamPointId_, Foam::max(), Foam::nl, nPoints, meshReader::points_, ISstream::read(), STARCDCore::readHeader(), x, and y.
Referenced by readGeometry().


|
protectedvirtual |
Read cell connectivities from file.
Definition at line 213 of file STARCDMeshReader.C.
References Foam::abort(), meshReader::baffleFaces_, meshReader::cellFaces_, cellShapes_, meshReader::cellTable_, meshReader::cellTableId_, Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, IOstream::good(), STARCDCore::HEADER_CEL, cellModel::HEX, Foam::Info, token::isLabel(), token::labelToken(), mapToFoamCellId_, mapToFoamPointId_, Foam::max(), n, Foam::nl, meshReader::origCellId_, cellModel::PRISM, cellModel::ptr(), cellModel::PYR, ISstream::read(), STARCDCore::readHeader(), Foam::readToNewline(), cellModel::ref(), List< T >::setSize(), UList< T >::size(), STARCDCore::starcdBaffleType, STARCDCore::starcdFluidType, STARCDCore::starcdHex, STARCDCore::starcdPoly, STARCDCore::starcdPrism, STARCDCore::starcdPyr, STARCDCore::starcdShellType, STARCDCore::starcdSolidType, STARCDCore::starcdTet, cellModel::TET, and cellModel::UNKNOWN.
Referenced by readGeometry().


|
protected |
Remove unused points.
Definition at line 950 of file STARCDMeshReader.C.
References meshReader::baffleFaces_, meshReader::cellFaces_, Foam::endl(), f(), forAll, Foam::Info, Foam::inplaceRenumber(), Foam::inplaceReorder(), nPoints, and meshReader::points_.
Referenced by readGeometry().


|
protected |
Read boundary (cell/face) definitions.
Definition at line 603 of file STARCDMeshReader.C.
References meshReader::boundaryIds_, boundaryRegion_, cellId, cellShapes_, STARCDCore::defaultBoundaryName, dict, Foam::endl(), forAll, HashTable< T, Key, Hash >::found(), IOstream::good(), STARCDCore::HEADER_BND, cellModel::HEX, Foam::identity(), cellModel::index(), Foam::Info, Foam::stringOps::inplaceLower(), Foam::inplaceReorder(), token::isLabel(), mapToFoamCellId_, Foam::max(), name, nPatches, meshReader::patchNames_, meshReader::patchPhysicalTypes_, meshReader::patchTypes_, cellModel::PRISM, cellModel::PYR, ISstream::read(), STARCDCore::readHeader(), cellModel::ref(), List< T >::setSize(), UList< T >::size(), Foam::sortedOrder(), STARCDCore::starcdHex, STARCDCore::starcdPrism, STARCDCore::starcdPyr, STARCDCore::starcdTet, STARCDCore::starToFoamFaceAddr, cellModel::TET, and Foam::Zero.
Referenced by readGeometry().


|
protected |
Read auxiliary data from constant/{boundaryRegion,cellTable}.
Definition at line 54 of file STARCDMeshReader.C.
References boundaryRegion_, and meshReader::cellTable_.
Referenced by STARCDMeshReader().

|
protected |
Cell shapes.
Definition at line 84 of file STARCDMeshReader.H.
Referenced by readBoundary(), readCells(), and STARCDMeshReader().
|
protected |
Point labels (imported Point numbering not necessarily contiguous).
Definition at line 89 of file STARCDMeshReader.H.
Referenced by readCells(), readPoints(), and STARCDMeshReader().
|
protected |
Cell labels (imported Cell numbering not necessarily contiguous).
Definition at line 94 of file STARCDMeshReader.H.
Referenced by readBoundary(), readCells(), and STARCDMeshReader().
|
protected |
Boundary region data.
Definition at line 99 of file STARCDMeshReader.H.
Referenced by readAux(), and readBoundary().