Added syncPar switch to enable/disable parallel comms in polyMesh

This commit is contained in:
Hrvoje Jasak 2019-02-13 14:35:33 +00:00
parent 6104042c17
commit 76d57ed7fd
4 changed files with 33 additions and 2 deletions

View file

@ -227,6 +227,7 @@ Foam::polyMesh::polyMesh(const IOobject& io)
IOobject::NO_WRITE
)
),
syncPar_(true), // Reading mesh from IOobject: must be valid
clearedPrimitives_(false),
boundary_
(
@ -241,7 +242,7 @@ Foam::polyMesh::polyMesh(const IOobject& io)
),
*this
),
bounds_(allPoints_),
bounds_(allPoints_), // Reading mesh from IOobject: syncPar
geometricD_(Vector<label>::zero),
solutionD_(Vector<label>::zero),
comm_(Pstream::worldComm),
@ -319,7 +320,6 @@ Foam::polyMesh::polyMesh(const IOobject& io)
"cells",
// Find the cells file on the basis of the faces file
// HJ, 8/Jul/2009
// time().findInstance(meshDir(), "cells"),
time().findInstance(meshDir(), "faces"),
meshSubDir,
*this,
@ -424,6 +424,7 @@ Foam::polyMesh::polyMesh
),
neighbour
),
syncPar_(syncPar),
clearedPrimitives_(false),
boundary_
(
@ -585,6 +586,7 @@ Foam::polyMesh::polyMesh
),
0
),
syncPar_(syncPar),
clearedPrimitives_(false),
boundary_
(
@ -1177,6 +1179,14 @@ Foam::tmp<Foam::scalarField> Foam::polyMesh::movePoints
const pointField& newPoints
)
{
if (!syncPar_)
{
Info<< "tmp<scalarField> polyMesh::movePoints"
<< "(const pointField&) : "
<< "Moving the mesh for the mesh with syncPar invalidated. "
<< "Mesh motion should not be executed." << endl;
}
if (debug)
{
Info<< "tmp<scalarField> polyMesh::movePoints(const pointField&) : "

View file

@ -117,6 +117,9 @@ private:
//- Face neighbour
labelIOList neighbour_;
//- Is the mesh in a parallel sync state?
Switch syncPar_;
//- Have the primitives been cleared
bool clearedPrimitives_;
@ -374,12 +377,27 @@ public:
return boundary_;
}
// Mesh state and form
//- Return mesh bounding box
const boundBox& bounds() const
{
return bounds_;
}
//- Return parallel sync state
const Switch& syncPar() const
{
return syncPar_;
}
//- Return access to parallel sync state
Switch& syncPar()
{
return syncPar_;
}
//- Return the vector of geometric directions in mesh.
// Defined according to the presence of empty and wedge patches.
// 1 indicates unconstrained direction and -1 a constrained

View file

@ -489,6 +489,7 @@ Foam::polyMesh::polyMesh
),
0
),
syncPar_(syncPar),
clearedPrimitives_(false),
boundary_
(
@ -774,6 +775,7 @@ Foam::polyMesh::polyMesh
),
0
),
syncPar_(syncPar),
clearedPrimitives_(false),
boundary_
(

View file

@ -97,6 +97,7 @@ Foam::polyMesh::polyMesh
),
labelList(is)
),
syncPar_(syncPar),
clearedPrimitives_(false),
boundary_
(