openfoam/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkMeshMoving.H
Mark Olesen e57ca15bda ENH: complete reworking of foamToEnsight to make into a library (issue #241)
- eliminate ensightAsciiStream, ensightBinaryStream, ensightStream in
  favour of using ensightFile and ensightGeoFile classes throughout.

- encapsulate mesh-parts sorting with the ensightCells, ensightFaces
  class.

- handle of patches/faceZones entirely within ensightMesh for a lighter
  interaction with field output. Both faceZones and point fields need
  more testing to see if they behave properly for all cases.

- move some output functionality into its own namespace
  'ensightOutput', move into a library.

- use the ensightCase class to open new ensight output streams
  in the proper sub-directory locations.
2016-10-06 10:43:22 +02:00

50 lines
1.1 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. Writing meshes for every timestep." << endl;
}
else
{
Info<< "none detected." << endl;
}
}
reduce(meshMoving, orOp<bool>());