Loading...
Searching...
No Matches
STARCDMeshReader Class Reference

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

#include <STARCDMeshReader.H>

Inheritance diagram for STARCDMeshReader:
Collaboration diagram for STARCDMeshReader:

Public Member Functions

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

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.

  • vertices are space-delimited.
  • the cell format is logical.
  • trimmed and degenerate cells are saved as polyhedral.
  • the boundaries corresponds to cells and their faces.

Notes

  • Shell entries are read, yet ignored.
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 1032 of file STARCDMeshReader.C.

References cellShapes_, mapToFoamCellId_, mapToFoamPointId_, and readAux().

Here is the call graph for this function:

◆ ~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, cullPoints(), meshReader::geometryFile_, readBoundary(), readCells(), readPoints(), STARCDCore::starFileName(), and STARCDCore::VRT_FILE.

Here is the call graph for this function:

◆ 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 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readCells()

◆ cullPoints()

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBoundary()

◆ readAux()

void readAux ( const objectRegistry & registry)
protected

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

Definition at line 54 of file STARCDMeshReader.C.

References boundaryRegion_, and meshReader::cellTable_.

Referenced by STARCDMeshReader().

Here is the caller graph for this function:

Member Data Documentation

◆ cellShapes_

cellShapeList cellShapes_
protected

Cell shapes.

Definition at line 84 of file STARCDMeshReader.H.

Referenced by readBoundary(), readCells(), and STARCDMeshReader().

◆ mapToFoamPointId_

labelList mapToFoamPointId_
protected

Point labels (imported Point numbering not necessarily contiguous).

Definition at line 89 of file STARCDMeshReader.H.

Referenced by readCells(), readPoints(), and STARCDMeshReader().

◆ mapToFoamCellId_

labelList mapToFoamCellId_
protected

Cell labels (imported Cell numbering not necessarily contiguous).

Definition at line 94 of file STARCDMeshReader.H.

Referenced by readBoundary(), readCells(), and STARCDMeshReader().

◆ boundaryRegion_

boundaryRegion boundaryRegion_
protected

Boundary region data.

Definition at line 99 of file STARCDMeshReader.H.

Referenced by readAux(), and readBoundary().


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