From 3e9562f781a1acc9f0e0989e5723d36614b36add Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 29 Aug 2019 10:56:06 +0100 Subject: [PATCH] ENH: merging faces: generalise to disallow any constraints. Fixes #1352. --- .../polyTopoChange/polyTopoChange/combineFaces.C | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C index 6755147426..0672b7a8d7 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C @@ -152,14 +152,20 @@ void Foam::combineFaces::regioniseFaces // Face can be merged if // - small angle - // - mergeAcrossPatches=false : same non-coupled patch - // - mergeAcrossPatches=true : always + // - mergeAcrossPatches=false : same non-constraint patch + // - mergeAcrossPatches=true : always (if non-constraint patch) + // (this logic could be extended to e.g. merge faces on symm plane + // if they have similar normals. But there might be lots of other + // constraints which disallow merging so this decision ideally should + // be up to patch type) if ( p0 != -1 && p1 != -1 - && !patches[p0].coupled() - && !patches[p1].coupled() + && !( + polyPatch::constraintType(patches[p0].type()) + || polyPatch::constraintType(patches[p1].type()) + ) ) { if (!mergeAcrossPatches && (p0 != p1))