From 1e2858e8cbacc4e87ed34296f05c41ac1be65a3a Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 24 Aug 2023 13:17:00 +0100 Subject: [PATCH] ENH: attachDetach: use parallel sizes. See #2969 --- src/dynamicMesh/attachDetach/attachDetach.C | 54 +++++++++------------ 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/src/dynamicMesh/attachDetach/attachDetach.C b/src/dynamicMesh/attachDetach/attachDetach.C index 1f0d9c6007..51e9143730 100644 --- a/src/dynamicMesh/attachDetach/attachDetach.C +++ b/src/dynamicMesh/attachDetach/attachDetach.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020,2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -66,6 +66,7 @@ void Foam::attachDetach::checkDefinition() } const polyMesh& mesh = topoChanger().mesh(); + const auto& bm = mesh.boundaryMesh(); if (debug) { @@ -76,11 +77,14 @@ void Foam::attachDetach::checkDefinition() } // Check the sizes and set up state - if - ( - mesh.boundaryMesh()[masterPatchID_.index()].empty() - && mesh.boundaryMesh()[slavePatchID_.index()].empty() - ) + const auto& mPatch = bm[masterPatchID_.index()]; + const label nMasterFaces = returnReduce(mPatch.size(), sumOp