111 bool writeOk =
false;
115 Info<<
" Reading " <<
io.headerClassName()
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
227 &&
io.isHeaderClass<Type>()
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);
392 Info<<
" Reading " <<
io.headerClassName()
393 <<
" : " <<
io.name() <<
endl;
398 fDict.regIOobject::write();
417 if (!lagrangianDirs.empty())
425 Info<<
" Create polyMesh for time = " 456 for (
const auto& cloudDir : cloudDirs)
463 const bool writeOnProc = parcels.size();
485 for (
const word&
name : cloudFields)
491 ||
name ==
"coordinates" 492 ||
name ==
"origProcId" 500 #define doLocalCode(Type) \ 503 writeOptionalMeshObject<Type> \ 505 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.
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 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 is_volume(const word &clsName)
Test if the class name appears to be a volume field.
bool is_internal(const word &clsName)
Test if the class name appears to be a volume internal field.
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
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...
bool is_point(const word &clsName)
Test if the class name appears to be a point field.
static void combineReduce(T &value, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine value from different processors...
A PtrList of objects of type <T> with automated input and output.
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)
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.
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 is_surface(const word &clsName)
Test if the class name appears to be a surface field.
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'.
static const word prefix
The prefix to local: lagrangian.