Write OpenFOAM meshes and/or results to CCM format. More...
Public Member Functions | |
writer (const fileName &file, const polyMesh &mesh, const bool backup=true) | |
Open a file for writing, with backup/overwrite existing file. More... | |
~writer () | |
Destructor (closes file) More... | |
void | writeGeometry () |
Write the mesh. More... | |
void | writeSolution (const IOobjectList &objects, const fileName &remappingDictName=fileName::null) |
Write the solutions. 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 Attributes | |
static string | defaultMeshName = "meshExport" |
The name for the topology file reference. 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... | |
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 115 of file ccmWriter.H.
Open a file for writing, with backup/overwrite existing file.
Definition at line 285 of file ccmWriter.C.
References cellModel::HEX, cellModel::index(), cellModel::PRISM, cellModel::PYR, cellModel::ref(), and cellModel::TET.
~writer | ( | ) |
Destructor (closes file)
Definition at line 369 of file ccmWriter.C.
void writeGeometry | ( | ) |
Write the mesh.
Definition at line 710 of file ccmWriterMesh.C.
void writeSolution | ( | const IOobjectList & | objects, |
const fileName & | remappingDictName = fileName::null |
||
) |
Write the solutions.
provide optional remapping dictionary
Definition at line 121 of file ccmWriterSolution.C.
References Foam::endl(), field(), dictionary::findDict(), Foam::flush(), forAll, forAllConstIters(), dictionary::found(), Foam::Info, io(), Foam::name(), IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, patches, IOobjectOption::READ_IF_PRESENT, dictionary::readEntry(), runTime, timeIndex, DimensionedField< Type, GeoMesh >::typeName(), and WarningInFunction.
|
static |
The name for the topology file reference.
Definition at line 238 of file ccmWriter.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.