BUG: using Time::run() as a loop construct was not doing the functionObjects.

This commit is contained in:
mattijs
2010-04-15 12:22:56 +01:00
parent 21b283779c
commit d4ca02cf7e

View File

@ -508,19 +508,11 @@ bool Foam::Time::run() const
}
}
return running;
}
bool Foam::Time::loop()
{
bool running = run();
if (running)
{
if (!subCycling_)
{
readModifiedObjects();
const_cast<Time&>(*this).readModifiedObjects();
if (timeIndex_ == startTimeIndex_)
{
@ -532,15 +524,23 @@ bool Foam::Time::loop()
}
}
// Check update the "running" status following the "++" operation
// to take into account possible side-effects from functionObjects
running = run();
// Update the "running" status following the
// possible side-effects from functionObjects
running = value() < (endTime_ - 0.5*deltaT_);
}
return running;
}
bool Foam::Time::loop()
{
bool running = run();
if (running)
{
operator++();
}
}
return running;
}