ENH: reconstructPar: -newTimes cleanup

This commit is contained in:
mattijs
2012-07-02 15:33:50 +01:00
parent fddfec04c3
commit 32f31a4fef

View File

@ -143,8 +143,6 @@ int main(int argc, char *argv[])
args
);
instantList masterTimeDirs = runTime.times();
if (timeDirs.empty())
{
FatalErrorIn(args.executable())
@ -152,6 +150,16 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
// Get current times if -newTimes
instantList masterTimeDirs;
if (newTimes)
{
masterTimeDirs = runTime.times();
}
# include "createNamedMesh.H"
word regionDir = word::null;
if (regionName != fvMesh::defaultRegion)
@ -176,11 +184,24 @@ int main(int argc, char *argv[])
// Loop over all times
forAll(timeDirs, timeI)
{
if (newTimes && findIndex(masterTimeDirs, timeDirs[timeI]) != -1)
if (newTimes)
{
Info<< "Skipping time " << timeDirs[timeI].name()
<< endl << endl;
continue;
// Compare on timeName, not value
bool foundTime = false;
forAll(masterTimeDirs, i)
{
if (masterTimeDirs[i].name() == timeDirs[timeI].name())
{
foundTime = true;
break;
}
}
if (foundTime)
{
Info<< "Skipping time " << timeDirs[timeI].name()
<< endl << endl;
continue;
}
}