Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
STARCDMeshReader Class Reference

Read PROSTAR vrt/cel/bnd files. The protected data in meshReader are filled. More...

Inheritance diagram for STARCDMeshReader:
Inheritance graph
[legend]
Collaboration diagram for STARCDMeshReader:
Collaboration graph
[legend]

Public Member Functions

 STARCDMeshReader (const fileName &prefix, const objectRegistry &registry, 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< polyMeshmesh (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...
 

Detailed Description

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

Source files

Definition at line 64 of file STARCDMeshReader.H.

Constructor & Destructor Documentation

◆ STARCDMeshReader()

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.

◆ ~STARCDMeshReader()

virtual ~STARCDMeshReader ( )
virtualdefault

Destructor.

Member Function Documentation

◆ readGeometry()

bool readGeometry ( const scalar  scaleFactor = 1.0)
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.

◆ readPoints()

Foam::label readPoints ( const fileName inputName,
const scalar  scaleFactor 
)
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.

Here is the call graph for this function:

◆ readCells()

void readCells ( const fileName inputName)
protectedvirtual

◆ cullPoints()

void cullPoints ( )
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.

Here is the call graph for this function:

◆ readBoundary()

void readBoundary ( const fileName inputName)
protected

◆ readAux()

void readAux ( const objectRegistry registry)
protected

Read auxiliary data from constant/{boundaryRegion,cellTable}.

Definition at line 55 of file STARCDMeshReader.C.

Member Data Documentation

◆ cellShapes_

cellShapeList cellShapes_
protected

Cell shapes.

Definition at line 84 of file STARCDMeshReader.H.

Referenced by STARCDMeshReader::readCells().

◆ mapToFoamPointId_

labelList mapToFoamPointId_
protected

Point labels (imported Point numbering not necessarily contiguous)

Definition at line 89 of file STARCDMeshReader.H.

Referenced by STARCDMeshReader::readCells().

◆ mapToFoamCellId_

labelList mapToFoamCellId_
protected

Cell labels (imported Cell numbering not necessarily contiguous)

Definition at line 94 of file STARCDMeshReader.H.

Referenced by STARCDMeshReader::readCells().

◆ boundaryRegion_

boundaryRegion boundaryRegion_
protected

Boundary region data.

Definition at line 99 of file STARCDMeshReader.H.


The documentation for this class was generated from the following files: