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 args
); );
instantList masterTimeDirs = runTime.times();
if (timeDirs.empty()) if (timeDirs.empty())
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
@ -152,6 +150,16 @@ int main(int argc, char *argv[])
<< exit(FatalError); << exit(FatalError);
} }
// Get current times if -newTimes
instantList masterTimeDirs;
if (newTimes)
{
masterTimeDirs = runTime.times();
}
# include "createNamedMesh.H" # include "createNamedMesh.H"
word regionDir = word::null; word regionDir = word::null;
if (regionName != fvMesh::defaultRegion) if (regionName != fvMesh::defaultRegion)
@ -176,12 +184,25 @@ int main(int argc, char *argv[])
// Loop over all times // Loop over all times
forAll(timeDirs, timeI) forAll(timeDirs, timeI)
{ {
if (newTimes && findIndex(masterTimeDirs, timeDirs[timeI]) != -1) if (newTimes)
{
// 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() Info<< "Skipping time " << timeDirs[timeI].name()
<< endl << endl; << endl << endl;
continue; continue;
} }
}
// Set time for global database // Set time for global database