change solvers, utilities, etc. to use while (..) time-looping idiom

- this (now deprecated) idiom:
      for (runTime++; !runTime.end(); runTime++) { ... }
  has a few problems:
    * stop-on-next-write will be off-by-one (ie, doesn't work)
    * function objects are not executed on exit with runTime.end()
  Fixing these problems is not really possible.

- this idiom
      while (runTime.run())
      {
          runTime++;
          ...
      }
  works without the above problems.
This commit is contained in:
Mark Olesen
2009-02-17 08:47:42 +01:00
parent 5e7339fe15
commit c2256e51f3
37 changed files with 72 additions and 37 deletions

View File

@ -52,8 +52,9 @@ int main(int argc, char *argv[])
Info<< "\nStarting time loop\n" << endl;
for (runTime++; !runTime.end(); runTime++)
while (runTime.run())
{
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H"

View File

@ -54,8 +54,9 @@ int main(int argc, char *argv[])
Info<< "\nStarting time loop\n" << endl;
for (runTime++; !runTime.end(); runTime++)
while (runTime.run())
{
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H"