Reads CCM files as written by PROSTAR/STARCCM. More...
Classes | |
class | options |
Public Member Functions | |
reader (const fileName &file, const reader::options &opts) | |
Open a file for reading. More... | |
~reader () | |
Destructor (closes file) More... | |
const reader::options & | option () const |
Reference to the reader options. More... | |
autoPtr< polyMesh > | mesh (const objectRegistry ®istry, const fileName &remappingDictName=fileName::null) |
Construct the polyMesh from the read geometry. More... | |
bool | hasGeometry () |
Return true if file has geometry associated with it. More... | |
bool | hasSolution () |
Return true if file has solutions associated with it. More... | |
bool | remapMeshInfo (const objectRegistry ®istry, const fileName &remappingDictName=fileName::null) |
Remap cellTable and boundaryRegion according to dictionary. More... | |
void | writeMesh (const polyMesh &mesh, IOstreamOption streamOpt=IOstreamOption(IOstreamOption::BINARY)) const |
Write the polyMesh. More... | |
void | writeAux (const objectRegistry ®istry) const |
Write cellTable, boundaryRegion and interface information. More... | |
bool | readGeometry (const scalar scaleFactor=1.0) |
Detect and read geometry if possible. More... | |
void | printInfo () const |
Print general information about the mesh. More... | |
void | clearGeom () |
Clear out some information after obtaining a polyMesh. More... | |
const labelList & | origCellId () const |
Map to original cell Id. More... | |
const labelList & | origFaceId () const |
Map to original face Id. More... | |
const interfaceDefinitions & | interfaceDefinitionsInfo () const |
Return interface definitions map. More... | |
const boundaryRegion & | boundaryTableInfo () const |
Return boundaryRegion table. More... | |
const cellTable & | cellTableInfo () const |
Return cell table. More... | |
Map< word > | fluids () const |
Return a list of names corresponding to fluids. More... | |
Map< word > | solids () const |
Return a list of names corresponding to solids. More... | |
const solutionTable & | solutions () |
Return table of available solutions. More... | |
const fieldTable & | fields () |
Return table of available fields. More... | |
const fieldTable & | lagrangian () |
Return table of available lagrangian fields. More... | |
tmp< scalarField > | readField (const word &solutionName, const word &fieldName, const bool wallData=false) |
Read solution and field combination. More... | |
Public Member Functions inherited from base | |
base () | |
Default construct. Initializes the global-state. More... | |
~base () | |
Destructor: close file. More... | |
bool | close () |
Explicitly close the file and terminate ccmio access. More... | |
Static Public Member Functions | |
static void | warnDuplicates (const word &context, const wordList &lst) |
Warn about repeated name. More... | |
Additional Inherited Members | |
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 base | |
bool | assertNoError (const char *msg) const |
check global state for errors and die as required More... | |
bool | assertNoError (const std::string &msg) const |
check global state for errors and die as required More... | |
base (const base &)=delete | |
No copy construct. More... | |
void | operator= (const base &)=delete |
No copy assignment. More... | |
Protected Member Functions inherited from STARCDCore | |
STARCDCore ()=default | |
Construct null. More... | |
Static Protected Member Functions inherited from base | |
static bool | assertNoError (int err, const char *msg) |
Die with msg if there is an error. More... | |
static bool | assertNoError (int err, const std::string &msg) |
Die with msg if there is an error. 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... | |
Protected Attributes inherited from base | |
std::unique_ptr< ccmGlobalState > | globalState_ |
Maintain overall global states (error, root-node) 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... | |
Reads CCM files as written by PROSTAR/STARCCM.
The Default_Boundary_Region (region 0) is a special region that serves two purposes:
The CCM node Meshes/FaceBasedTopology/Cells/Interfaces
holds the mapping of the corresponding mesh faces, which can be used to merge these internal boundaries.
If solid cells exist, there are three possible courses of action:
The constant/remapping
file is an IOdictionary
that is READ_IF_PRESENT
and can be used to remap certain information. eg,
// rename/combine cellTable entries // newName ( listOldNames ); cellTable { fluid ( inletRegion outletRegion ); cat1 ( CAT1 "cat1_(Back|Front|Gamma)" ); } // rename boundary regions // newName oldName; boundaryRegion { inlet_4 inlet_1; inlet_5 inlet_2; inlet_6 inlet_3; }
The constant/boundaryRegion
file is an IOMap<dictionary>
that is written. It contains the boundary type and names. eg,
( 0 { BoundaryType wall; Label Default_Boundary_Region; } 1 { BoundaryType inlet; Label inlet_1; } ... 4 { BoundaryType pressure; Label outlet; } )
The constant/cellTable
file is an IOMap<dictionary>
that is written. It contains the cellTable information. eg,
( 1 { Label inletRegion; MaterialType fluid; MaterialId 1; } 2 { Label cat1; MaterialType fluid; MaterialId 1; PorosityId 1; } 3 { Label outletRegion; MaterialType fluid; MaterialId 1; } )
Definition at line 179 of file ccmReader.H.
reader | ( | const fileName & | file, |
const reader::options & | opts | ||
) |
Open a file for reading.
Definition at line 644 of file ccmReader.C.
References base::assertNoError(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, base::globalState_, Foam::isFile(), and reader::option().
~reader | ( | ) |
Destructor (closes file)
Definition at line 703 of file ccmReader.C.
Warn about repeated name.
Definition at line 64 of file ccmReaderAux.C.
References Foam::endl(), HashTable< T, Key, Hash >::find(), forAllConstIters(), Foam::Info, HashTable< T, Key, Hash >::insert(), Foam::nl, and UList< T >::size().
const Foam::ccm::reader::options & option | ( | ) | const |
Reference to the reader options.
Definition at line 711 of file ccmReader.C.
Referenced by reader::reader().
Foam::autoPtr< Foam::polyMesh > mesh | ( | const objectRegistry & | registry, |
const fileName & | remappingDictName = fileName::null |
||
) |
Construct the polyMesh from the read geometry.
provide optional remapping dictionary
Definition at line 2609 of file ccmReaderMesh.C.
References IOobjectOption::AUTO_WRITE, polyMesh::defaultRegion, mesh, meshPtr, autoPtr< T >::New(), and IOobjectOption::NO_READ.
bool hasGeometry | ( | ) |
Return true if file has geometry associated with it.
Definition at line 557 of file ccmReader.C.
bool hasSolution | ( | ) |
Return true if file has solutions associated with it.
Definition at line 564 of file ccmReader.C.
bool remapMeshInfo | ( | const objectRegistry & | registry, |
const fileName & | remappingDictName = fileName::null |
||
) |
Remap cellTable and boundaryRegion according to dictionary.
Definition at line 586 of file ccmReader.C.
References dictionary::findDict(), IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, and IOobjectOption::READ_IF_PRESENT.
void writeMesh | ( | const polyMesh & | mesh, |
IOstreamOption | streamOpt = IOstreamOption(IOstreamOption::BINARY) |
||
) | const |
Write the polyMesh.
Definition at line 572 of file ccmReader.C.
References Foam::endl(), Foam::Info, and mesh.
void writeAux | ( | const objectRegistry & | registry | ) | const |
Write cellTable, boundaryRegion and interface information.
Definition at line 176 of file ccmReaderAux.C.
References IOstreamOption::ASCII, and IOstreamOption::BINARY.
bool readGeometry | ( | const scalar | scaleFactor = 1.0 | ) |
Detect and read geometry if possible.
Definition at line 529 of file ccmReader.C.
void printInfo | ( | ) | const |
Print general information about the mesh.
Definition at line 515 of file ccmReader.C.
References Foam::endl(), Foam::Info, and Foam::nl.
void clearGeom | ( | ) |
Clear out some information after obtaining a polyMesh.
Definition at line 2588 of file ccmReaderMesh.C.
|
inline |
Map to original cell Id.
Definition at line 659 of file ccmReader.H.
|
inline |
Map to original face Id.
Definition at line 667 of file ccmReader.H.
|
inline |
Return interface definitions map.
Definition at line 675 of file ccmReader.H.
|
inline |
Return boundaryRegion table.
Definition at line 683 of file ccmReader.H.
|
inline |
Return cell table.
Definition at line 691 of file ccmReader.H.
Return a list of names corresponding to fluids.
Definition at line 699 of file ccmReader.H.
References cellTable::fluids().
Return a list of names corresponding to solids.
Definition at line 707 of file ccmReader.H.
References cellTable::solids().
|
inline |
Return table of available solutions.
Definition at line 715 of file ccmReader.H.
|
inline |
Return table of available fields.
Definition at line 724 of file ccmReader.H.
|
inline |
Return table of available lagrangian fields.
Definition at line 733 of file ccmReader.H.
Foam::tmp< Foam::scalarField > readField | ( | const word & | solutionName, |
const word & | fieldName, | ||
const bool | wallData = false |
||
) |
Read solution and field combination.
Definition at line 350 of file ccmReaderSolution.C.
References cellId, UList< T >::data(), forAll, n, tmp< T >::New(), tmp< T >::ref(), and List< T >::setSize().