Reads CCM files as written by PROSTAR/STARCCM. More...
#include <ccmReader.H>


Classes | |
| class | options |
Public Member Functions | |
| FOAM_DLL_EXPORT | reader (const fileName &file, const reader::options &opts) |
| Open a file for reading. | |
| FOAM_DLL_EXPORT | ~reader () |
| Destructor (closes file). | |
| FOAM_DLL_EXPORT const reader::options & | option () const |
| Reference to the reader options. | |
| FOAM_DLL_EXPORT autoPtr< polyMesh > | mesh (const objectRegistry ®istry, const fileName &remappingDictName=fileName::null) |
| Construct the polyMesh from the read geometry. | |
| FOAM_DLL_EXPORT bool | hasGeometry () |
| Return true if file has geometry associated with it. | |
| FOAM_DLL_EXPORT bool | hasSolution () |
| Return true if file has solutions associated with it. | |
| FOAM_DLL_EXPORT bool | remapMeshInfo (const objectRegistry ®istry, const fileName &remappingDictName=fileName::null) |
| Remap cellTable and boundaryRegion according to dictionary. | |
| FOAM_DLL_EXPORT void | writeMesh (const polyMesh &mesh, IOstreamOption streamOpt=IOstreamOption(IOstreamOption::BINARY)) const |
| Write the polyMesh. | |
| FOAM_DLL_EXPORT void | writeAux (const objectRegistry ®istry) const |
| Write cellTable, boundaryRegion and interface information. | |
| FOAM_DLL_EXPORT bool | readGeometry (const scalar scaleFactor=1.0) |
| Detect and read geometry if possible. | |
| FOAM_DLL_EXPORT void | printInfo () const |
| Print general information about the mesh. | |
| FOAM_DLL_EXPORT void | clearGeom () |
| Clear out some information after obtaining a polyMesh. | |
| const labelList & | origCellId () const noexcept |
| Map to original cell Id. | |
| const labelList & | origFaceId () const noexcept |
| Map to original face Id. | |
| const interfaceDefinitions & | interfaceDefinitionsInfo () const noexcept |
| Return interface definitions map. | |
| const boundaryRegion & | boundaryTableInfo () const noexcept |
| Return boundaryRegion table. | |
| const cellTable & | cellTableInfo () const noexcept |
| Return cell table. | |
| Map< word > | fluids () const |
| Return a list of names corresponding to fluids. | |
| Map< word > | solids () const |
| Return a list of names corresponding to solids. | |
| const solutionTable & | solutions () |
| Return table of available solutions. | |
| const fieldTable & | fields () |
| Return table of available fields. | |
| const fieldTable & | lagrangian () |
| Return table of available lagrangian fields. | |
| FOAM_DLL_EXPORT tmp< scalarField > | readField (const word &solutionName, const word &fieldName, const bool wallData=false) |
| Read solution and field combination. | |
| Public Member Functions inherited from base | |
| base (const base &)=delete | |
| No copy construct. | |
| void | operator= (const base &)=delete |
| No copy assignment. | |
| base () | |
| Default construct. Initializes the global-state. | |
| ~base () | |
| Destructor: close file. | |
| bool | close () |
| Explicitly close the file and terminate ccmio access. | |
Static Public Member Functions | |
| static FOAM_DLL_EXPORT void | warnDuplicates (const word &context, const wordList &lst) |
| Warn about repeated name. | |
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 | |
| bool | assertNoError (const std::string &msg) const |
| check global state for errors and die as required | |
| Protected Member Functions inherited from STARCDCore | |
| STARCDCore ()=default | |
| Construct null. | |
| Static Protected Member Functions inherited from base | |
| static bool | assertNoError (int err, const char *msg) |
| Die with msg if there is an error. | |
| static bool | assertNoError (int err, const std::string &msg) |
| Die with msg if there is an error. | |
| 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. | |
| Protected Attributes inherited from base | |
| std::unique_ptr< ccmGlobalState > | globalState_ |
| Maintain overall global states (error, root-node). | |
| 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. | |
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 643 of file ccmReader.C.
References base::assertNoError(), base::base(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, base::globalState_, Foam::isFile(), and option().

| ~reader | ( | ) |
Destructor (closes file).
Definition at line 685 of file ccmReader.C.
References base::close().

Warn about repeated name.
Definition at line 63 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().
Referenced by mesh().


| const Foam::ccm::reader::options & option | ( | ) | const |
Reference to the reader options.
Definition at line 693 of file ccmReader.C.
Referenced by reader(), and readField().

| 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 2608 of file ccmReaderMesh.C.
References IOobjectOption::AUTO_WRITE, clearGeom(), polyMesh::defaultRegion, mesh(), meshPtr, autoPtr< T >::New(), IOobjectOption::NO_READ, readGeometry(), remapMeshInfo(), and warnDuplicates().
Referenced by mesh(), and writeMesh().


| 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 585 of file ccmReader.C.
References dictionary, DLListBase::empty(), dictionary::findDict(), IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, and IOobjectOption::READ_IF_PRESENT.
Referenced by mesh().


| void writeMesh | ( | const polyMesh & | mesh, |
| IOstreamOption | streamOpt = IOstreamOption(IOstreamOption::BINARY) ) const |
Write the polyMesh.
Definition at line 571 of file ccmReader.C.
References Foam::endl(), Foam::Info, mesh(), and writeAux().

| void writeAux | ( | const objectRegistry & | registry | ) | const |
Write cellTable, boundaryRegion and interface information.
Definition at line 175 of file ccmReaderAux.C.
References IOstreamOption::ASCII, and IOstreamOption::BINARY.
Referenced by writeMesh().

| bool readGeometry | ( | const scalar | scaleFactor = 1.0 | ) |
Detect and read geometry if possible.
Definition at line 528 of file ccmReader.C.
Referenced by mesh().

| 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.
Referenced by mesh().

|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Return interface definitions map.
Definition at line 687 of file ccmReader.H.
References Foam::noexcept.
|
inlinenoexcept |
|
inlinenoexcept |
Return a list of names corresponding to fluids.
Definition at line 711 of file ccmReader.H.
Return a list of names corresponding to solids.
Definition at line 719 of file ccmReader.H.
|
inline |
Return table of available solutions.
Definition at line 727 of file ccmReader.H.
|
inline |
Return table of available fields.
Definition at line 736 of file ccmReader.H.
|
inline |
Return table of available lagrangian fields.
Definition at line 745 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 352 of file ccmReaderSolution.C.
References base::assertNoError(), cellId, UList< T >::data(), forAll, base::globalState_, n, tmp< T >::New(), option(), and List< T >::setSize().
