Go to the documentation of this file.
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"))
173 template<
class StringType>
189 if (!
y[i].empty() && !
x.found(
y[i]))
201 bool writeOptionalMeshObject
220 bool writeOk =
false;
225 wordList classNames(1, io.headerClassName());
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')."
318 writeMeshObject<cellCompactIOList, cellIOList>
325 writeMeshObject<labelIOList>(
"owner", meshDir,
runTime);
326 writeMeshObject<labelIOList>(
"neighbour", meshDir,
runTime);
327 writeMeshObject<faceCompactIOList, faceIOList>
334 writeMeshObject<pointIOField>(
"points", meshDir,
runTime);
338 writeMeshObject<labelIOList>(
"pointProcAddressing", meshDir,
runTime);
339 writeMeshObject<labelIOList>(
"faceProcAddressing", meshDir,
runTime);
340 writeMeshObject<labelIOList>(
"cellProcAddressing", meshDir,
runTime);
341 writeMeshObject<labelIOList>
343 "boundaryProcAddressing",
349 writeMeshObject<pointIOField>
351 "internalDelaunayVertices",
362 writeZones(
"cellZones", meshDir,
runTime, compress);
363 writeZones(
"faceZones", meshDir,
runTime, compress);
364 writeZones(
"pointZones", meshDir,
runTime, compress);
372 const word& headerClassName = (*iter)->headerClassName();
376 headerClassName == volScalarField::typeName
377 || headerClassName == volVectorField::typeName
378 || headerClassName == volSphericalTensorField::typeName
379 || headerClassName == volSymmTensorField::typeName
380 || headerClassName == volTensorField::typeName
382 || headerClassName == surfaceScalarField::typeName
383 || headerClassName == surfaceVectorField::typeName
384 || headerClassName == surfaceSphericalTensorField::typeName
385 || headerClassName == surfaceSymmTensorField::typeName
386 || headerClassName == surfaceTensorField::typeName
388 || headerClassName == pointScalarField::typeName
389 || headerClassName == pointVectorField::typeName
390 || headerClassName == pointSphericalTensorField::typeName
391 || headerClassName == pointSymmTensorField::typeName
392 || headerClassName == pointTensorField::typeName
401 Info<<
" Reading " << headerClassName
402 <<
" : " << (*iter)->name() <<
endl;
406 Info<<
" Writing " << (*iter)->name() <<
endl;
407 fDict.regIOobject::write();
427 if (!lagrangianDirs.empty())
435 Info<<
" Create polyMesh for time = "
490 for (
const word&
name : cloudFields)
499 ||
name ==
"coordinates"
500 ||
name ==
"origProcId"
507 bool writeOk = writeOptionalMeshObject<labelIOField>
514 if (writeOk)
continue;
516 writeOk = writeOptionalMeshObject<scalarIOField>
523 if (writeOk)
continue;
525 writeOk = writeOptionalMeshObject<vectorIOField>
532 if (writeOk)
continue;
534 writeOk = writeOptionalMeshObject<sphericalTensorIOField>
541 if (writeOk)
continue;
543 writeOk = writeOptionalMeshObject<symmTensorIOField>
550 if (writeOk)
continue;
552 writeOk = writeOptionalMeshObject<tensorIOField>
559 if (writeOk)
continue;
561 writeOk = writeOptionalMeshObject<labelFieldIOField>
568 if (writeOk)
continue;
570 writeOk = writeOptionalMeshObject<vectorFieldIOField>
IOstream::compressionType writeCompression() const
The write stream compression.
List< label > labelList
A List of labels.
label size() const noexcept
The number of elements in table.
static const word prefix
The prefix to local: lagrangian.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Foam::autoPtr< Foam::fvMesh > meshPtr(nullptr)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
A class for handling file names.
A primitive field of type <T> with automated input and output.
A PtrList of objects of type <T> with automated input and output.
static word defaultRegion
Return the default region name.
Read field as dictionary (without mesh).
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
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.
IOstream::streamFormat writeFormat() const
The write stream format.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static word timeName(const scalar t, const int precision=precision_)
static fileCheckTypes fileModificationChecking
Type of file modification checking.
static void addNote(const string ¬e)
Add extra notes for the usage information.
void combineReduce(const List< UPstream::commsStruct > &comms, T &Value, const CombineOp &cop, const int tag, const label comm)
List< bool > boolList
A List of bools.
const fileOperation & fileHandler()
Get current file handler.
defineTemplateTypeNameAndDebug(faScalarMatrix, 0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
Write a mesh object in the format specified in controlDict.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
bool setOption(const word &optName, const string ¶m="")
Set option directly (use with caution)
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName timePath() const
Return current time path.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
The IOstreamOption is a simple container for options an IOstream can normally have.
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
static int disableFunctionEntries
Enable or disable use of function entries and variable expansions.
List of IOobjects with searching and retrieving facilities.
bool unsetOption(const word &optName)
Unset option directly (use with caution)
void reset(autoPtr< T > &&other) noexcept
Delete managed object and set to new given pointer.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
forAllConstIters(mixture.phases(), phase)
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
static const word null
An empty word.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
static instantList select0(Time &runTime, const argList &args)
Foam::argList args(argc, argv)
const word typeName("volScalarField::Internal")
fileNameList readDir(const fileName &directory, const fileName::Type type=fileName::FILE, const bool filtergz=true, const bool followLink=true)
Read a directory and return the entries as a fileName List.
bool found(const word &optName) const
Return true if the named option is found.