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