checkMeshMoving.H
Go to the documentation of this file.
1 // Check for "points" in any of the result directories
2 
3 bool hasMovingMesh = false;
4 
5 if (timeDirs.size() > 1 && Pstream::master())
6 {
7  // We already loaded a mesh (usually from constant).
8  // See if any other "polyMesh/points" files exist too.
9 
10  Info<< "Search for moving mesh ... " << flush;
11  for (const instant& inst : timeDirs)
12  {
13  const word& timeName = inst.name();
14 
16  (
17  timeName != mesh.pointsInstance()
18  && IOobject
19  (
20  "points",
21  timeName,
22  polyMesh::meshSubDir,
23  mesh,
24  IOobject::NO_READ,
25  IOobject::NO_WRITE,
26  false // no register
27  ).typeHeaderOk<pointIOField>(true, false)
28  );
29 
30  if (hasMovingMesh)
31  {
32  break;
33  }
34  }
35 
36  if (hasMovingMesh)
37  {
38  Info<< "found. Writing meshes for every timestep." << endl;
39  }
40  else
41  {
42  Info<< "none detected." << endl;
43  }
44 }
45 
46 reduce(hasMovingMesh, orOp<bool>());
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::flush
Ostream & flush(Ostream &os)
Flush stream.
Definition: Ostream.H:342
Foam::pointIOField
vectorIOField pointIOField
pointIOField is a vectorIOField.
Definition: pointIOField.H:44
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
timeName
word timeName
Definition: getTimeIndex.H:3
reduce
reduce(hasMovingMesh, orOp< bool >())
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
hasMovingMesh
bool hasMovingMesh
Definition: checkMeshMoving.H:3