diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index 8e18dc786115461aa752148dfd340ca64ed90ddc..36bccb3911c0c4ae3725556ad5eef14e568972db 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -518,11 +518,28 @@ bool Foam::Time::loop() if (running) { - operator++(); + if (!subCycling_) + { + readModifiedObjects(); + + if (timeIndex_ == startTimeIndex_) + { + functionObjects_.start(); + } + else + { + functionObjects_.execute(); + } + } // Check update the "running" status following the "++" operation // to take into account possible side-effects from functionObjects running = run(); + + if (running) + { + operator++(); + } } return running; @@ -667,20 +684,6 @@ Foam::Time& Foam::Time::operator+=(const scalar deltaT) Foam::Time& Foam::Time::operator++() { - if (!subCycling_) - { - readModifiedObjects(); - - if (timeIndex_ == startTimeIndex_) - { - functionObjects_.start(); - } - else - { - functionObjects_.execute(); - } - } - deltaT0_ = deltaTSave_; deltaTSave_ = deltaT_;