diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index b36a0e95..5cf963ff 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C @@ -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; diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index a8156d24..8f02d1fd 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -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; } }