mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Time: Moved functionObject execution from "++" to "loop"
This change allows functionObjects to cleanly terminate the code e.g. on convergence.
This commit is contained in:
@ -518,11 +518,28 @@ bool Foam::Time::loop()
|
|||||||
|
|
||||||
if (running)
|
if (running)
|
||||||
{
|
{
|
||||||
operator++();
|
if (!subCycling_)
|
||||||
|
{
|
||||||
|
readModifiedObjects();
|
||||||
|
|
||||||
|
if (timeIndex_ == startTimeIndex_)
|
||||||
|
{
|
||||||
|
functionObjects_.start();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
functionObjects_.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check update the "running" status following the "++" operation
|
// Check update the "running" status following the "++" operation
|
||||||
// to take into account possible side-effects from functionObjects
|
// to take into account possible side-effects from functionObjects
|
||||||
running = run();
|
running = run();
|
||||||
|
|
||||||
|
if (running)
|
||||||
|
{
|
||||||
|
operator++();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return running;
|
return running;
|
||||||
@ -667,20 +684,6 @@ Foam::Time& Foam::Time::operator+=(const scalar deltaT)
|
|||||||
|
|
||||||
Foam::Time& Foam::Time::operator++()
|
Foam::Time& Foam::Time::operator++()
|
||||||
{
|
{
|
||||||
if (!subCycling_)
|
|
||||||
{
|
|
||||||
readModifiedObjects();
|
|
||||||
|
|
||||||
if (timeIndex_ == startTimeIndex_)
|
|
||||||
{
|
|
||||||
functionObjects_.start();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
functionObjects_.execute();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
deltaT0_ = deltaTSave_;
|
deltaT0_ = deltaTSave_;
|
||||||
deltaTSave_ = deltaT_;
|
deltaTSave_ = deltaT_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user