diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index 66365f9fec..1c9a6203f8 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -1483,6 +1483,21 @@ Foam::label Foam::polyMesh::findCell return -1; } + if + ( + Pstream::parRun() + && (decompMode == FACE_DIAG_TRIS || decompMode == CELL_TETS) + ) + { + // Force construction of face-diagonal decomposition before testing + // for zero cells. + // + // If parallel running a local domain might have zero cells so never + // construct the face-diagonal decomposition which uses parallel + // transfers. + (void)tetBasePtIs(); + } + if (decompMode == CELL_TETS) { // Advanced search method utilizing an octree @@ -1501,15 +1516,6 @@ Foam::label Foam::polyMesh::findCell // Approximate search avoiding the construction of an octree // and cell decomposition - if (Pstream::parRun() && decompMode == FACE_DIAG_TRIS) - { - // Force construction of face-diagonal decomposition before testing - // for zero cells. If parallel running a local domain might have - // zero cells so never construct the face-diagonal decomposition - // (which uses parallel transfers) - (void)tetBasePtIs(); - } - // Find the nearest cell centre to this location label celli = findNearestCell(p);