STARCDCore Class Reference

Core routines used when reading/writing PROSTAR vrt/cel/bnd files. More...

Inheritance diagram for STARCDCore:
[legend]
Collaboration diagram for STARCDCore:
[legend]

Public Types

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 Public Member Functions

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 Public Attributes

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...
 

Protected Member Functions

 STARCDCore ()=default
 Construct null. More...
 

Static Protected Member Functions

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 Protected Attributes

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...
 

Detailed Description

Core routines used when reading/writing PROSTAR vrt/cel/bnd files.

Source files

Definition at line 59 of file STARCDCore.H.

Member Enumeration Documentation

◆ fileHeader

enum fileHeader

Enumeration defining the file headers.

Enumerator
HEADER_CEL 
HEADER_VRT 
HEADER_BND 

Definition at line 66 of file STARCDCore.H.

◆ fileExt

enum fileExt

Enumeration defining the file extensions.

Enumerator
CEL_FILE 
VRT_FILE 
BND_FILE 
INP_FILE 

Definition at line 74 of file STARCDCore.H.

◆ matlType

enum matlType

Basic material type for STARCD/PROSTAR files.

Enumerator
starcdFluidType 
starcdSolidType 
starcdBaffleType 
starcdShellType 
starcdLineType 
starcdPointType 

Definition at line 83 of file STARCDCore.H.

◆ shapeType

enum shapeType

Shape-Type for STARCD/PROSTAR files.

Enumerator
starcdPoint 
starcdLine 
starcdShell 
starcdHex 
starcdPrism 
starcdTet 
starcdPyr 
starcdPoly 

Definition at line 94 of file STARCDCore.H.

Constructor & Destructor Documentation

◆ STARCDCore()

STARCDCore ( )
protecteddefault

Construct null.

Member Function Documentation

◆ readHeader()

bool readHeader ( IFstream is,
const enum fileHeader  header 
)
staticprotected

Read header and check signature PROSTAR_(CELL|VERTEX|BOUNDARY)

Definition at line 121 of file STARCDCore.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, IOstream::good(), Foam::Info, IFstream::name(), Foam::nl, and Foam::readToNewline().

Here is the call graph for this function:

◆ writeHeader()

void writeHeader ( Ostream os,
const enum fileHeader  header 
)
staticprotected

Write header for fileType (CELL|VERTEX|BOUNDARY)

Definition at line 155 of file STARCDCore.C.

References Foam::nl, os(), and STARCDCore::writeHeader().

Referenced by STARCDCore::writeHeader().

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

◆ starFileName()

Foam::fileName starFileName ( const fileName baseName,
const enum fileExt  ext 
)
static

Resolve base file-name for the given file-type.

Definition at line 176 of file STARCDCore.C.

◆ removeFiles()

void removeFiles ( const fileName baseName)
static

Remove existing PROSTAR files for the given base file-name.

Definition at line 186 of file STARCDCore.C.

References Foam::rm().

Here is the call graph for this function:

◆ readPoints()

Foam::label readPoints ( IFstream is,
List< point > &  points,
List< label > &  ids 
)
static

Read points from a (.vrt) file, return the max prostar id used.

The file format is as follows:

Line 1:
PROSTAR_VERTEX  newline

Line 2:
{version} 0 0 0 0 0 0 0  newline

Body:
{vertexId}  {x}  {y}  {z}  newline

Definition at line 195 of file STARCDCore.C.

References DynamicList< T, SizeMin >::append(), DynamicList< T, SizeMin >::clear(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, IOstream::good(), token::isLabel(), token::labelToken(), Foam::max(), IFstream::name(), points, ISstream::read(), List< T >::transfer(), x, and y.

Here is the call graph for this function:

◆ writePoints()

void writePoints ( Ostream os,
const UList< point > &  points,
const scalar  scaleFactor = 1.0 
)
static

Write header and points to (.vrt) file, optionally with scaling.

Definition at line 244 of file STARCDCore.C.

References Foam::nl, os(), p, points, Foam::writeHeader(), and STARCDCore::writePoints().

Referenced by STARCDCore::writePoints().

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

Member Data Documentation

◆ defaultBoundaryName

const char *const defaultBoundaryName
static
Initial value:
=
"Default_Boundary_Region"

The name for default (unassigned) boundaries.

Definition at line 108 of file STARCDCore.H.

◆ defaultSolidBoundaryName

const char *const defaultSolidBoundaryName
static
Initial value:
=
"Default_Boundary_Solid"

The name we have chosen for default (unassigned) solid boundaries.

Slightly distinguished from the regular default name.

Definition at line 112 of file STARCDCore.H.

◆ starToFoamFaceAddr

const Foam::Map< Foam::FixedList< int, 6 > > starToFoamFaceAddr
staticprotected
Initial value:
=
{
{ starcdHex, { 4, 5, 2, 3, 0, 1 } },
{ starcdPrism, { 0, 1, 4, -1, 2, 3 } },
{ starcdTet, { 3, -1, 2, -1, 1, 0 } },
{ starcdPyr, { 0, -1, 4, 2, 1, 3 } }
}

Face addressing from PROSTAR faces to OpenFOAM faces.

For hex, prism, tet, pyr primitive shapes.

Definition at line 129 of file STARCDCore.H.

Referenced by STARCDMeshReader::readBoundary().

◆ foamToStarFaceAddr

const Foam::Map< Foam::FixedList< int, 6 > > foamToStarFaceAddr
staticprotected
Initial value:
=
{
{ starcdHex, { 4, 5, 2, 3, 0, 1 } },
{ starcdPrism, { 0, 1, 4, 5, 2, -1 } },
{ starcdTet, { 5, 4, 2, 0, -1, -1 } },
{ starcdPyr, { 0, 4, 3, 5, 2, -1 } }
}

Face addressing from OpenFOAM faces to PROSTAR faces.

For hex, prism, tet, pyr primitive shapes.

Definition at line 133 of file STARCDCore.H.


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