38 setEnv(
"FOAM_APPLICATION", application,
false);
46 if (controlDict_.
found(
"writeControl"))
50 controlDict_.
lookup(
"writeControl")
56 if (controlDict_.
readIfPresent(
"writeInterval", newWriteInterval))
70 &&
label(newWriteInterval) < 1
74 <<
"writeInterval < 1 for writeControl timeStep" 80 controlDict_.
lookup(
"writeFrequency") >> newWriteInterval;
91 <<
", should be >= 0, setting to 0" 98 if (controlDict_.
found(
"timeFormat"))
100 const word formatName(controlDict_.
lookup(
"timeFormat"));
102 if (formatName ==
"general")
106 else if (formatName ==
"fixed")
110 else if (formatName ==
"scientific")
117 <<
"unsupported time format " << formatName
127 if (controlDict_.
found(
"stopAt"))
147 if (controlDict_.
found(
"writeVersion"))
151 controlDict_.
lookup(
"writeVersion")
155 if (controlDict_.
found(
"writeFormat"))
159 controlDict_.
lookup(
"writeFormat")
163 if (controlDict_.
found(
"writePrecision"))
167 controlDict_.
lookup<
unsigned int>(
"writePrecision")
183 if (controlDict_.
found(
"writeCompression"))
187 controlDict_.
lookup(
"writeCompression")
197 <<
"Selecting compressed binary is inefficient and ineffective" 198 ", resetting to uncompressed binary" 206 controlDict_.
readIfPresent(
"runTimeModifiable", runTimeModifiable_);
214 if (controlDict_.regIOobject::read())
229 if (runTimeModifiable_)
250 functionObjects_.
read();
255 if (registryModified)
283 timeDict.
add(
"name",
string(tmName));
284 timeDict.
add(
"index", timeIndex_);
288 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
FvWallInfoData< WallInfo, label > 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.
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.
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)
static int curPrecision_
Current time directory name precision adjusted as necessary.
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_
timeIOdictionary derived from IOdictionary with globalFile set false to enable writing to processor t...
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")
scalar userTimeToTime(const scalar tau) const
Convert the user-time (e.g. CA deg) to real-time (s).
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.
scalar timeToUserTime(const scalar t) const
Convert the real-time (s) into user-time (e.g. CA deg)
virtual bool write(const bool write=true) const
Write using setting from DB.
fileName path() const
Return complete path.
autoPtr< userTimes::userTime > userTime_
Optional user-time, defaults to realTime in s.
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.