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:
parent
277a7096b5
commit
1da3d4aa6f
2 changed files with 17 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue