Write OpenFOAM meshes and/or results to CCM format. More...
#include <ccmWriter.H>


Public Member Functions | |
| writer (const writer &)=delete | |
| No copy construct. | |
| void | operator= (const writer &)=delete |
| No copy assignment. | |
| FOAM_DLL_EXPORT | writer (const fileName &file, const polyMesh &mesh, const bool backup=true) |
| Open a file for writing, with backup/overwrite existing file. | |
| FOAM_DLL_EXPORT | ~writer () |
| Destructor (closes file). | |
| FOAM_DLL_EXPORT void | writeGeometry () |
| Write the mesh. | |
| FOAM_DLL_EXPORT void | writeSolution (const IOobjectList &objects, const fileName &remappingDictName=fileName::null) |
| Write the solutions. | |
| 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 Attributes | |
| static FOAM_DLL_EXPORT string | defaultMeshName = "meshExport" |
| The name for the topology file reference. | |
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. | |
Write OpenFOAM meshes and/or results to CCM format.
The constant/boundaryRegion and constant/cellTable files, which are described in ccmReader, are used to construct the CCM ProblemDescription node.
The constant/remapping file is an IOdictionary that is READ_IF_PRESENT and can be used to remap certain information. eg,
// map OpenFOAM scalar fields to CCM output fields
fields
{
tracer0
{
name CONC_001;
Label "tracer0";
}
tracer1
{
name CONC_002;
Label "tracer1";
}
tracer2
{
name CONC_003;
Label "tracer2";
}
divPhi
{
name CONC_004;
Label "divPhi";
}
// an example with units:
p
{
name P;
Label "Pressure";
units "Pa";
}
}
Definition at line 114 of file ccmWriter.H.
|
delete |
No copy construct.
References writer().
Referenced by operator=(), and writer().


Open a file for writing, with backup/overwrite existing file.
Definition at line 284 of file ccmWriter.C.
References base::base(), cellModel::HEX, cellModel::index(), mesh, cellModel::PRISM, cellModel::PYR, cellModel::ref(), and cellModel::TET.

| ~writer | ( | ) |
Destructor (closes file).
Definition at line 369 of file ccmWriter.C.
References base::close().

|
delete |
No copy assignment.
References FOAM_DLL_EXPORT, mesh, fileName::null, and writer().

| void writeGeometry | ( | ) |
Write the mesh.
Definition at line 710 of file ccmWriterMesh.C.
References base::assertNoError(), and base::globalState_.

| void writeSolution | ( | const IOobjectList & | objects, |
| const fileName & | remappingDictName = fileName::null ) |
Write the solutions.
provide optional remapping dictionary
Definition at line 120 of file ccmWriterSolution.C.
References base::assertNoError(), GeometricField< Type, PatchField, GeoMesh >::component(), defaultMeshName, dictionary, Foam::endl(), field(), dictionary::findDict(), Foam::flush(), forAll, forAllConstIters, dictionary::found(), base::globalState_, Foam::Info, io, Foam::isA(), Foam::name(), IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, patches, IOobjectOption::READ_IF_PRESENT, dictionary::readEntry(), Foam::refCast(), runTime, timeIndex, FieldBase::typeName, and WarningInFunction.

|
static |
The name for the topology file reference.
Definition at line 228 of file ccmWriter.H.
Referenced by writeSolution().