Read PROSTAR vrt/cel/bnd files. The protected data in meshReader are filled. More...
Public Member Functions | |
STARCDMeshReader (const fileName &prefix, const objectRegistry ®istry, const scalar scaleFactor=1.0, const bool keepSolids=false) | |
Construct from case name. More... | |
virtual | ~STARCDMeshReader ()=default |
Destructor. More... | |
Public Member Functions inherited from meshReader | |
meshReader (const fileName &, const scalar scaling=1.0) | |
Construct from fileName. More... | |
virtual | ~meshReader ()=default |
Destructor. More... | |
virtual autoPtr< polyMesh > | mesh (const objectRegistry &) |
Create and return polyMesh. More... | |
void | writeAux (const objectRegistry &) const |
Write auxiliary information. More... | |
void | writeMesh (const polyMesh &, IOstreamOption streamOpt=IOstreamOption(IOstreamOption::BINARY)) const |
Write mesh. More... | |
Protected Member Functions | |
virtual bool | readGeometry (const scalar scaleFactor=1.0) |
Read the mesh from the file(s) More... | |
label | readPoints (const fileName &, const scalar scaleFactor) |
Read points from file, return the max prostar id used. More... | |
virtual void | readCells (const fileName &) |
Read cell connectivities from file. More... | |
void | cullPoints () |
Remove unused points. More... | |
void | readBoundary (const fileName &) |
Read boundary (cell/face) definitions. More... | |
void | readAux (const objectRegistry &) |
Read auxiliary data from constant/{boundaryRegion,cellTable}. More... | |
Protected Member Functions inherited from STARCDCore | |
STARCDCore ()=default | |
Construct null. More... | |
Protected Attributes | |
cellShapeList | cellShapes_ |
Cell shapes. More... | |
labelList | mapToFoamPointId_ |
Point labels (imported Point numbering not necessarily contiguous) More... | |
labelList | mapToFoamCellId_ |
Cell labels (imported Cell numbering not necessarily contiguous) More... | |
boundaryRegion | boundaryRegion_ |
Boundary region data. More... | |
Protected Attributes inherited from meshReader | |
fileName | geometryFile_ |
Referenced filename. More... | |
scalar | scaleFactor_ |
Geometry scaling. More... | |
pointField | points_ |
Points supporting the mesh. More... | |
labelList | origCellId_ |
Lookup original Cell number for a given cell. More... | |
List< List< cellFaceIdentifier > > | boundaryIds_ |
Identify boundary faces by cells and their faces. More... | |
wordList | patchTypes_ |
Boundary patch types. More... | |
wordList | patchNames_ |
Boundary patch names. More... | |
wordList | patchPhysicalTypes_ |
Boundary patch physical types. More... | |
labelList | patchStarts_ |
Polyhedral mesh boundary patch start indices and dimensions. More... | |
labelList | patchSizes_ |
label | nInternalFaces_ |
Number of internal faces for polyMesh. More... | |
faceList | meshFaces_ |
Global face list for polyMesh. More... | |
faceListList | cellFaces_ |
List of faces for every cell. More... | |
faceList | baffleFaces_ |
List of each baffle face. More... | |
labelList | cellTableId_ |
Cell table id for each cell. More... | |
cellTable | cellTable_ |
Cell table persistent data saved as a dictionary. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from meshReader | |
static void | warnDuplicates (const word &context, const wordList &) |
Warn about repeated names. More... | |
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) More... | |
static void | writeHeader (Ostream &os, const enum fileHeader header) |
Write header for fileType (CELL|VERTEX|BOUNDARY) More... | |
static fileName | starFileName (const fileName &baseName, const enum fileExt ext) |
Resolve base file-name for the given file-type. More... | |
static void | removeFiles (const fileName &baseName) |
Remove existing PROSTAR files for the given base file-name. More... | |
static label | readPoints (IFstream &is, List< point > &points, List< label > &ids) |
Read points from a (.vrt) file, return the max prostar id used. More... | |
static void | writePoints (Ostream &os, const UList< point > &points, const scalar scaleFactor=1.0) |
Write header and points to (.vrt) file, optionally with scaling. More... | |
Static Protected Attributes inherited from STARCDCore | |
static const Map< FixedList< int, 6 > > | starToFoamFaceAddr |
Face addressing from PROSTAR faces to OpenFOAM faces. More... | |
static const Map< FixedList< int, 6 > > | foamToStarFaceAddr |
Face addressing from OpenFOAM faces to PROSTAR faces. More... | |
static const char *const | defaultBoundaryName |
The name for default (unassigned) boundaries. More... | |
static const char *const | defaultSolidBoundaryName |
The name we have chosen for default (unassigned) solid boundaries. More... | |
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 1033 of file STARCDMeshReader.C.
|
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, 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 78 of file STARCDMeshReader.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, IOstream::good(), Foam::Info, token::isLabel(), token::labelToken(), Foam::max(), Foam::nl, nPoints, ISstream::read(), x, and y.
|
protectedvirtual |
Read cell connectivities from file.
Definition at line 213 of file STARCDMeshReader.C.
References Foam::abort(), meshReader::baffleFaces_, meshReader::cellFaces_, STARCDMeshReader::cellShapes_, meshReader::cellTable_, meshReader::cellTableId_, List< T >::clear(), Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, HashTable< T, Key, Hash >::found(), IOstream::good(), STARCDCore::HEADER_CEL, cellModel::HEX, Foam::Info, token::isLabel(), token::labelToken(), STARCDMeshReader::mapToFoamCellId_, STARCDMeshReader::mapToFoamPointId_, Foam::max(), n, Foam::nl, meshReader::origCellId_, cellModel::PRISM, cellModel::ptr(), cellModel::PYR, ISstream::read(), STARCDCore::readHeader(), Foam::readToNewline(), cellModel::ref(), cellTable::setMaterial(), cellTable::setName(), 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.
|
protected |
Remove unused points.
Definition at line 950 of file STARCDMeshReader.C.
References Foam::endl(), f(), forAll, Foam::Info, Foam::inplaceRenumber(), Foam::inplaceReorder(), and nPoints.
|
protected |
Read boundary (cell/face) definitions.
Definition at line 604 of file STARCDMeshReader.C.
References cellId, 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(), Foam::max(), Foam::name(), nPatches, cellModel::PRISM, cellModel::PYR, ISstream::read(), 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.
|
protected |
Read auxiliary data from constant/{boundaryRegion,cellTable}.
Definition at line 55 of file STARCDMeshReader.C.
|
protected |
Cell shapes.
Definition at line 84 of file STARCDMeshReader.H.
Referenced by STARCDMeshReader::readCells().
|
protected |
Point labels (imported Point numbering not necessarily contiguous)
Definition at line 89 of file STARCDMeshReader.H.
Referenced by STARCDMeshReader::readCells().
|
protected |
Cell labels (imported Cell numbering not necessarily contiguous)
Definition at line 94 of file STARCDMeshReader.H.
Referenced by STARCDMeshReader::readCells().
|
protected |
Boundary region data.
Definition at line 99 of file STARCDMeshReader.H.