mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
Time: Fix logical error in re-evaluation of running state
An unintended change in the running-state logic was introduced by commit
9a35ce69. The running state should only be re-evaluated when in the
simulation is not ending. The "execute/end" function object invocation
should not be permitted to change the running state. The simulation
should always end if this state is reached.
This commit is contained in:
@ -786,7 +786,7 @@ bool Foam::Time::running() const
|
|||||||
|
|
||||||
bool Foam::Time::run() const
|
bool Foam::Time::run() const
|
||||||
{
|
{
|
||||||
const bool running = this->running();
|
bool running = this->running();
|
||||||
|
|
||||||
if (!subCycling_)
|
if (!subCycling_)
|
||||||
{
|
{
|
||||||
@ -812,23 +812,23 @@ bool Foam::Time::run() const
|
|||||||
functionObjects_.execute();
|
functionObjects_.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Re-evaluate if running in case a function object has changed things
|
||||||
|
running = this->running();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-evaluate if running in case a function object has changed things
|
return running;
|
||||||
return this->running();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::Time::loop()
|
bool Foam::Time::loop()
|
||||||
{
|
{
|
||||||
const bool running = this->running();
|
|
||||||
|
|
||||||
if (run())
|
if (run())
|
||||||
{
|
{
|
||||||
operator++();
|
operator++();
|
||||||
}
|
}
|
||||||
|
|
||||||
return running;
|
return running();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user