diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index b36a0e9579c79c87147fe7cd047b35dd3208ee1f..5cf963fff3cddd78ea2f2f8d1ea4eff2eaf29bf0 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 4b8012b71d843b075e12ef16ec358098bf0d1f3a..67ae5db9b3441da0234704a6a38200545dfff97b 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -1478,12 +1478,11 @@ Foam::label Foam::polyMesh::findCell const cellDecomposition decompMode ) const { - if (nCells() == 0) - { - return -1; - } - - if (Pstream::parRun() && decompMode == FACE_DIAG_TRIS) + if + ( + Pstream::parRun() + && (decompMode == FACE_DIAG_TRIS || decompMode == CELL_TETS) + ) { // Force construction of face-diagonal decomposition before testing // for zero cells. @@ -1494,6 +1493,11 @@ Foam::label Foam::polyMesh::findCell (void)tetBasePtIs(); } + if (nCells() == 0) + { + return -1; + } + if (decompMode == CELL_TETS) { // Advanced search method utilizing an octree