ENH: improve controls for Time (issue #910)

- relocate some standard functionality to TimePaths to allow a lighter
  means of managing time directories without using the entire Time
  mechanism.

- optional enableLibs for Time construction (default is on)
  and a corresponding argList::noLibs() and "-no-libs" option

STYLE:

- mark Time::outputTime() as deprecated MAY-2016

- use pre-increment for runTime, although there is no difference in
  behaviour or performance.
This commit is contained in:
Mark Olesen
2018-07-02 10:20:01 +02:00
parent e8c1ae3c16
commit 2662042d49
120 changed files with 667 additions and 499 deletions

View File

@ -1,4 +1,4 @@
if (runTime.outputTime())
if (runTime.writeTime())
{
volVectorField gradT(fvc::grad(T));

View File

@ -115,7 +115,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "\n\nTime = " << runTime.timeName() << endl;
#include "rhoEqn.H"

View File

@ -101,8 +101,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
// Indicators for refinement. Note: before runTime++
// only for post-processing reasons.
// Indicators for refinement.
// Note: before ++runTime only for post-processing reasons.
tmp<volScalarField> tmagGradP = mag(fvc::grad(p));
volScalarField normalisedGradP
(
@ -112,7 +112,7 @@ int main(int argc, char *argv[])
normalisedGradP.writeOpt() = IOobject::AUTO_WRITE;
tmagGradP.clear();
runTime++;
++runTime;
Info<< "\n\nTime = " << runTime.timeName() << endl;

View File

@ -107,7 +107,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -95,7 +95,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;

View File

@ -92,7 +92,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"

View File

@ -73,7 +73,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "solveChemistry.H"

View File

@ -74,7 +74,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Engine time = " << runTime.theta() << runTime.unit()
<< endl;

View File

@ -79,7 +79,7 @@ int main(int argc, char *argv[])
#include "setMultiRegionDeltaT.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -85,7 +85,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -85,7 +85,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -87,7 +87,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -76,7 +76,7 @@ int main(int argc, char *argv[])
#include "readTimeControls.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -160,7 +160,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -81,7 +81,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -101,7 +101,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -106,7 +106,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -81,7 +81,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -78,7 +78,7 @@ int main(int argc, char *argv[])
Info<< "Calculating the magnetic field potential" << endl;
runTime++;
++runTime;
while (simple.correctNonOrthogonal())
{

View File

@ -67,7 +67,7 @@ int main(int argc, char *argv[])
#include "capillaryCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
@ -138,7 +138,7 @@ int main(int argc, char *argv[])
Us.correctBoundaryConditions();
}
if (runTime.outputTime())
if (runTime.writeTime())
{
vsm.mapToVolume(h, H.boundaryFieldRef());
vsm.mapToVolume(Us, U.boundaryFieldRef());

View File

@ -84,7 +84,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -73,7 +73,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -79,7 +79,7 @@ int main(int argc, char *argv[])
#include "solidRegionDiffusionNo.H"
#include "setMultiRegionDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -82,7 +82,7 @@ int main(int argc, char *argv[])
while (runTime.run())
{
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -69,7 +69,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -84,7 +84,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -104,7 +104,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -73,7 +73,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -75,7 +75,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -89,7 +89,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -90,7 +90,7 @@ int main(int argc, char *argv[])
#include "setMultiRegionDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -75,7 +75,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Engine time = " << runTime.theta() << runTime.unit() << endl;

View File

@ -83,7 +83,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -73,7 +73,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -98,7 +98,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -74,7 +74,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -69,7 +69,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop

View File

@ -94,7 +94,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -97,7 +97,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -97,7 +97,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -75,7 +75,7 @@ int main(int argc, char *argv[])
#include "alphaCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -80,7 +80,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -83,7 +83,7 @@ int main(int argc, char *argv[])
#include "alphaCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -85,7 +85,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -92,7 +92,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -90,7 +90,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -133,7 +133,7 @@
}
}
//if (runTime.outputTime())
//if (runTime.writeTime())
//{
// volScalarField("contPhiPcorr", fvc::div(phi)).write();
// pcorr.write();

View File

@ -118,7 +118,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -93,7 +93,7 @@ int main(int argc, char *argv[])
#include "alphaCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -104,7 +104,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -80,7 +80,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -86,7 +86,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop

View File

@ -78,7 +78,7 @@ int main(int argc, char *argv[])
#include "alphaCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -91,7 +91,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -70,7 +70,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -101,7 +101,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop

View File

@ -135,7 +135,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop

View File

@ -71,7 +71,7 @@ int main(int argc, char *argv[])
#include "alphaCourantNo.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -83,7 +83,7 @@ int main(int argc, char *argv[])
#include "CourantNos.H"
#include "setDeltaT.H"
runTime++;
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop