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)); volVectorField gradT(fvc::grad(T));

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -81,7 +81,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
runTime++; ++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl; 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; Info<< "Calculating the magnetic field potential" << endl;
runTime++; ++runTime;
while (simple.correctNonOrthogonal()) while (simple.correctNonOrthogonal())
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -70,7 +70,7 @@ int main(int argc, char *argv[])
labelList cellToCoarse(identity(mesh.nCells())); labelList cellToCoarse(identity(mesh.nCells()));
labelListList coarseToCell(invertOneToMany(mesh.nCells(), cellToCoarse)); labelListList coarseToCell(invertOneToMany(mesh.nCells(), cellToCoarse));
runTime++; ++runTime;
// Write initial agglomeration // Write initial agglomeration
{ {
@ -103,7 +103,7 @@ int main(int argc, char *argv[])
for (label level = 0; level < agglom.size(); level++) for (label level = 0; level < agglom.size(); level++)
{ {
runTime++; ++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -73,7 +73,7 @@ int main(int argc, char *argv[])
Info<< "\nCorrecting boundary conditions on " << T.name() << nl << endl; Info<< "\nCorrecting boundary conditions on " << T.name() << nl << endl;
runTime++; ++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;

View File

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

View File

@ -67,7 +67,7 @@ int main(int argc, char *argv[])
runTime.printExecutionTime(Info); runTime.printExecutionTime(Info);
runTime++; ++runTime;
Pout<< "Writing particles to time " << runTime.timeName() << endl; Pout<< "Writing particles to time " << runTime.timeName() << endl;
particles.write(); particles.write();
} }

View File

@ -0,0 +1,3 @@
Test-timeSelector.C
EXE = $(FOAM_USER_APPBIN)/Test-timeSelector

View File

@ -0,0 +1 @@
/* EXE_INC = */

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,26 +22,65 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description Description
Searches the current case directory for valid times Test TimePaths and timeSelectop
and sets the time list to these.
This is done if a times File does not exist.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "Time.H" #include "argList.H"
#include "OSspecific.H" #include "IOstreams.H"
#include "StringStream.H" #include "TimePaths.H"
#include "timeSelector.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // using namespace Foam;
Foam::instantList Foam::Time::findTimes bool print(const instantList& instants)
(
const fileName& directory,
const word& constantName
)
{ {
return fileHandler().findTimes(directory, constantName); if (instants.empty())
{
Info<<" none" << nl << nl;
return false;
}
Info <<"(" << nl;
for (const instant& t : instants)
{
Info<<" " << t << nl;
}
Info<<")" << nl << nl;
return true;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::addNote("Test timeSelector");
timeSelector::addOptions(true, true);
argList::noLibs();
argList::noFunctionObjects();
#include "setRootCase.H"
autoPtr<TimePaths> timePaths;
instantList times(TimePaths(args).times());
Info<<"Available times" << nl;
if (print(times))
{
times = timeSelector::select(times, args);
Info<< "Selected times" << nl;
print(times);
}
return 0;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -57,7 +57,7 @@ int main(int argc, char *argv[])
const volScalarField& y = wallDist::New(mesh).y(); const volScalarField& y = wallDist::New(mesh).y();
y.write(); y.write();
runTime++; ++runTime;
Info<< "Time now = " << runTime.timeName() << endl; Info<< "Time now = " << runTime.timeName() << endl;

View File

@ -1021,7 +1021,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
Info<< "Writing mesh without blockedCells to time " << runTime.value() Info<< "Writing mesh without blockedCells to time " << runTime.value()
@ -1157,7 +1157,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
// Change the mesh. Change points directly (no inflation). // Change the mesh. Change points directly (no inflation).

View File

@ -240,7 +240,7 @@ int main(int argc, char *argv[])
// Write resulting mesh // Write resulting mesh
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
else else
{ {

View File

@ -409,7 +409,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }

View File

@ -554,7 +554,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
else else
{ {
@ -630,7 +630,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
else else
{ {
@ -675,7 +675,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
else else
{ {

View File

@ -167,7 +167,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
// Create mesh, return map from old to new mesh. // Create mesh, return map from old to new mesh.

View File

@ -220,7 +220,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false); autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);

View File

@ -170,7 +170,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
else else
{ {

View File

@ -682,7 +682,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false); autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);

View File

@ -1647,7 +1647,7 @@ int main(int argc, char *argv[])
word meshInstance; word meshInstance;
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
meshInstance = runTime.timeName(); meshInstance = runTime.timeName();
} }
else else

View File

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

View File

@ -571,7 +571,7 @@ int main(int argc, char *argv[])
if (writeMesh) if (writeMesh)
{ {
runTime++; ++runTime;
Info<< "Writing mesh to " << runTime.timeName() << endl; Info<< "Writing mesh to " << runTime.timeName() << endl;
backgroundMesh.mesh().write(); backgroundMesh.mesh().write();
} }

View File

@ -206,7 +206,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
else else
{ {

View File

@ -56,7 +56,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
Info<< "Time = " << runTime.timeName() << nl Info<< "Time = " << runTime.timeName() << nl

View File

@ -222,7 +222,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }

View File

@ -832,7 +832,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
// Change the mesh. Change points directly (no inflation). // Change the mesh. Change points directly (no inflation).

View File

@ -895,7 +895,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
else else
{ {

View File

@ -443,7 +443,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
// Change the mesh. No inflation. // Change the mesh. No inflation.
@ -513,7 +513,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
// Change the mesh. No inflation. // Change the mesh. No inflation.

View File

@ -76,7 +76,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
mesh.setInstance(runTime.timeName()); mesh.setInstance(runTime.timeName());
} }

View File

@ -541,7 +541,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
else else
{ {

View File

@ -322,7 +322,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }

View File

@ -1050,7 +1050,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }

View File

@ -267,7 +267,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }
splitter.attach(); splitter.attach();

View File

@ -1944,7 +1944,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
mesh.setInstance(runTime.timeName()); mesh.setInstance(runTime.timeName());
} }
else else
@ -1992,7 +1992,7 @@ int main(int argc, char *argv[])
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
} }

View File

@ -603,7 +603,7 @@ int main(int argc, char *argv[])
// Advance time for intermediate results or only on final // Advance time for intermediate results or only on final
if (!overwrite && (intermediate || actioni == nActions)) if (!overwrite && (intermediate || actioni == nActions))
{ {
runTime++; ++runTime;
} }
// Execute all polyMeshModifiers // Execute all polyMeshModifiers

View File

@ -591,7 +591,7 @@ int main(int argc, char *argv[])
} }
else else
{ {
runTime++; ++runTime;
subsetter.subMesh().setInstance(runTime.timeName()); subsetter.subMesh().setInstance(runTime.timeName());
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -29,25 +29,28 @@ Group
Description Description
List times using timeSelector. List times using timeSelector.
To simplify parsing of the output, the normal banner information The normal banner information is suppressed.
is suppressed.
Usage Usage
\b foamListTimes [OPTION] \b foamListTimes [OPTION]
Options: Options:
- \par -processor
List times from processor0/ directory
- \par -rm - \par -rm
Remove selected time directories Remove selected time directories
- \par -processor - \par -verbose
List times from processor0/ directory Report progress during removal
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "argList.H" #include "argList.H"
#include "autoPtr.H"
#include "profiling.H" #include "profiling.H"
#include "timeSelector.H" #include "timeSelector.H"
#include "Time.H" #include "TimePaths.H"
using namespace Foam; using namespace Foam;
@ -72,15 +75,24 @@ int main(int argc, char *argv[])
"rm", "rm",
"remove selected time directories" "remove selected time directories"
); );
argList::addBoolOption
(
"verbose",
"report progress of -rm option"
);
profiling::disable(); // Disable profiling (and its output) profiling::disable(); // Disable profiling (and its output)
#include "setRootCase.H" #include "setRootCase.H"
const bool removeFiles(args.found("rm"));
const bool verbose(args.found("verbose"));
// Get times list from the master processor and subset based on // Get times list from the master processor and subset based on
// command-line options // command-line options
label nProcs = 0; label nProcs = 0;
instantList timeDirs; autoPtr<TimePaths> timePaths;
if (args.found("processor")) if (args.found("processor"))
{ {
@ -94,47 +106,48 @@ int main(int argc, char *argv[])
<< exit(FatalError); << exit(FatalError);
} }
timeDirs = timeSelector::select timePaths = autoPtr<TimePaths>::New
( (
Time args.rootPath(),
( args.caseName()/"processor0"
Time::controlDictName,
args.rootPath(),
args.caseName()/"processor0"
).times(),
args
); );
} }
else else
{ {
timeDirs = timeSelector::select timePaths = autoPtr<TimePaths>::New
( (
Time args.rootPath(),
( args.caseName()
Time::controlDictName,
args.rootPath(),
args.caseName()
).times(),
args
); );
} }
if (args.found("rm")) const instantList timeDirs(timeSelector::select(timePaths->times(), args));
const label nTimes = timeDirs.size();
if (removeFiles)
{ {
if (nProcs) if (nProcs)
{ {
// Serr<< "Remove " << timeDirs.size() if (verbose)
// << " processor time directories" << nl; {
Info<< "Removing " << nTimes
<< " processor time directories" << endl;
}
forAllReverse(timeDirs, timei) forAllReverse(timeDirs, timei)
{ {
fileName path const word& timeName = timeDirs[timei].name();
(
args.path() if (verbose)
/ "processors" {
/ timeDirs[timei].name() Info<< " rm " << timeName
); << " [" << (nTimes - timei) << '/' << nTimes << ']'
<< endl;
}
fileName path(args.path()/"processors"/timeName);
rmDir(path, true); rmDir(path, true);
@ -143,8 +156,8 @@ int main(int argc, char *argv[])
path = path =
( (
args.path() args.path()
/ (word("processor") + name(proci)) / ("processor" + Foam::name(proci))
/ timeDirs[timei].name() / timeName
); );
rmDir(path, true); rmDir(path, true);
@ -153,25 +166,36 @@ int main(int argc, char *argv[])
} }
else else
{ {
// Serr<< "Remove " << timeDirs.size() if (verbose)
// << " time directories" << nl; {
Info<< "Removing " << nTimes
<< " time directories" << endl;
}
forAllReverse(timeDirs, timei) forAllReverse(timeDirs, timei)
{ {
rmDir(args.path()/timeDirs[timei].name(), true); const word& timeName = timeDirs[timei].name();
if (verbose)
{
Info<< " rm " << timeName
<< " [" << (nTimes - timei) << '/' << nTimes << ']'
<< endl;
}
rmDir(args.path()/timeName, true);
} }
} }
} }
else else
{ {
forAll(timeDirs, timei) for (const instant& t : timeDirs)
{ {
Info<< timeDirs[timei].name() << nl; Info<< t.name() << nl;
} }
Info<< flush; Info<< flush;
} }
return 0; return 0;
} }

View File

@ -56,10 +56,11 @@ Usage
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "argList.H" #include "argList.H"
#include "autoPtr.H"
#include "profiling.H" #include "profiling.H"
#include "timeSelector.H" #include "timeSelector.H"
#include "Enum.H" #include "Enum.H"
#include "Time.H" #include "TimePaths.H"
using namespace Foam; using namespace Foam;
@ -292,7 +293,7 @@ int main(int argc, char *argv[])
// command-line options // command-line options
label nProcs = 0; label nProcs = 0;
wordList timeDirs; autoPtr<TimePaths> timePaths;
if (args.found("processor") && !Pstream::parRun()) if (args.found("processor") && !Pstream::parRun())
{ {
@ -308,45 +309,33 @@ int main(int argc, char *argv[])
// Obtain time directory names from "processor0/" only // Obtain time directory names from "processor0/" only
timeDirs = ListOps::create<word> timePaths = autoPtr<TimePaths>::New
( (
timeSelector::select args.rootPath(),
( args.caseName()/"processor0"
Time
(
Time::controlDictName,
args.rootPath(),
args.caseName()/"processor0"
).times(),
args
),
[](const instant& t){ return t.name(); }
); );
} }
else else
{ {
timeDirs = ListOps::create<word> timePaths = autoPtr<TimePaths>::New
( (
timeSelector::select args.rootPath(),
( args.caseName()
Time(Time::controlDictName, args).times(),
args
),
[](const instant& t){ return t.name(); }
); );
Pstream::scatter(timeDirs);
} }
const instantList timeDirs(timeSelector::select(timePaths->times(), args));
if (timeDirs.empty()) if (timeDirs.empty())
{ {
Info<< "no times selected" << nl; Info<< "no times selected" << nl;
} }
for (const word& dirName : timeDirs) for (const instant& t : timeDirs)
{ {
Info<< "\nTime = " << dirName << nl; const word& timeName = t.name();
Info<< "\nTime = " << timeName << nl;
label count = 0; label count = 0;
@ -354,7 +343,7 @@ int main(int argc, char *argv[])
{ {
const wordHashSet files const wordHashSet files
( (
getFiles(args.path()/"processor0", dirName) getFiles(args.path()/"processor0", timeName)
); );
for (label proci=0; proci < nProcs; ++proci) for (label proci=0; proci < nProcs; ++proci)
@ -362,7 +351,7 @@ int main(int argc, char *argv[])
count += restoreFields count += restoreFields
( (
method, method,
args.path()/("processor" + Foam::name(proci))/dirName, args.path()/("processor" + Foam::name(proci))/timeName,
files, files,
targetNames targetNames
); );
@ -373,14 +362,14 @@ int main(int argc, char *argv[])
wordList files; wordList files;
if (Pstream::master()) if (Pstream::master())
{ {
files = getFiles(args.path(), dirName); files = getFiles(args.path(), timeName);
} }
Pstream::scatter(files); Pstream::scatter(files);
count += restoreFields count += restoreFields
( (
method, method,
args.path()/dirName, args.path()/timeName,
wordHashSet(files), wordHashSet(files),
targetNames targetNames
); );

View File

@ -1156,7 +1156,7 @@ autoPtr<mapDistributePolyMesh> redistributeAndWrite
if (!overwrite) if (!overwrite)
{ {
runTime++; ++runTime;
mesh.setInstance(runTime.timeName()); mesh.setInstance(runTime.timeName());
} }
else else

View File

@ -65,7 +65,7 @@ int main(int argc, char *argv[])
{ {
scalar t0 = runTime.userTimeToTime(ca0 - runTime.theta()); scalar t0 = runTime.userTimeToTime(ca0 - runTime.theta());
runTime.setDeltaT(t0); runTime.setDeltaT(t0);
runTime++; ++runTime;
Info<< "CA = " << runTime.theta() << endl; Info<< "CA = " << runTime.theta() << endl;
mesh.move(); mesh.move();
} }
@ -76,7 +76,7 @@ int main(int argc, char *argv[])
{ {
scalar t1 = runTime.userTimeToTime(ca1 - runTime.theta()); scalar t1 = runTime.userTimeToTime(ca1 - runTime.theta());
runTime.setDeltaT(t1); runTime.setDeltaT(t1);
runTime++; ++runTime;
Info<< "CA = " << runTime.theta() << endl; Info<< "CA = " << runTime.theta() << endl;
mesh.move(); mesh.move();
} }

View File

@ -324,7 +324,7 @@ int main(int argc, char *argv[])
Info<< endl; Info<< endl;
runTime++; ++runTime;
// Write resulting mesh // Write resulting mesh
Info<< "Writing modified mesh to time " << runTime.value() << endl; Info<< "Writing modified mesh to time " << runTime.value() << endl;

View File

@ -84,7 +84,7 @@ _of_complete_cache_[foamDataToFluent]="-case -fileHandler -listScalarBCs -listVe
_of_complete_cache_[foamDictionary]="-add -case -decomposeParDict -diff -diff-etc -entry -fileHandler -hostRoots -roots -set | -disableFunctionEntries -expand -includes -keywords -noFunctionObjects -parallel -remove -value -doc -doc-source -help -help-full" _of_complete_cache_[foamDictionary]="-add -case -decomposeParDict -diff -diff-etc -entry -fileHandler -hostRoots -roots -set | -disableFunctionEntries -expand -includes -keywords -noFunctionObjects -parallel -remove -value -doc -doc-source -help -help-full"
_of_complete_cache_[foamFormatConvert]="-case -decomposeParDict -fileHandler -hostRoots -listScalarBCs -listVectorBCs -region -roots -time | -constant -enableFunctionEntries -latestTime -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -newTimes -noConstant -noFunctionObjects -noZero -parallel -doc -doc-source -help -help-full" _of_complete_cache_[foamFormatConvert]="-case -decomposeParDict -fileHandler -hostRoots -listScalarBCs -listVectorBCs -region -roots -time | -constant -enableFunctionEntries -latestTime -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -newTimes -noConstant -noFunctionObjects -noZero -parallel -doc -doc-source -help -help-full"
_of_complete_cache_[foamListRegions]="-case -fileHandler | -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -doc -doc-source -help -help-full" _of_complete_cache_[foamListRegions]="-case -fileHandler | -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -doc -doc-source -help -help-full"
_of_complete_cache_[foamListTimes]="-case -fileHandler -time | -constant -latestTime -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -newTimes -noZero -processor -rm -withZero -doc -doc-source -help -help-full" _of_complete_cache_[foamListTimes]="-case -fileHandler -time | -constant -latestTime -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -newTimes -noZero -processor -rm -verbose -withZero -doc -doc-source -help -help-full"
_of_complete_cache_[foamMeshToFluent]="-case -fileHandler | -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -noFunctionObjects -doc -doc-source -help -help-full" _of_complete_cache_[foamMeshToFluent]="-case -fileHandler | -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -noFunctionObjects -doc -doc-source -help -help-full"
_of_complete_cache_[foamRestoreFields]="-case -decomposeParDict -fileHandler -hostRoots -method -roots -time | -constant -dry-run -latestTime -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -newTimes -noZero -parallel -processor -verbose -withZero -doc -doc-source -help -help-full" _of_complete_cache_[foamRestoreFields]="-case -decomposeParDict -fileHandler -hostRoots -method -roots -time | -constant -dry-run -latestTime -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -newTimes -noZero -parallel -processor -verbose -withZero -doc -doc-source -help -help-full"
_of_complete_cache_[foamToEnsight]="-case -cellZone -decomposeParDict -faceZones -fields -fileHandler -hostRoots -listScalarBCs -listVectorBCs -name -patches -region -roots -time -width | -ascii -constant -latestTime -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -newTimes -noFunctionObjects -noLagrangian -noPatches -noZero -nodeValues -parallel -doc -doc-source -help -help-full" _of_complete_cache_[foamToEnsight]="-case -cellZone -decomposeParDict -faceZones -fields -fileHandler -hostRoots -listScalarBCs -listVectorBCs -name -patches -region -roots -time -width | -ascii -constant -latestTime -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -newTimes -noFunctionObjects -noLagrangian -noPatches -noZero -nodeValues -parallel -doc -doc-source -help -help-full"

View File

@ -286,7 +286,6 @@ $(Time)/TimePaths.C
$(Time)/TimeState.C $(Time)/TimeState.C
$(Time)/Time.C $(Time)/Time.C
$(Time)/TimeIO.C $(Time)/TimeIO.C
$(Time)/findTimes.C
$(Time)/subCycleTime.C $(Time)/subCycleTime.C
$(Time)/subLoopTime.C $(Time)/subLoopTime.C
$(Time)/timeSelector.C $(Time)/timeSelector.C

View File

@ -244,21 +244,42 @@ void inplaceUniqueSort
); );
//- Extract elements of List when select is true //- Extract elements of the input List when select is true.
// eg, to extract all selected elements: //
// \param select the bool-list selector, for which the operator[]
// returns true or false. A labelHashSet can also be used since
// it satisfies these requirements
// \param input the list input values. Cannot be a FixedList since
// it doesn't resize.
// \param invert set as true to invert the selection logic
//
// Eg, to extract all selected elements:
// \code
// subset<boolList, labelList>(selectedElems, list); // subset<boolList, labelList>(selectedElems, list);
// Note a labelHashSet can also be used as the bool-list. // \endcode
// Do not use FixedList for the input list, since it doesn't resize.
template<class BoolListType, class ListType> template<class BoolListType, class ListType>
ListType subset(const BoolListType& select, const ListType& input); ListType subset
(
const BoolListType& select,
const ListType& input,
const bool invert=false
);
//- Inplace extract elements of List when select is true //- Inplace extract elements of the input List when select is true.
// eg, to extract all selected elements: //
// inplaceSubset<boolList, labelList>(selectedElems, list); // \param select the bool-list selector, for which the operator[]
// Note a labelHashSet can also be used as the bool-list. // returns true or false. A labelHashSet can also be used since
// Do not use FixedList for the input list, since it doesn't resize. // it satisfies these requirements
// \param input the list input values. Cannot be a FixedList since
// it doesn't resize.
// \param invert set as true to invert the selection logic
template<class BoolListType, class ListType> template<class BoolListType, class ListType>
void inplaceSubset(const BoolListType& select, ListType& input); void inplaceSubset
(
const BoolListType& select,
ListType& input,
const bool invert=false
);
//- Copy a subset of the input list when predicate is true. //- Copy a subset of the input list when predicate is true.

Some files were not shown because too many files have changed in this diff Show More