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"))
172template<
class StringType>
175 void operator()(List<StringType>&
x,
const List<StringType>&
y)
const
177 List<StringType> newX(
x.size()+
y.size());
188 if (!
y[i].empty() && !
x.found(
y[i]))
200bool writeOptionalMeshObject
227 &&
io.isHeaderClass<Type>()
230 bool writeOk =
false;
234 Info<<
" Reading " << Type::typeName <<
" : " <<
name <<
endl;
238 writeOk =
meshObject.regIOobject::write(readOnProc && writeOnProc);
245int 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"
268 if (!
args.found(
"noConstant"))
270 args.setOption(
"constant");
274 args.unsetOption(
"constant");
275 Info<<
"Excluding the constant directory." <<
nl <<
endl;
283 const bool enableEntries =
args.found(
"enableFunctionEntries");
286 Info<<
"Allowing dictionary preprocessing ('#include', '#codeStream')."
319 runTime.setTime(timeDirs[timeI], timeI);
348 "boundaryProcAddressing",
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 \
A PtrList of objects of type <T> with automated input and output.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
wordList sortedNames() const
The sorted names of the IOobjects.
@ NO_REGISTER
Do not request registration (bool: false).
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static fileCheckTypes fileModificationChecking
Type of file modification checking.
A simple container for options an IOstream can normally have.
@ ASCII
"ascii" (normal default)
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED).
@ UNCOMPRESSED
compression = false
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.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static const word prefix
The prefix to local: lagrangian.
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
Find and return an entry data stream. FatalIOError if not found, or not a stream.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
A keyword and a list of tokens is an 'entry'.
static int disableFunctionEntries
Enable or disable use of function entries and variable expansions.
Read field as dictionary (without mesh).
A class for handling file names.
The meshObject is a concrete regIOobject to register MeshObject items.
A Cloud of passive particles.
Mesh consisting of general polyhedral cells.
static const word & regionName(const word ®ion)
The mesh region name or word::null if polyMesh::defaultRegion.
static word defaultRegion
Return the default region name.
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...
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
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 class for handling words, derived from Foam::string.
static const word null
An empty word.
#define defineTemplateTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information for templates, useful.
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
#define doLocalCode(FieldType, Variable)
bool is_volume(const word &clsName)
Test if the class name appears to be a volume field.
bool is_surface(const word &clsName)
Test if the class name appears to be a surface field.
bool is_point(const word &clsName)
Test if the class name appears to be a point field.
bool is_internal(const word &clsName)
Test if the class name appears to be a volume internal field.
IOField< symmTensor > symmTensorIOField
IO for a Field of symmTensor.
List< word > wordList
List of word.
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
List< label > labelList
A List of labels.
List< fileName > fileNameList
List of fileName.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler().
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< instant > instantList
List of instants.
IOField< vectorField > vectorFieldIOField
IO for a Field of vectorField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
ZoneMesh< cellZone, polyMesh > cellZoneMesh
A ZoneMesh with cellZone content on a polyMesh.
IOField< labelField > labelFieldIOField
IO for a Field of labelField.
bool writeMeshObject(const word &name, const fileName &meshDir, Time &runTime, const bool strictTypeChecking=true, const bool disableHeaderChecking=false)
IOField< sphericalTensor > sphericalTensorIOField
IO for a Field of sphericalTensor.
List< bool > boolList
A List of bools.
IOField< label > labelIOField
IO for a Field of label.
IOField< vector > vectorIOField
IO for a Field of vector.
IOField< tensor > tensorIOField
IO for a Field of tensor.
IOField< scalar > scalarIOField
IO for a Field of scalar.
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.
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.