42 SIMPLEControlSingleRun,
57 label nItersOld = nIters_;
58 nIters_ =
dict().
get<label>(
"nIters");
60 if (nIters_ != nItersOld || iter_ == 0)
79 Time& time =
const_cast<Time&
>(mesh_.time());
81 if (time.endTime().value() != endTime_)
83 time.setEndTime(startTime_ + nIters_);
84 endTime_ = time.endTime().value();
93Foam::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 "
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
const Time & time() const noexcept
Return Time associated with the objectRegistry.
SIMPLE control class for single runs (i.e. not optimisation). Time acts as in simpleFoam,...
virtual bool write(const bool valid=true) const
Whether to call time.write() or not.
void writeNow()
Write fields, even if it is not a writeTime.
virtual void readIters()
Set end time if number of iters has changed.
void checkEndTime(bool &isRunning)
Check whether endTime has been overwritten by a run-time modification of controlDict.
scalar startTime_
Start time.
virtual bool read()
Read controls from optimisationDict.
SIMPLE control class to supply convergence information/checks for the SIMPLE loop.
label nIters_
Number of SIMPLE iterations.
void checkMeanSolution() const
virtual bool read()
Read controls from optimisationDict.
bool writeTime() const noexcept
True if this is a write interval.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual bool loop()
Return true if run should continue and if so increment time.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
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.
Mesh data needed to do the Finite Volume discretisation.
bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
bool initialised_
Initialised flag.
fvMesh & mesh_
Reference to the mesh database.
virtual void storePrevIterFields() const
Store previous iteration fields.
virtual void setFirstIterFlag(const bool check=true, const bool force=false)
Set the firstIteration flag on the mesh data dictionary.
const solver & solver_
Reference to the underlaying solver.
label iter_
Current iteration index.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
bool read(const char *buf, int32_t &val)
Same as readInt32.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
constexpr char nl
The newline '\n' character (0x0a).
static bool initialised_(false)