41 setEnv(
"FOAM_APPLICATION", application,
false);
49 if (controlDict_.
found(
"DebugSwitches"))
52 <<
"Overriding DebugSwitches according to " << controlDict_.
name()
76 objects[i]->readData(is);
83 objects[i]->readData(iter().stream());
91 if (controlDict_.
found(
"OptimisationSwitches"))
94 <<
"Overriding OptimisationSwitches according to " 100 "OptimisationSwitches" 104 const word&
name = iter().keyword();
121 objects[i]->readData(is);
128 objects[i]->readData(iter().stream());
137 word fileHandlerName;
156 <<
"Overriding fileHandler to " << fileHandlerName <<
endl;
176 if (controlDict_.
found(
"DimensionedConstants"))
179 <<
"Overriding DimensionedConstants according to " 185 controlDict_.
subDict(
"DimensionedConstants")
199 objects[i]->readData(dummyIs);
205 objects[i]->writeData(
Info);
214 if (controlDict_.
found(
"DimensionSets"))
217 <<
"Overriding DimensionSets according to " 238 objects[i]->readData(is);
249 if (controlDict_.
found(
"writeControl"))
253 controlDict_.
lookup(
"writeControl")
268 <<
"writeInterval < 1 for writeControl timeStep" 305 <<
", should be >= 0, setting to 0" 312 if (controlDict_.
found(
"timeFormat"))
314 const word formatName(controlDict_.
lookup(
"timeFormat"));
316 if (formatName ==
"general")
320 else if (formatName ==
"fixed")
324 else if (formatName ==
"scientific")
331 <<
"unsupported time format " << formatName
340 if (controlDict_.
found(
"stopAt"))
360 if (controlDict_.
found(
"writeVersion"))
364 controlDict_.
lookup(
"writeVersion")
368 if (controlDict_.
found(
"writeFormat"))
372 controlDict_.
lookup(
"writeFormat")
376 if (controlDict_.
found(
"writePrecision"))
396 if (controlDict_.
found(
"writeCompression"))
400 controlDict_.
lookup(
"writeCompression")
410 <<
"Selecting compressed binary is inefficient and ineffective" 411 ", resetting to uncompressed binary" 419 controlDict_.
readIfPresent(
"runTimeModifiable", runTimeModifiable_);
437 if (controlDict_.regIOobject::read())
441 if (runTimeModifiable_)
462 if (runTimeModifiable_)
483 functionObjects_.
read();
485 if (runTimeModifiable_)
499 if (registryModified)
526 timeDict.
add(
"name",
string(tmName));
531 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.
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.
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...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
#define InfoHeader
Report write to Foam::Info if the local log switch is true.
set endTime to stop immediately w/ writing
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.
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.
virtual fileName filePath() const
Return complete path + object name if the file exists.
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.
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.
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.
const fileNameList & files() const
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.
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 successful.
const word & name() const
Name function is needed to disambiguate those inherited.
OSstream Sout(cout, "Sout")
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
virtual fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true) const =0
Return the file type: directory, file or link.
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.
simpleObjectRegistry & dimensionSetObjects()
Get access to registered dimensionSets switch objects.
void writeOnce()
Write the objects once (one shot) and continue the run.
static const NamedEnum< writeControl, 5 > writeControlNames_
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.
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.
#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 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.
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.