112 bool writeOk =
false;
116 Info<<
" Reading " <<
io.headerClassName()
132 if (d.
found(
"faceLabels"))
137 if (d.
found(
"flipMap"))
142 if (d.
found(
"cellLabels"))
147 if (d.
found(
"pointLabels"))
173template<
class StringType>
189 if (!
y[i].empty() && !
x.found(
y[i]))
201bool writeOptionalMeshObject
220 bool writeOk =
false;
226 Pstream::combineAllGather(classNames, uniqueEqOp<word>());
229 if (classNames[0] == T::typeName)
231 Info<<
" Reading " << classNames[0]
236 writeOk =
meshObject.regIOobject::write(valid && haveFile);
243int main(
int argc,
char *argv[])
247 "Converts all IOobjects associated with a case into the format"
248 " specified in the controlDict"
250 timeSelector::addOptions();
251 argList::addBoolOption
254 "Exclude the 'constant/' dir in the times list"
256 argList::addBoolOption
258 "enableFunctionEntries",
259 "Enable expansion of dictionary directives - #include, #codeStream etc"
273 Info<<
"Excluding the constant directory." <<
nl <<
endl;
281 const bool enableEntries =
args.
found(
"enableFunctionEntries");
284 Info<<
"Allowing dictionary preprocessing ('#include', '#codeStream')."
288 const int oldFlag = entry::disableFunctionEntries;
292 entry::disableFunctionEntries = 1;
297 IOobject::fileModificationChecking = IOobject::timeStamp;
308 polyMesh::regionName(
regionName)/polyMesh::meshSubDir
316 runTime.setTime(timeDirs[timeI], timeI);
320 writeMeshObject<cellCompactIOList, cellIOList>
327 writeMeshObject<labelIOList>(
"owner", meshDir,
runTime);
328 writeMeshObject<labelIOList>(
"neighbour", meshDir,
runTime);
329 writeMeshObject<faceCompactIOList, faceIOList>
336 writeMeshObject<pointIOField>(
"points", meshDir,
runTime);
339 writeZones(
"boundary", meshDir,
runTime, IOstreamOption::UNCOMPRESSED);
340 writeMeshObject<labelIOList>(
"pointProcAddressing", meshDir,
runTime);
341 writeMeshObject<labelIOList>(
"faceProcAddressing", meshDir,
runTime);
342 writeMeshObject<labelIOList>(
"cellProcAddressing", meshDir,
runTime);
343 writeMeshObject<labelIOList>
345 "boundaryProcAddressing",
351 writeMeshObject<pointIOField>
353 "internalDelaunayVertices",
358 if (
runTime.writeFormat() == IOstream::ASCII)
364 writeZones(
"cellZones", meshDir,
runTime, compress);
365 writeZones(
"faceZones", meshDir,
runTime, compress);
366 writeZones(
"pointZones", meshDir,
runTime, compress);
379 const word& headerClassName = (*iter)->headerClassName();
383 headerClassName == volScalarField::typeName
384 || headerClassName == volVectorField::typeName
385 || headerClassName == volSphericalTensorField::typeName
386 || headerClassName == volSymmTensorField::typeName
387 || headerClassName == volTensorField::typeName
389 || headerClassName == surfaceScalarField::typeName
390 || headerClassName == surfaceVectorField::typeName
391 || headerClassName == surfaceSphericalTensorField::typeName
392 || headerClassName == surfaceSymmTensorField::typeName
393 || headerClassName == surfaceTensorField::typeName
395 || headerClassName == pointScalarField::typeName
396 || headerClassName == pointVectorField::typeName
397 || headerClassName == pointSphericalTensorField::typeName
398 || headerClassName == pointSymmTensorField::typeName
399 || headerClassName == pointTensorField::typeName
401 || headerClassName == volScalarField::Internal::typeName
402 || headerClassName == volVectorField::Internal::typeName
403 || headerClassName == volSphericalTensorField::Internal::typeName
404 || headerClassName == volSymmTensorField::Internal::typeName
405 || headerClassName == volTensorField::Internal::typeName
408 Info<<
" Reading " << headerClassName
409 <<
" : " << (*iter)->name() <<
endl;
413 Info<<
" Writing " << (*iter)->name() <<
endl;
414 fDict.regIOobject::write();
432 Pstream::combineAllGather(lagrangianDirs, uniqueEqOp<fileName>());
434 if (!lagrangianDirs.empty())
442 Info<<
" Create polyMesh for time = "
451 polyMesh::defaultRegion,
469 Pstream::combineAllGather(cloudDirs, uniqueEqOp<fileName>());
473 fileName dir(cloud::prefix/cloudDirs[i]);
495 Pstream::combineAllGather(cloudFields, uniqueEqOp<word>());
497 for (
const word& name : cloudFields)
506 || name ==
"coordinates"
507 || name ==
"origProcId"
514 bool writeOk = writeOptionalMeshObject<labelIOField>
521 if (writeOk)
continue;
523 writeOk = writeOptionalMeshObject<scalarIOField>
530 if (writeOk)
continue;
532 writeOk = writeOptionalMeshObject<vectorIOField>
539 if (writeOk)
continue;
541 writeOk = writeOptionalMeshObject<sphericalTensorIOField>
548 if (writeOk)
continue;
550 writeOk = writeOptionalMeshObject<symmTensorIOField>
557 if (writeOk)
continue;
559 writeOk = writeOptionalMeshObject<tensorIOField>
566 if (writeOk)
continue;
568 writeOk = writeOptionalMeshObject<labelFieldIOField>
575 if (writeOk)
continue;
577 writeOk = writeOptionalMeshObject<vectorFieldIOField>
596 entry::disableFunctionEntries = oldFlag;
Base cloud calls templated on particle type.
A primitive field of type <T> with automated input and output.
A PtrList of objects of type <T> with automated input and output.
List of IOobjects with searching and retrieving facilities.
wordList sortedNames() const
The sorted names of the IOobjects.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
The IOstreamOption is a simple container for options an IOstream can normally have.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool unsetOption(const word &optName)
Unset option directly (use with caution)
bool setOption(const word &optName, const string ¶m="")
Set option directly (use with caution)
bool found(const word &optName) const
Return true if the named option is found.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
Read field as dictionary (without mesh).
A class for handling file names.
Mesh consisting of general polyhedral cells.
static instantList select0(Time &runTime, const argList &args)
A class for handling words, derived from Foam::string.
#define defineTemplateTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information for templates, useful.
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
Foam::word regionName(Foam::polyMesh::defaultRegion)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
const fileOperation & fileHandler()
Get current file handler.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Write a mesh object in the format specified in controlDict.