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:52:30 +01:00
parent 277a7096b5
commit 1da3d4aa6f
2 changed files with 17 additions and 3 deletions

View file

@ -2748,7 +2748,12 @@ void Foam::globalMeshData::updateMesh()
// *** Temporary hack to avoid problems with overlapping communication
// *** 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.
nTotalFaces_ = returnReduce
@ -2785,6 +2790,8 @@ void Foam::globalMeshData::updateMesh()
comm
);
UPstream::freeCommunicator(comm);
if (debug)
{
Pout<< "globalMeshData : nTotalPoints_:" << nTotalPoints_ << endl;

View file

@ -1478,7 +1478,11 @@ Foam::label Foam::polyMesh::findCell
const cellRepresentation decompMode
) const
{
if (Pstream::parRun() && decompMode == FACEDIAGTETS)
if
(
Pstream::parRun()
&& (decompMode == FACEDIAGTETS || decompMode == CELL_TETS)
)
{
// Force construction of face-diagonal decomposition before testing
// for zero cells. If parallel running a local domain might have zero
@ -1500,8 +1504,10 @@ Foam::label Foam::polyMesh::findCell
{
return cellI;
}
else // point is not in the nearest cell so search all cells
else
{
// point is not in the nearest cell so search all cells
for (label cellI = 0; cellI < nCells(); cellI++)
{
if (pointInCell(location, cellI, decompMode))
@ -1509,6 +1515,7 @@ Foam::label Foam::polyMesh::findCell
return cellI;
}
}
return -1;
}
}