diff --git a/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C b/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C index 7c24d3dec8..12f8a316c6 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C +++ b/src/parallel/decompose/decompositionMethods/decompositionConstraints/decompositionConstraint/decompositionConstraint.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2017 OpenFOAM Foundation - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,6 +27,8 @@ License \*---------------------------------------------------------------------------*/ #include "decompositionConstraint.H" +#include "syncTools.H" +#include "cyclicAMIPolyPatch.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -36,6 +38,95 @@ namespace Foam defineRunTimeSelectionTable(decompositionConstraint, dictionary); } + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::decompositionConstraint::getMinBoundaryValue +( + const polyMesh& mesh, + const labelList& decomposition, + labelList& destProc +) const +{ + destProc.setSize(mesh.nBoundaryFaces()); + destProc = labelMax; + + const polyBoundaryMesh& pbm = mesh.boundaryMesh(); + + for (const polyPatch& pp : pbm) + { + const labelUList& faceCells = pp.faceCells(); + + forAll(faceCells, i) + { + label bFacei = pp.offset()+i; + destProc[bFacei] = decomposition[faceCells[i]]; + } + } + + // Take minimum of coupled faces (over all patches!) + syncTools::syncBoundaryFaceList(mesh, destProc, minEqOp