112 bool writeOk =
false;
132 if (d.
found(
"faceLabels"))
137 if (d.
found(
"flipMap"))
142 if (d.
found(
"cellLabels"))
147 if (d.
found(
"pointLabels"))
173 template<
class StringType>
189 if (!
y[i].empty() && !
x.found(
y[i]))
201 bool writeOptionalMeshObject
220 bool writeOk =
false;
229 if (classNames[0] == T::typeName)
231 Info<<
" Reading " << classNames[0]
236 writeOk =
meshObject.regIOobject::write(valid && haveFile);
243 int main(
int argc,
char *argv[])
247 "Converts all IOobjects associated with a case into the format" 248 " specified in the controlDict" 254 "Exclude the 'constant/' dir in the times list" 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')." 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);
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",
364 writeZones(
"cellZones", meshDir,
runTime, compress);
365 writeZones(
"faceZones", meshDir,
runTime, compress);
366 writeZones(
"pointZones", meshDir,
runTime, compress);
379 const word& headerClassName = (*iter)->headerClassName();
408 Info<<
" Reading " << headerClassName
409 <<
" : " << (*iter)->name() <<
endl;
413 Info<<
" Writing " << (*iter)->name() <<
endl;
414 fDict.regIOobject::write();
434 if (!lagrangianDirs.empty())
442 Info<<
" Create polyMesh for time = " 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>
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return an entry data stream. FatalIOError if not found, or not a stream. ...
static void addNote(const string ¬e)
Add extra notes for the usage information.
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.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
bool unsetOption(const word &optName)
Unset option directly (use with caution)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Write a mesh object in the format specified in controlDict.
fileName timePath() const
Return current time path.
const word & regionName() const
The mesh region name or word::null if polyMesh::defaultRegion.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
constexpr char nl
The newline '\n' character (0x0a)
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
autoPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler.
label size() const noexcept
The number of elements in table.
A simple container for options an IOstream can normally have.
Ignore writing from objectRegistry::writeObject()
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
#define forAll(list, i)
Loop across all elements in list.
Foam::word regionName(Foam::polyMesh::defaultRegion)
static int disableFunctionEntries
Enable or disable use of function entries and variable expansions.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
A class for handling words, derived from Foam::string.
static word defaultRegion
Return the default region name.
static const word null
An empty word.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
IOstreamOption::compressionType writeCompression() const noexcept
The write stream compression.
static void combineReduce(const List< commsStruct > &comms, T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine value from different processors...
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
Read field as dictionary (without mesh).
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
defineTemplateTypeNameAndDebug(faScalarMatrix, 0)
static fileCheckTypes fileModificationChecking
Type of file modification checking.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options and also set the runTime to the first i...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const word typeName("volScalarField::Internal")
IOstreamOption::streamFormat writeFormat() const noexcept
The write stream format.
A PtrList of objects of type <T> with automated input and output.
const word & headerClassName() const noexcept
Return name of the class name read from header.
bool setOption(const word &optName, const string ¶m="")
Set option directly (use with caution)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Mesh consisting of general polyhedral cells.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
List< label > labelList
A List of labels.
fileNameList readDir(const fileName &directory, const fileName::Type type=fileName::Type::FILE, const bool filtergz=true, const bool followLink=true)
Read a directory and return the entries as a fileName List.
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
List< bool > boolList
A List of bools.
A primitive field of type <T> with automated input and output.
bool found(const word &optName) const
Return true if the named option is found.
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
forAllConstIters(mixture.phases(), phase)
static const word prefix
The prefix to local: lagrangian.