41 setEnv(
"FOAM_APPLICATION", application,
false);
49 if (controlDict_.
found(
"DebugSwitches"))
51 Info<<
"Overriding DebugSwitches according to " << controlDict_.
name()
75 objects[i]->readData(is);
82 objects[i]->readData(iter().stream());
90 if (controlDict_.
found(
"OptimisationSwitches"))
92 Info<<
"Overriding OptimisationSwitches according to " 98 "OptimisationSwitches" 102 const word&
name = iter().keyword();
119 objects[i]->readData(is);
126 objects[i]->readData(iter().stream());
135 word fileHandlerName;
153 Info<<
"Overriding fileHandler to " << fileHandlerName <<
endl;
173 if (controlDict_.
found(
"DimensionedConstants"))
175 Info<<
"Overriding DimensionedConstants according to " 181 controlDict_.
subDict(
"DimensionedConstants")
195 objects[i]->readData(dummyIs);
198 objects[i]->writeData(
Info);
206 if (controlDict_.
found(
"DimensionSets"))
208 Info<<
"Overriding DimensionSets according to " 229 objects[i]->readData(is);
240 if (controlDict_.
found(
"writeControl"))
244 controlDict_.
lookup(
"writeControl")
255 <<
"writeInterval < 1 for writeControl timeStep" 292 <<
", should be >= 0, setting to 0" 299 if (controlDict_.
found(
"timeFormat"))
301 const word formatName(controlDict_.
lookup(
"timeFormat"));
303 if (formatName ==
"general")
307 else if (formatName ==
"fixed")
311 else if (formatName ==
"scientific")
318 <<
"unsupported time format " << formatName
327 if (controlDict_.
found(
"stopAt"))
347 if (controlDict_.
found(
"writeVersion"))
351 controlDict_.
lookup(
"writeVersion")
355 if (controlDict_.
found(
"writeFormat"))
359 controlDict_.
lookup(
"writeFormat")
363 if (controlDict_.
found(
"writePrecision"))
383 if (controlDict_.
found(
"writeCompression"))
387 controlDict_.
lookup(
"writeCompression")
397 <<
"Selecting compressed binary is inefficient and ineffective" 398 ", resetting to uncompressed binary" 406 controlDict_.
readIfPresent(
"runTimeModifiable", runTimeModifiable_);
424 if (controlDict_.regIOobject::read())
428 if (runTimeModifiable_)
449 if (runTimeModifiable_)
470 functionObjects_.
read();
472 if (runTimeModifiable_)
486 if (registryModified)
513 timeDict.
add(
"name",
string(tmName));
518 return timeDict.regIOobject::writeObject
bool read()
Read and set the function objects if their data have changed.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
static streamFormat formatEnum(const word &)
Return stream format of given format name.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static compressionType compressionEnum(const word &)
Return compression of given compression name.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool valid) const
Write the objects.
bool writeAndEnd()
Write the objects now (not at end of iteration) and end the run.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void readModifiedObjects()
Read the objects that have been modified.
virtual int precision() const
Get precision of output field.
Dictionary reading and supplying the dimensioned constants used within OpenFOAM, particularly for the...
A list of keyword definitions, which are a keyword followed by any number of values (e...
set endTime to stop immediately w/ writing
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static unsigned int defaultPrecision()
Return the default precision.
void size(const label)
Override size to be inconsistent with allocated storage.
virtual bool modified() const
Return true if any of the object's files have been modified.
static fmtflags format_
Time directory name format.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
const labelList & watchIndices() const
Return file-monitoring handles.
const T * lookupPtr(const word &) const
Find and return an entry if present, otherwise return nullptr.
simpleObjectRegistry & debugObjects()
Get access to registered debug switch objects.
writeControls writeControl_
virtual word timeName() const
Return current time name.
dictionary & dimensionedConstants()
simpleObjectRegistry & optimisationObjects()
Get access to registered optimisation switch objects.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
virtual fileName::Type type(const fileName &, const bool followLink=true) const =0
Return the file type: DIRECTORY, FILE or LINK.
static const int maxPrecision_
Maximum time directory name precision.
fileName path() const
Return complete path.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
static autoPtr< fileOperation > New(const word &type, const bool verbose)
Select type.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
virtual scalar timeToUserTime(const scalar t) const
Convert the real-time (s) into user-time (e.g. CA deg)
virtual bool writeTimeDict() const
Write time dictionary to the <time>/uniform directory.
bool writeTime() const
Return true if this is a write time.
virtual void updateStates(const bool masterOnly, const bool syncPar) const
Update state of all files.
static const NamedEnum< stopAtControls, 4 > stopAtControlNames_
const fileNameList & files() const
static int precision_
Time directory name precision.
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
virtual bool readIfModified()
Read object if modified (as set by call to modified)
virtual fileName getFile(const label) const
Get name of file being watched (using handle)
const scalar & value() const
Return const reference to value.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
streamFormat
Enumeration for the format of data in the stream.
virtual void addWatches(regIOobject &, const fileNameList &) const
Helper: add watches for list of regIOobjects.
const fileOperation & fileHandler()
Get current file handler.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
const word & name() const
Name function is needed to disambiguate those inherited.
OSstream Sout(cout, "Sout")
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
compressionType
Enumeration for the format of data in the stream.
bool rmDir(const fileName &)
Remove a dirctory and its contents.
FIFOStack< word > previousWriteTimes_
virtual void readDict()
Read the control dictionary and set the write controls etc.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
prefixOSstream Perr(cerr, "Perr")
const word & name() const
Return const reference to name.
static const NamedEnum< writeControls, 5 > writeControlNames_
void readModifiedObjects()
Read the objects that have been modified.
simpleObjectRegistry & dimensionSetObjects()
Get access to registered dimensionSets switch objects.
void writeOnce()
Write the objects once (one shot) and continue the run.
unsigned int readUint(Istream &)
dictionary & dimensionSystems()
Top level dictionary.
static bool & parRun()
Is this a parallel run?
virtual bool read()
Read control dictionary, update controls and time.
#define WarningInFunction
Report a warning using Foam::Warning.
static const versionNumber currentVersion
Current version number.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Object registry for simpleRegIOobject. Maintains ordering.
stop when Time reaches the prescribed endTime
Input from memory buffer stream.
prefixOSstream Pout(cout, "Pout")
simpleObjectRegistry & dimensionedConstantObjects()
Get access to registered dimensionedConstant switch objects.
string str() const
Return the string.
OSstream Serr(cerr, "Serr")
bool merge(const dictionary &)
Merge entries from the given dictionary.
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool valid) const
Write using given format, version and compression.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
virtual bool write(const bool valid=true) const
Write using setting from DB.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Output to memory buffer stream.
bool setEnv(const word &name, const std::string &value, const bool overwrite)
Set an environment variable.
bool writeNow()
Write the objects now (not at end of iteration) and continue.
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.