From 989cf27554bc9c80693c91b564eeb1688e9dea2e Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 10 Feb 2022 14:47:07 +0000 Subject: [PATCH] snappyHexMesh, createPatch: Keep all constraint patches even if zero size This change ensures that special constraint type patches, like internal used for load-balancing, are not deleted by snappyHexMesh or createPatch. --- .../generation/snappyHexMesh/snappyHexMesh.C | 35 +++++-------------- .../manipulation/createPatch/createPatch.C | 16 ++++----- 2 files changed, 15 insertions(+), 36 deletions(-) diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index cf09bb1132..fd9e452b8c 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -565,12 +565,8 @@ scalar getMergeDistance(const polyMesh& mesh, const scalar mergeTol) void removeZeroSizedPatches(fvMesh& mesh) { - // Remove any zero-sized ones. Assumes - // - processor patches are already only there if needed - // - all other patches are available on all processors - // - but coupled ones might still be needed, even if zero-size - // (e.g. processorCyclic) - // See also logic in createPatch. + // Remove non-constraint zero-sized patches + const polyBoundaryMesh& pbm = mesh.boundaryMesh(); labelList oldToNew(pbm.size(), -1); @@ -579,31 +575,16 @@ void removeZeroSizedPatches(fvMesh& mesh) { const polyPatch& pp = pbm[patchi]; - if (!isA(pp)) - { - if - ( - isA(pp) - || returnReduce(pp.size(), sumOp