mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- Less looping when detecting lagrangian clouds and their fields. - Avoid using Time::setTime() and IOobjectList in tight loops. They both kill performance immensely. ENH: provide a -noLagrangian option to foamToEnsight and foamToEnsightParts for even more control.
51 lines
1.2 KiB
C
51 lines
1.2 KiB
C
// check for "points" in any of the result directories
|
|
|
|
bool meshMoving = false;
|
|
|
|
if (timeDirs.size() > 1 && Pstream::master())
|
|
{
|
|
// We already loaded a mesh (usually from constant).
|
|
// See if any other "polyMesh/points" files exist too.
|
|
|
|
const fileName& baseDir = mesh.time().path();
|
|
|
|
Info<< "Search for moving mesh ... " << flush;
|
|
forAll(timeDirs, timeI)
|
|
{
|
|
const word& timeName = timeDirs[timeI].name();
|
|
|
|
meshMoving =
|
|
(
|
|
timeName != mesh.pointsInstance()
|
|
&& isDir(baseDir/timeName/polyMesh::meshSubDir)
|
|
&& IOobject
|
|
(
|
|
"points",
|
|
timeName,
|
|
polyMesh::meshSubDir,
|
|
mesh,
|
|
IOobject::NO_READ,
|
|
IOobject::NO_WRITE,
|
|
false // no register
|
|
).typeHeaderOk<pointIOField>(true)
|
|
);
|
|
|
|
if (meshMoving)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (meshMoving)
|
|
{
|
|
Info<< "found." << nl
|
|
<< " Writing meshes for every timestep." << endl;
|
|
}
|
|
else
|
|
{
|
|
Info<< "none detected." << endl;
|
|
}
|
|
}
|
|
|
|
reduce(meshMoving, orOp<bool>());
|