Commit d4ca02cf authored by mattijs's avatar mattijs
Browse files

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

parent 21b28377
......@@ -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,14 +524,22 @@ 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_);
}
if (running)
{
operator++();
}
return running;
}
bool Foam::Time::loop()
{
bool running = run();
if (running)
{
operator++();
}
return running;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment