mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
reconstructPar: -newTimes no longer constructs the mesh if all times are already reconstructed
This commit is contained in:
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -43,6 +43,24 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool haveAllTimes
|
||||||
|
(
|
||||||
|
const HashSet<word>& masterTimeDirSet,
|
||||||
|
const instantList& timeDirs
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// Loop over all times
|
||||||
|
forAll(timeDirs, timeI)
|
||||||
|
{
|
||||||
|
if (!masterTimeDirSet.found(timeDirs[timeI].name()))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::addNote
|
argList::addNote
|
||||||
@ -169,6 +187,11 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
masterTimeDirs = runTime.times();
|
masterTimeDirs = runTime.times();
|
||||||
}
|
}
|
||||||
|
HashSet<word> masterTimeDirSet(2*masterTimeDirs.size());
|
||||||
|
forAll(masterTimeDirs, i)
|
||||||
|
{
|
||||||
|
masterTimeDirSet.insert(masterTimeDirs[i].name());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Set all times on processor meshes equal to reconstructed mesh
|
// Set all times on processor meshes equal to reconstructed mesh
|
||||||
@ -222,6 +245,21 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "\n\nReconstructing fields for mesh " << regionName << nl
|
Info<< "\n\nReconstructing fields for mesh " << regionName << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
newTimes
|
||||||
|
&& regionNames.size() == 1
|
||||||
|
&& regionDirs[0].empty()
|
||||||
|
&& haveAllTimes(masterTimeDirSet, timeDirs)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Info<< "Skipping region " << regionName
|
||||||
|
<< " since already have all times"
|
||||||
|
<< endl << endl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fvMesh mesh
|
fvMesh mesh
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -245,25 +283,12 @@ int main(int argc, char *argv[])
|
|||||||
// Loop over all times
|
// Loop over all times
|
||||||
forAll(timeDirs, timeI)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
if (newTimes)
|
if (newTimes && masterTimeDirSet.found(timeDirs[timeI].name()))
|
||||||
{
|
|
||||||
// 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
|
||||||
|
|||||||
Reference in New Issue
Block a user