57 label nItersOld = nIters_;
58 nIters_ =
dict().
get<label>(
"nIters");
60 if (nIters_ != nItersOld || iter_ == 0)
67 Info<<
"Setting endTime to " << startTime_ + nIters_ <<
endl;
79 Time& time =
const_cast<Time&
>(mesh_.time());
81 if (time.endTime().value() != endTime_)
83 time.setEndTime(startTime_ + nIters_);
84 endTime_ = time.endTime().value();
86 time.value() < (time.endTime().value() - 0.5*time.deltaTValue());
93 Foam::SIMPLEControlSingleRun::SIMPLEControlSingleRun
96 const word& managerType,
100 SIMPLEControl(
mesh, managerType, solver),
110 Time& time =
const_cast<Time&
>(mesh_.time());
120 Time& time =
const_cast<Time&
>(mesh_.time());
138 Time&
runTime =
const_cast<Time&
>(mesh_.time());
143 << solver_.solverName()
144 <<
" solution converged in " 163 checkEndTime(isRunning);
168 << solver_.solverName()
169 <<
" solution reached max. number of iterations " const Type & value() const noexcept
Return const reference to value.
static bool initialised_(false)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
SIMPLE control class for single runs (i.e. not optimisation). Time acts as in simpleFoam, with all solver control read through optimisationDict.
virtual void setEndTime(const dimensionedScalar &endTime)
Reset end time.
constexpr char nl
The newline '\n' character (0x0a)
virtual bool loop()
Return true if run should continue and if so increment time.
virtual bool read()
Read controls from optimisationDict.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual dimensionedScalar endTime() const
Return end time.
bool writeTime() const noexcept
True if this is a write interval.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
bool read(const char *buf, int32_t &val)
Same as readInt32.
virtual void setFirstIterFlag(const bool check=true, const bool force=false)
Set the firstIteration flag on the mesh data dictionary.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
virtual bool read()
Read controls from fvSolution dictionary.
virtual bool write(const bool valid=true) const
Whether to call time.write() or not.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
defineTypeNameAndDebug(combustionModel, 0)
void writeNow()
Write fields, even if it is not a writeTime.
virtual void storePrevIterFields() const
Store previous iteration fields.
void checkEndTime(bool &isRunning)
Check whether endTime has been overwritten by a run-time modification of controlDict.
virtual void readIters()
Set end time if number of iters has changed.
messageStream Info
Information stream (stdout output on master, null elsewhere)
bool writeNow()
Write the objects immediately (not at end of iteration) and continue the run.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)