From 73a3fbe44685cc421967541bef5cdb25f157d6b7 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 21 Dec 2023 19:26:08 +0000 Subject: [PATCH] patchToPatches::intersection: Fix error part calculation for reversed targets --- .../intersection/intersectionPatchToPatch.C | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/meshTools/patchToPatch/intersection/intersectionPatchToPatch.C b/src/meshTools/patchToPatch/intersection/intersectionPatchToPatch.C index eddb99f45b..1cc13ccc74 100644 --- a/src/meshTools/patchToPatch/intersection/intersectionPatchToPatch.C +++ b/src/meshTools/patchToPatch/intersection/intersectionPatchToPatch.C @@ -394,14 +394,8 @@ bool Foam::patchToPatches::intersection::intersectFaces if (tgtFaceEdgei < tgtPatch[tgtFacei].size()) { - if (reverse()) - { - tgtFaceEdgePart_[tgtFaceEdgei] += ictEdgePart; - } - else - { - tgtFaceEdgePart_[tgtFaceEdgei] -= ictEdgePart; - } + tgtFaceEdgePart_[tgtFaceEdgei] += + reverse() ? ictEdgePart : -ictEdgePart; ictEdgeSide = -1; } else @@ -456,7 +450,8 @@ bool Foam::patchToPatches::intersection::intersectFaces srcFaceEdgeParts_[srcFacei][srcFaceEdgei] += srcFaceEdgePart_[srcFaceEdgei]; } - srcErrorParts_[srcFacei] -= sum(tgtFaceEdgePart_); + srcErrorParts_[srcFacei] += + reverse() ? sum(tgtFaceEdgePart_) : -sum(tgtFaceEdgePart_); srcErrorParts_[srcFacei] += errorPart; }