111 bool writeOk =
false;
131 if (d.
found(
"faceLabels"))
136 if (d.
found(
"flipMap"))
141 if (d.
found(
"cellLabels"))
146 if (d.
found(
"pointLabels"))
172 template<
class StringType>
188 if (!
y[i].empty() && !
x.found(
y[i]))
200 bool writeOptionalMeshObject
230 bool writeOk =
false;
234 Info<<
" Reading " << Type::typeName <<
" : " <<
name <<
endl;
238 writeOk =
meshObject.regIOobject::write(readOnProc && writeOnProc);
245 int main(
int argc,
char *argv[])
249 "Converts all IOobjects associated with a case into the format" 250 " specified in the controlDict" 256 "Exclude the 'constant/' dir in the times list" 260 "enableFunctionEntries",
261 "Enable expansion of dictionary directives - #include, #codeStream etc" 275 Info<<
"Excluding the constant directory." <<
nl <<
endl;
283 const bool enableEntries =
args.
found(
"enableFunctionEntries");
286 Info<<
"Allowing dictionary preprocessing ('#include', '#codeStream')." 323 writeMeshObject<cellCompactIOList, cellIOList>
330 writeMeshObject<labelIOList>(
"owner", meshDir,
runTime);
331 writeMeshObject<labelIOList>(
"neighbour", meshDir,
runTime);
332 writeMeshObject<faceCompactIOList, faceIOList>
339 writeMeshObject<pointIOField>(
"points", meshDir,
runTime);
343 writeMeshObject<labelIOList>(
"pointProcAddressing", meshDir,
runTime);
344 writeMeshObject<labelIOList>(
"faceProcAddressing", meshDir,
runTime);
345 writeMeshObject<labelIOList>(
"cellProcAddressing", meshDir,
runTime);
346 writeMeshObject<labelIOList>
348 "boundaryProcAddressing",
354 writeMeshObject<pointIOField>
356 "internalDelaunayVertices",
367 writeZones(
"cellZones", meshDir,
runTime, compress);
368 writeZones(
"faceZones", meshDir,
runTime, compress);
369 writeZones(
"pointZones", meshDir,
runTime, compress);
417 fDict.regIOobject::write();
436 if (!lagrangianDirs.empty())
444 Info<<
" Create polyMesh for time = " 475 for (
const auto& cloudDir : cloudDirs)
482 const bool writeOnProc = parcels.size();
504 for (
const word&
name : cloudFields)
510 ||
name ==
"coordinates" 511 ||
name ==
"origProcId" 519 #define doLocalCode(Type) \ 522 writeOptionalMeshObject<Type> \ 524 name, dir, runTime, writeOnProc \
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 = path/timeName.
const word & regionName() const
The mesh region name or word::null if polyMesh::defaultRegion.
const word & name() const noexcept
Return the object name.
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)
The meshObject is a concrete regIOobject to register MeshObject items.
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.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
A simple container for options an IOstream can normally have.
Ignore writing from objectRegistry::writeObject()
#define doLocalCode(FieldType, Variable)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A Cloud of passive particles.
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.
static int disableFunctionEntries
Enable or disable use of function entries and variable expansions.
const dimensionedScalar e
Elementary charge.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
A class for handling words, derived from Foam::string.
static word defaultRegion
Return the default region name.
static void combineReduce(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...
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.
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (respects is_globalIOobject trait) and check its info.
Read field as dictionary (without mesh).
IOstreamOption::compressionType writeCompression() const noexcept
Get the write stream compression.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value 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...
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.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
bool setOption(const word &optName, const string ¶m="")
Set option directly (use with caution)
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
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.
IOstreamOption::streamFormat writeFormat() const noexcept
Get write stream format.
List< label > labelList
A List of labels.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
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)
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
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.
Do not request registration (bool: false)
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)
A keyword and a list of tokens is an 'entry'.
bool isHeaderClass() const
Check if headerClassName() equals Type::typeName.
static const word prefix
The prefix to local: lagrangian.