45 "p { name P; Label \"Pressure\"; units \"Pa\"; }" 50 "rho { name DENS; Label \"Density\"; units \"kg/m3\"; }" 51 "T { name T; Label \"Temperature\"; units \"K\"; }" 52 "k { name TE; Label \"Turb Kinetic Energy\"; units \"m2/s2\"; }" 53 "epsilon { name ED; Label \"Dissipation Rate\"; units \"m2/s3\"; }" 54 "mu { name LAMV; Label \"Molecular Viscosity\"; units \"Pa s\"; }" 55 "mut { name VIS; Label \"Turbulent Viscosity\"; units \"Pa s\"; }" 57 "U { name ALL; Label \"Velocity\"; units \"m/s\"; }" 59 "_0U { name SU; Label \"Velocity Component U\"; units \"m/s\"; }" 60 "_1U { name SV; Label \"Velocity Component V\"; units \"m/s\"; }" 61 "_2U { name SW; Label \"Velocity Component W\"; units \"m/s\"; }" 63 "phi { name MassFlux; Label \"Mass Flux\"; units \"kg/s\"; }" 70 bool Foam::ccm::writer::newFieldNode
72 const ccmID& phaseNode,
73 const word& fieldName,
74 const dictionary& nameMapping,
75 const ccmDimension& dims,
79 const dictionary* subDictPtr = nameMapping.findDict(fieldName);
86 const dictionary&
dict = *subDictPtr;
89 if (!
dict.readIfPresent(
"name", shortName))
94 string ccmLabel(fieldName);
95 dict.readIfPresent(
"Label", ccmLabel);
109 if (dims() == kCCMIOScalar &&
dict.readIfPresent(
"units", units))
135 if (!isA<fvMesh>(mesh_))
138 <<
"cannot write solutions with a polyMesh instead of a fvMesh" 145 if (remappingDictName.empty())
152 mesh_.time().constant(),
163 remapDict = dictionary(IFstream(remappingDictName)());
167 dictionary nameMapping(defaultNameMapping);
170 const dictionary* subDictPtr = remapDict.
findDict(
"fields");
174 nameMapping |= *subDictPtr;
178 ccmID stateNode, processorNode, nodeId;
184 &(globalState_->error),
185 (globalState_->root),
191 assertNoError(
"could not create default state");
210 &(globalState_->error),
216 assertNoError(
"could not create processor node");
222 nullptr, stateNode, processorNode,
235 ccmID verticesNode, topoNode;
238 &(globalState_->error),
239 (globalState_->root),
247 &(globalState_->error),
248 (globalState_->root),
254 string topoFileName = defaultMeshName +
".ccmg";
258 &(globalState_->error),
260 topoFileName.c_str(), &verticesNode,
261 topoFileName.c_str(), &topoNode,
266 assertNoError(
"Error after writing geometry processor");
270 &(globalState_->error),
271 (globalState_->root),
277 assertNoError(
"could not create Restart_1 state");
296 &(globalState_->error),
302 assertNoError(
"could not create 'Processor' node");
308 nullptr, stateNode, processorNode,
317 ccmID phaseNode, fieldSetNode;
326 (globalState_->root),
336 &(globalState_->error),
337 (globalState_->root),
342 assertNoError(
"could not create FieldSet node");
347 ccmID restartInfoNode, restartDataNode;
350 &(globalState_->error),
356 assertNoError(
"could not create restartInfoNode node");
359 const Time&
runTime = mesh_.time();
378 if (
io.typeHeaderOk<IOdictionary>(
true))
384 CCMIOWriteRestartInfo
386 &(globalState_->error),
398 &(globalState_->error),
404 assertNoError(
"could not create restartDataNode node");
418 CCMIONewIndexedEntity
420 &(globalState_->error),
434 "Material Specific Heat",
442 "Material Molecular Weight",
447 CCMIONewIndexedEntity
449 &(globalState_->error),
459 const word fieldName = (*iter()).
name();
460 const word fieldType = (*iter()).headerClassName();
462 if (!nameMapping.found(fieldName))
476 mesh_.time().timeName(),
481 refCast<const fvMesh>(mesh_)
506 &(globalState_->error),
515 &(globalState_->error),
521 field.primitiveField().begin()
526 assertNoError(
"writing internalField " + fieldName);
533 &(globalState_->error),
542 &(globalState_->error),
544 maps_->boundary[patchI],
548 field.boundaryField()[patchI].begin()
555 assertNoError(
"writing boundaryField " + fieldName);
566 mesh_.time().timeName(),
571 refCast<const fvMesh>(mesh_)
585 for (
direction cmpt=0; cmpt < pTraits<vector>::nComponents; ++cmpt)
587 word componentName(
"_" +
Foam::name(cmpt) + fieldName);
590 CCMIOComponent ccmComponent = kCCMIOVectorX;
593 ccmComponent = kCCMIOVectorX;
596 ccmComponent = kCCMIOVectorY;
599 ccmComponent = kCCMIOVectorZ;
620 CCMIOWriteMultiDimensionalFieldData
622 &(globalState_->error),
631 &(globalState_->error),
640 &(globalState_->error),
646 field.primitiveField().begin()
648 kCCMIOStart, kCCMIOEnd
652 "writing internalField " + fieldName +
" " + componentName
661 &(globalState_->error),
670 &(globalState_->error),
672 maps_->boundary[patchI],
676 field.boundaryField()[patchI].begin()
678 kCCMIOStart, kCCMIOEnd
684 "writing boundaryField " + fieldName +
" " + componentName
699 mesh_.time().timeName(),
704 refCast<const fvMesh>(mesh_)
729 &(globalState_->error),
738 &(globalState_->error),
740 maps_->internalFaces,
744 field.primitiveField().cdata()
749 assertNoError(
"writing internalField " + fieldName);
756 &(globalState_->error),
765 &(globalState_->error),
767 maps_->boundary[patchI],
771 field.boundaryField()[patchI].cdata()
778 assertNoError(
"writing boundaryField " + fieldName);
784 assertNoError(
"Error before writing processor");
788 &(globalState_->error),
793 nullptr, &fieldSetNode
795 assertNoError(
"Error after writing processor");
A class for handling file names.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel.
void writeSolution(const IOobjectList &objects, const fileName &remappingDictName=fileName::null)
Write the solutions.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Input/output from string buffers.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ignore writing from objectRegistry::writeObject()
GeometricField< vector, fvPatchField, volMesh > volVectorField
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Reading is optional [identical to LAZY_READ].
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
Internal bits for wrapping libccmio - do not use directly.
const word typeName("volScalarField::Internal")
Ostream & flush(Ostream &os)
Flush stream.
#define WarningInFunction
Report a warning using Foam::Warning.
const polyBoundaryMesh & patches
std::unique_ptr< ccmGlobalState > globalState_
Maintain overall global states (error, root-node)
messageStream Info
Information stream (stdout output on master, null elsewhere)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Defines the attributes of an object for which implicit objectRegistry management is supported...
Do not request registration (bool: false)
forAllConstIters(mixture.phases(), phase)
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and a sub-dictionary) otherwise return nullptr...