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);
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)());
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 IOobject&
io = *iter.val();
461 const word fieldName =
io.name();
462 const word fieldType =
io.headerClassName();
464 if (!nameMapping.found(fieldName))
478 mesh_.time().timeName(),
484 refCast<const fvMesh>(mesh_)
509 &(globalState_->error),
518 &(globalState_->error),
524 field.primitiveField().begin()
529 assertNoError(
"writing internalField " + fieldName);
536 &(globalState_->error),
545 &(globalState_->error),
547 maps_->boundary[patchI],
551 field.boundaryField()[patchI].begin()
558 assertNoError(
"writing boundaryField " + fieldName);
569 mesh_.time().timeName(),
575 refCast<const fvMesh>(mesh_)
591 word componentName(
"_" +
Foam::name(cmpt) + fieldName);
594 CCMIOComponent ccmComponent = kCCMIOVectorX;
598 ccmComponent = kCCMIOVectorX;
601 ccmComponent = kCCMIOVectorY;
604 ccmComponent = kCCMIOVectorZ;
625 CCMIOWriteMultiDimensionalFieldData
627 &(globalState_->error),
636 &(globalState_->error),
645 &(globalState_->error),
651 field.primitiveField().begin()
653 kCCMIOStart, kCCMIOEnd
657 "writing internalField " + fieldName +
" " + componentName
666 &(globalState_->error),
675 &(globalState_->error),
677 maps_->boundary[patchI],
681 field.boundaryField()[patchI].begin()
683 kCCMIOStart, kCCMIOEnd
689 "writing boundaryField " + fieldName +
" " + componentName
704 mesh_.time().timeName(),
710 refCast<const fvMesh>(mesh_)
735 &(globalState_->error),
744 &(globalState_->error),
746 maps_->internalFaces,
750 field.primitiveField().cdata()
755 assertNoError(
"writing internalField " + fieldName);
762 &(globalState_->error),
771 &(globalState_->error),
773 maps_->boundary[patchI],
777 field.boundaryField()[patchI].cdata()
784 assertNoError(
"writing boundaryField " + fieldName);
790 assertNoError(
"Error before writing processor");
794 &(globalState_->error),
799 nullptr, &fieldSetNode
801 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.
FOAM_DLL_EXPORT 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.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
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 expressions::valueTypeCode::INVALID.
Reading is optional [identical to LAZY_READ].
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh...
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)
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 it is a dictionary) otherwise return nullptr...