Time: Added running method to check running state without side effects

chtMultiRegionSimpleFoam needs to check whether or not the simulation is
at the end. To facilitate this, a Time::running method has been added.
The Time::run method was being used for this purpose, but this lead to
function objects being executed multiple times.

This resolves bug report https://bugs.openfoam.org/view.php?id=2804
This commit is contained in:
Will Bainbridge
2018-01-05 15:24:14 +00:00
parent 8b44230384
commit 9a35ce69a3
3 changed files with 18 additions and 12 deletions

View File

@ -53,12 +53,12 @@ if (resControlUsed)
}
}
if (!runTime.run())
if (!runTime.running())
{
Info<< "\nRegions not converged after " << runTime.timeName()
<< " iterations" << endl;
}
else if (runTime.run() && resControlUsed && allRegionsConverged)
else if (runTime.running() && resControlUsed && allRegionsConverged)
{
Info<< "\nRegions converged after " << runTime.timeName()
<< " iterations" << endl;