diff --git a/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C b/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C index 82b497a3ad..7bd8ad7ca9 100644 --- a/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C +++ b/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C @@ -196,6 +196,10 @@ void Foam::faBoundaryMesh::calcGeometry() (void)mesh_.edgeAreaNormals(); (void)mesh_.pointAreaNormals(); + (void)mesh_.areaCentres(); + (void)mesh_.faceAreaNormals(); + + PstreamBuffers pBufs(Pstream::defaultCommsType); if @@ -788,6 +792,10 @@ void Foam::faBoundaryMesh::movePoints(const pointField& p) (void)mesh_.edgeAreaNormals(); (void)mesh_.pointAreaNormals(); + (void)mesh_.areaCentres(); + (void)mesh_.faceAreaNormals(); + + PstreamBuffers pBufs(Pstream::defaultCommsType); if diff --git a/src/finiteArea/faMesh/faMesh.C b/src/finiteArea/faMesh/faMesh.C index eaf224fbf0..12d34152be 100644 --- a/src/finiteArea/faMesh/faMesh.C +++ b/src/finiteArea/faMesh/faMesh.C @@ -317,18 +317,7 @@ bool Foam::faMesh::init(const bool doInit) // Calculate the geometry for the patches (transformation tensors etc.) boundary_.calcGeometry(); - // Ensure processor/processor information is properly synchronised - if (Pstream::parRun()) - { - const_cast(areaCentres()).boundaryFieldRef() - .evaluateCoupled(); - - // This roughly corresponds to what OpenFOAM-v2112 (and earlier) had, - // but should nominally be unnecessary. - // - /// const_cast(faceAreaNormals()).boundaryFieldRef() - /// .evaluateCoupled(); - } + syncGeom(); return false; } @@ -1010,7 +999,6 @@ bool Foam::faMesh::movePoints() clearGeomNotAreas(); - // To satisfy the motion interface for MeshObject, const cast is needed if (patchPtr_) { patchPtr_->movePoints(newPoints); @@ -1024,6 +1012,8 @@ bool Foam::faMesh::movePoints() // Note: Fluxes were dummy? + syncGeom(); + return true; } diff --git a/src/finiteArea/faMesh/faMeshDemandDrivenData.C b/src/finiteArea/faMesh/faMeshDemandDrivenData.C index 6bd45e7298..3775a314ad 100644 --- a/src/finiteArea/faMesh/faMeshDemandDrivenData.C +++ b/src/finiteArea/faMesh/faMeshDemandDrivenData.C @@ -876,6 +876,12 @@ void Foam::faMesh::calcFaceCentres() const } } } + + // Parallel consistency, exchange on processor patches + if (UPstream::parRun()) + { + centres.boundaryFieldRef().evaluateCoupled(); + } } @@ -1088,6 +1094,12 @@ void Foam::faMesh::calcFaceAreaNormals() const = edgeNormalsBoundary[patchi]; } } + + // Parallel consistency, exchange on processor patches + if (UPstream::parRun()) + { + faceNormals.boundaryFieldRef().evaluateCoupled(); + } } diff --git a/src/finiteArea/faMesh/faMeshTools/faMeshTools.C b/src/finiteArea/faMesh/faMeshTools/faMeshTools.C index e12c43c7b4..cce1e3c6d7 100644 --- a/src/finiteArea/faMesh/faMeshTools/faMeshTools.C +++ b/src/finiteArea/faMesh/faMeshTools/faMeshTools.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2015-2022 OpenCFD Ltd. + Copyright (C) 2015-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -61,6 +61,8 @@ void Foam::faMeshTools::forceDemandDriven(faMesh& mesh) (void)mesh.pointAreaNormals(); (void)mesh.faceCurvatures(); (void)mesh.edgeTransformTensors(); + + mesh.syncGeom(); }