37 setEnv(
"FOAM_APPLICATION", application,
false);
45 if (controlDict_.
found(
"writeControl"))
49 controlDict_.
lookup(
"writeControl")
55 if (controlDict_.
readIfPresent(
"writeInterval", newWriteInterval))
60 &&
label(newWriteInterval) < 1
64 <<
"writeInterval < 1 for writeControl timeStep" 70 controlDict_.
lookup(
"writeFrequency") >> newWriteInterval;
81 <<
", should be >= 0, setting to 0" 88 if (controlDict_.
found(
"timeFormat"))
90 const word formatName(controlDict_.
lookup(
"timeFormat"));
92 if (formatName ==
"general")
96 else if (formatName ==
"fixed")
100 else if (formatName ==
"scientific")
107 <<
"unsupported time format " << formatName
116 if (controlDict_.
found(
"stopAt"))
136 if (controlDict_.
found(
"writeVersion"))
140 controlDict_.
lookup(
"writeVersion")
144 if (controlDict_.
found(
"writeFormat"))
148 controlDict_.
lookup(
"writeFormat")
152 if (controlDict_.
found(
"writePrecision"))
156 controlDict_.
lookup<
unsigned int>(
"writePrecision")
172 if (controlDict_.
found(
"writeCompression"))
176 controlDict_.
lookup(
"writeCompression")
186 <<
"Selecting compressed binary is inefficient and ineffective" 187 ", resetting to uncompressed binary" 195 controlDict_.
readIfPresent(
"runTimeModifiable", runTimeModifiable_);
201 if (controlDict_.regIOobject::read())
216 if (runTimeModifiable_)
237 functionObjects_.
read();
242 if (registryModified)
270 timeDict.
add(
"name",
string(tmName));
275 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.
static streamFormat formatEnum(const word &)
Return stream format of given format name.
virtual bool rmDir(const fileName &) const =0
Remove a directory and its contents.
stop when Time reaches the prescribed endTime
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.
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)
writeControl writeControl_
void readModifiedObjects()
Read the objects that have been modified.
virtual int precision() const
Get precision of output field.
set endTime to stop immediately w/ writing
static unsigned int defaultPrecision()
Return the default precision.
virtual bool modified() const
Return true if any of the object's files have been modified.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual fileName filePath() const
Return complete path + object name if the file exists.
virtual word timeName() const
Return current time name.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
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...
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.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool write) const
Write using given format, version and compression.
static int precision_
Time directory name precision.
A class for handling words, derived from string.
virtual bool readIfModified()
Read object if modified (as set by call to modified)
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.
const fileOperation & fileHandler()
Get current file handler.
OSstream Sout(cout, "Sout")
compressionType
Enumeration for the format of data in the stream.
static format format_
Time directory name format.
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")
static const NamedEnum< stopAtControl, 4 > stopAtControlNames_
const word & name() const
Return const reference to name.
void readModifiedObjects()
Read the objects that have been modified.
void writeOnce()
Write the objects once (one shot) and continue the run.
static const NamedEnum< writeControl, 5 > writeControlNames_
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.
prefixOSstream Pout(cout, "Pout")
OSstream Serr(cerr, "Serr")
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
virtual void setWriteInterval(const scalar writeInterval)
Reset the write interval.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
virtual bool write(const bool write=true) const
Write using setting from DB.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool write) const
Write the objects.
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.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.