polyMesh: Ensure parallel consistency in findCell

by ensuring tetBasePtIs is called on all processors, even for those with
0 cells.  Also use unique communicator for globalMeshData to avoid data
transfer interference.

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1792
This commit is contained in:
Henry Weller
2015-10-21 12:47:02 +01:00
parent 766142b4cc
commit d95fc106b6
2 changed files with 18 additions and 7 deletions

View File

@ -2748,7 +2748,12 @@ void Foam::globalMeshData::updateMesh()
// *** Temporary hack to avoid problems with overlapping communication // *** Temporary hack to avoid problems with overlapping communication
// *** between these reductions and the calculation of deltaCoeffs // *** between these reductions and the calculation of deltaCoeffs
label comm = UPstream::worldComm + 1; label comm = UPstream::allocateCommunicator
(
UPstream::worldComm,
identity(UPstream::nProcs()),
true
);
// Total number of faces. // Total number of faces.
nTotalFaces_ = returnReduce nTotalFaces_ = returnReduce
@ -2785,6 +2790,8 @@ void Foam::globalMeshData::updateMesh()
comm comm
); );
UPstream::freeCommunicator(comm);
if (debug) if (debug)
{ {
Pout<< "globalMeshData : nTotalPoints_:" << nTotalPoints_ << endl; Pout<< "globalMeshData : nTotalPoints_:" << nTotalPoints_ << endl;

View File

@ -1478,12 +1478,11 @@ Foam::label Foam::polyMesh::findCell
const cellDecomposition decompMode const cellDecomposition decompMode
) const ) const
{ {
if (nCells() == 0) if
{ (
return -1; Pstream::parRun()
} && (decompMode == FACE_DIAG_TRIS || decompMode == CELL_TETS)
)
if (Pstream::parRun() && decompMode == FACE_DIAG_TRIS)
{ {
// Force construction of face-diagonal decomposition before testing // Force construction of face-diagonal decomposition before testing
// for zero cells. // for zero cells.
@ -1494,6 +1493,11 @@ Foam::label Foam::polyMesh::findCell
(void)tetBasePtIs(); (void)tetBasePtIs();
} }
if (nCells() == 0)
{
return -1;
}
if (decompMode == CELL_TETS) if (decompMode == CELL_TETS)
{ {
// Advanced search method utilizing an octree // Advanced search method utilizing an octree