From 5dd6a04ff8d44034c381375ae97c03790556c552 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 3 Jun 2019 11:07:05 +0100 Subject: [PATCH] BUG: attach/detach: correctly change modified faces. Fixes #1329. --- src/dynamicMesh/attachDetach/attachInterface.C | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/dynamicMesh/attachDetach/attachInterface.C b/src/dynamicMesh/attachDetach/attachInterface.C index f381731b6b..be2174036a 100644 --- a/src/dynamicMesh/attachDetach/attachInterface.C +++ b/src/dynamicMesh/attachDetach/attachInterface.C @@ -114,6 +114,9 @@ void Foam::attachDetach::attachInterface const boolList& mfFlip = mesh.faceZones()[faceZoneID_.index()].flipMap(); + // Keep track of which faces have been modified + bitSet faceModified(mesh.nFaces()); + forAll(masterFaceCells, facei) { // If slave neighbour is greater than master, face does not need @@ -155,6 +158,7 @@ void Foam::attachDetach::attachInterface ) ); } + faceModified[masterPatchStart + facei] = true; } // Renumber faces affected by point removal @@ -175,7 +179,11 @@ void Foam::attachDetach::attachInterface forAll(curFaces, facei) { - if (!ref.faceRemoved(curFaces[facei])) + if + ( + !ref.faceRemoved(curFaces[facei]) + && !faceModified[curFaces[facei]] + ) { facesToModifyMap.insert(curFaces[facei]); }