94 Info<<
" Reading " << io.headerClassName()
106 if (meshObject[i].isDict())
110 if (d.
found(
"faceLabels"))
115 if (d.
found(
"flipMap"))
120 if (d.
found(
"cellLabels"))
125 if (d.
found(
"pointLabels"))
135 const_cast<word&
>(meshObject.type()) = io.headerClassName();
140 writeOk = meshObject.regIOobject::writeObject
182 bool writeOptionalMeshObject
201 bool writeOk =
false;
203 const bool haveFile = io.headerOk();
206 stringList classNames(1, io.headerClassName());
210 if (classNames[0] == T::typeName)
212 Info<<
" Reading " << classNames[0]
214 T meshObject(io,
write && haveFile);
217 writeOk = meshObject.regIOobject::write(
write && haveFile);
224 int main(
int argc,
char *argv[])
230 "exclude the 'constant/' dir in the times list"
244 Info<<
"Excluding the constant directory." <<
nl <<
endl;
274 writeMeshObject<cellCompactIOList, cellIOList>
280 writeMeshObject<labelIOList>(
"owner", meshDir, runTime);
281 writeMeshObject<labelIOList>(
"neighbour", meshDir, runTime);
282 if (!writeMeshObject<faceCompactIOList>(
"faces", meshDir, runTime))
284 writeMeshObject<faceCompactIOList, faceIOList>
291 writeMeshObject<pointIOField>(
"points", meshDir, runTime);
294 writeZones(
"boundary", meshDir, runTime);
295 writeMeshObject<labelIOList>(
"pointProcAddressing", meshDir, runTime);
296 writeMeshObject<labelIOList>(
"faceProcAddressing", meshDir, runTime);
297 writeMeshObject<labelIOList>(
"cellProcAddressing", meshDir, runTime);
303 writeZones(
"cellZones", meshDir, runTime);
304 writeZones(
"faceZones", meshDir, runTime);
305 writeZones(
"pointZones", meshDir, runTime);
313 const word& headerClassName = iter()->headerClassName();
317 headerClassName == volScalarField::typeName
318 || headerClassName == volVectorField::typeName
319 || headerClassName == volSphericalTensorField::typeName
320 || headerClassName == volSymmTensorField::typeName
321 || headerClassName == volTensorField::typeName
323 || headerClassName == surfaceScalarField::typeName
324 || headerClassName == surfaceVectorField::typeName
325 || headerClassName == surfaceSphericalTensorField::typeName
326 || headerClassName == surfaceSymmTensorField::typeName
327 || headerClassName == surfaceTensorField::typeName
329 || headerClassName == pointScalarField::typeName
330 || headerClassName == pointVectorField::typeName
331 || headerClassName == pointSphericalTensorField::typeName
332 || headerClassName == pointSymmTensorField::typeName
333 || headerClassName == pointTensorField::typeName
335 || headerClassName == volScalarField::Internal::typeName
336 || headerClassName == volVectorField::Internal::typeName
337 || headerClassName == volSphericalTensorField::Internal::typeName
338 || headerClassName == volSymmTensorField::Internal::typeName
339 || headerClassName == volTensorField::Internal::typeName
342 Info<<
" Reading " << headerClassName
343 <<
" : " << iter()->name() <<
endl;
347 Info<<
" Writing " << iter()->name() <<
endl;
348 fDict.regIOobject::write();
368 if (!lagrangianDirs.empty())
376 Info<<
" Create polyMesh for time = "
429 stringList sprayFields(sprayObjs.sortedToc());
432 forAll(sprayFields, fieldi)
434 const word&
name = sprayFields[fieldi];
443 ||
name ==
"origProcId"
450 bool writeOk = writeOptionalMeshObject<labelIOField>
457 if (writeOk)
continue;
459 writeOk = writeOptionalMeshObject<scalarIOField>
466 if (writeOk)
continue;
468 writeOk = writeOptionalMeshObject<vectorIOField>
475 if (writeOk)
continue;
477 writeOk = writeOptionalMeshObject<sphericalTensorIOField>
484 if (writeOk)
continue;
486 writeOk = writeOptionalMeshObject<symmTensorIOField>
493 if (writeOk)
continue;
495 writeOk = writeOptionalMeshObject<tensorIOField>
502 if (writeOk)
continue;
504 writeOk = writeOptionalMeshObject<labelFieldIOField>
511 if (writeOk)
continue;
513 writeOk = writeOptionalMeshObject<vectorFieldIOField>
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A PtrList of objects of type <Type> with automated input and output.
List of IOobjects with searching and retrieving facilities.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static fileCheckTypes fileModificationChecking
Type of file modification checking.
static const versionNumber currentVersion
Current version number.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual void setTime(const Time &)
Reset the time and time-index to those of the given time.
word userTimeName() const
Return current user time name with units.
IOstream::streamFormat writeFormat() const
Default write format.
IOstream::compressionType writeCompression() const
Default write compression.
fileName timePath() const
Return current time path.
bool setOption(const word &opt, const string ¶m="")
Set option directly (use with caution)
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool optionFound(const word &opt) const
Return true if the named option is found.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
bool unsetOption(const word &opt)
Unset option directly (use with caution)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const word & name() const
Return const reference to name.
Read field as dictionary (without mesh).
A class for handling file names.
static const fileName null
An empty fileName.
readUpdateState readUpdate(const stitchType stitch=stitchType::geometric)
Update the mesh based on the mesh files saved in time.
static const word prefix
The prefix to local: lagrangian.
Mesh consisting of general polyhedral cells.
static word defaultRegion
Return the default region name.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
A class for handling words, derived from string.
static const word null
An empty word.
int main(int argc, char *argv[])
static instantList timeDirs
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
const fileOperation & fileHandler()
Get current file handler.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const word & regionName(const solver ®ion)
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
List< bool > boolList
Bool container classes.
defineTemplateTypeNameAndDebug(prghPressure, 0)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
void combineReduce(const List< UPstream::commsStruct > &comms, T &Value, const CombineOp &cop, const int tag, const label comm)
Foam::argList args(argc, argv)
Write a mesh object in the format specified in controlDict.