STARCDedgeFormat Class Reference

Read/write the lines from PROSTAR vrt/cel files. More...

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

Public Member Functions

 STARCDedgeFormat (const fileName &filename)
 Construct from file name. More...
 
virtual ~STARCDedgeFormat ()=default
 Destructor. More...
 
virtual bool read (const fileName &name)
 Read from file. More...
 
virtual void write (const fileName &name) const
 Write object. More...
 
- Public Member Functions inherited from edgeMesh
 edgeMesh (const faMesh &mesh)
 
label size () const
 
const edgeVectorFieldC ()
 
 TypeName ("edgeMesh")
 Runtime type information. More...
 
 edgeMesh ()
 Default construct. More...
 
 edgeMesh (const edgeMesh &em)
 Copy construct. More...
 
 edgeMesh (edgeMesh &&em)
 Move construct. More...
 
 edgeMesh (const pointField &points, const edgeList &edges)
 Copy construct from components. More...
 
 edgeMesh (pointField &&pointLst, edgeList &&edgeLst)
 Move construct from components. More...
 
 edgeMesh (const fileName &name)
 Construct from file name (uses extension to determine type) More...
 
 edgeMesh (const fileName &name, const word &fileType)
 Construct from file name with specified type. More...
 
 declareRunTimeSelectionTable (autoPtr, edgeMesh, fileExtension,(const fileName &name),(name))
 
virtual ~edgeMesh ()=default
 Destructor. More...
 
 declareMemberFunctionSelectionTable (void, edgeMesh, write, fileExtension,(const fileName &name, const edgeMesh &mesh),(name, mesh))
 
void transfer (edgeMesh &mesh)
 Transfer the contents of the argument and annul the argument. More...
 
bool read (const fileName &name, const word &fileType)
 Read from file. Chooses reader based on explicit extension. More...
 
const pointFieldpoints () const
 Return points. More...
 
const edgeListedges () const
 Return edges. More...
 
const labelListListpointEdges () const
 Return edges. More...
 
label regions (labelList &edgeRegion) const
 Find connected regions. Set region number per edge. More...
 
virtual void clear ()
 Clear all storage. More...
 
virtual void scalePoints (const scalar scaleFactor)
 Scale points. A non-positive factor is ignored. More...
 
virtual void mergePoints (const scalar mergeDist)
 Geometric merge points (points within mergeDist) prior to. More...
 
virtual void mergeEdges ()
 Merge duplicate edges and eliminate unused points. More...
 
virtual void writeStats (Ostream &) const
 
virtual void write (const fileName &name, const word &fileType) const
 Generic write routine. Chooses writer based on extension. More...
 
void operator= (const edgeMesh &rhs)
 Copy assignment. More...
 
void operator= (edgeMesh &&rhs)
 Move assignment. More...
 
- Public Member Functions inherited from GeoMesh< faMesh >
 GeoMesh (const faMesh &mesh)
 Construct from MESH. More...
 
bool hasDb () const
 Return true if thisDb() is a valid DB - here = false. More...
 
const objectRegistrythisDb () const
 Return the object registry. More...
 
const faMeshoperator() () const
 Return reference to polyMesh. More...
 

Static Public Member Functions

static autoPtr< edgeMeshNew (const fileName &name)
 Read file and return edgeMesh. More...
 
static void write (const fileName &name, const edgeMesh &mesh)
 Write edge mesh. More...
 
- Static Public Member Functions inherited from edgeMesh
static label size (const Mesh &mesh)
 
static wordHashSet readTypes ()
 Summary of supported read file types. More...
 
static wordHashSet writeTypes ()
 Summary of supported write file types. More...
 
static bool canReadType (const word &fileType, bool verbose=false)
 Can we read this file format? More...
 
static bool canWriteType (const word &fileType, bool verbose=false)
 Can we write this file format type? More...
 
static bool canRead (const fileName &name, bool verbose=false)
 Can we read this file format? More...
 
static autoPtr< edgeMeshNew (const fileName &name, const word &fileType)
 Read construct from filename with given format. More...
 
static autoPtr< edgeMeshNew (const fileName &name)
 Select constructed from filename (implicit extension) More...
 
static void write (const fileName &name, const edgeMesh &mesh)
 Write to file (format implicit in the extension) More...
 
static void write (const fileName &name, const word &fileType, const edgeMesh &mesh)
 Write to file, with given format. More...
 

Static Protected Member Functions

static void writeCase (Ostream &os, const pointField &pointLst, const label nEdges)
 
- 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...
 

Additional Inherited Members

- Public Types inherited from GeoMesh< faMesh >
typedef faMesh Mesh
 
typedef faMesh ::BoundaryMesh BoundaryMesh
 
- 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...
 
- Protected Member Functions inherited from edgeMesh
pointFieldstoredPoints ()
 Non-const access to global points. More...
 
edgeListstoredEdges ()
 Non-const access to the edges. More...
 
- Protected Member Functions inherited from STARCDCore
 STARCDCore ()=default
 Construct null. More...
 
- Protected Attributes inherited from GeoMesh< faMesh >
const faMeshmesh_
 Reference to Mesh. 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/write the lines from PROSTAR vrt/cel files.

Note
Uses the extension .inp (input) to denote the format.
See also
Foam::meshReaders::STARCD
Source files

Definition at line 63 of file STARCDedgeFormat.H.

Constructor & Destructor Documentation

◆ STARCDedgeFormat()

STARCDedgeFormat ( const fileName filename)
explicit

Construct from file name.

Definition at line 101 of file STARCDedgeFormat.C.

References Foam::read().

Here is the call graph for this function:

◆ ~STARCDedgeFormat()

virtual ~STARCDedgeFormat ( )
virtualdefault

Destructor.

Member Function Documentation

◆ writeCase()

void writeCase ( Ostream os,
const pointField pointLst,
const label  nEdges 
)
staticprotected

Definition at line 67 of file STARCDedgeFormat.C.

References clock::dateTime(), Ostream::flush(), IOstream::name(), fileName::nameLessExt(), and Foam::nl.

Here is the call graph for this function:

◆ New()

static autoPtr<edgeMesh> New ( const fileName name)
inlinestatic

Read file and return edgeMesh.

Definition at line 103 of file STARCDedgeFormat.H.

References Foam::name().

Here is the call graph for this function:

◆ write() [1/2]

void write ( const fileName name,
const edgeMesh mesh 
)
static

Write edge mesh.

Definition at line 236 of file STARCDedgeFormat.C.

References STARCDCore::CEL_FILE, STARCDCore::INP_FILE, fileName::lessExt(), mesh, and STARCDCore::VRT_FILE.

Referenced by STARCDedgeFormat::write().

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

◆ read()

bool read ( const fileName name)
virtual

◆ write() [2/2]

virtual void write ( const fileName name) const
inlinevirtual

Write object.

Reimplemented from edgeMesh.

Definition at line 122 of file STARCDedgeFormat.H.

References Foam::name(), and STARCDedgeFormat::write().

Here is the call graph for this function:

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