From 2faf3613545fda91367ea46b7d3f04666ab1a45b Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 24 Jan 2023 14:40:06 +0100 Subject: [PATCH] BUG: faMesh geometryOrder=1 blocks in parallel - with geometryOrder=1, edge normal calculation is done directly from the faces, whereas geometryOrder=2 they are calculated based on the point normals of each end. In both cases, the geometry calculation uses processor communication (with corresponding waitRequests etc). Since the final correction and the halo face normals also need collective communication, these routines must be triggered on all processors or they will block. Thus also include edgeAreaNormals() triggering in addition to pointAreaNormals() triggering. --- .../faMesh/faBoundaryMesh/faBoundaryMesh.C | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C b/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C index dee21f5617..82b497a3ad 100644 --- a/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C +++ b/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2017 Wikki Ltd - Copyright (C) 2018-2022 OpenCFD Ltd. + Copyright (C) 2018-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -180,10 +180,20 @@ Foam::faBoundaryMesh::faBoundaryMesh void Foam::faBoundaryMesh::calcGeometry() { - // processorFaPatch geometry triggers calculation of pointNormals. + // processor initGeometry send/recv the following: + // - edgeCentres() : faMesh::edgeCentres() + // - edgeLengths() : faMesh::Le() + // - edgeFaceCentres() : faMesh::areaCentres() + // + // faMesh::Le() has its own point-to-point communication (OK) but + // triggers either/or edgeAreaNormals(), pointAreaNormals() + // with their own communication that can block. + // This uses parallel comms and hence will not be trigggered // on processors that do not have a processorFaPatch so instead // force construction. + + (void)mesh_.edgeAreaNormals(); (void)mesh_.pointAreaNormals(); PstreamBuffers pBufs(Pstream::defaultCommsType); @@ -773,10 +783,9 @@ bool Foam::faBoundaryMesh::checkDefinition(const bool report) const void Foam::faBoundaryMesh::movePoints(const pointField& p) { - // processorFaPatch geometry triggers calculation of pointNormals. - // This uses parallel comms and hence will not be trigggered - // on processors that do not have a processorFaPatch so instead - // force construction. + // See comments in calcGeometry() + + (void)mesh_.edgeAreaNormals(); (void)mesh_.pointAreaNormals(); PstreamBuffers pBufs(Pstream::defaultCommsType);