From ef2ce7876892b6e3855ef50b8c64f8a454c61f99 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Mon, 18 Jun 2012 14:30:54 +0100
Subject: [PATCH] ENH: autoHexMesh: snap to multi-patch point only if it has
 constraints

---
 .../autoHexMeshDriver/autoSnapDriverFeature.C | 24 +++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C
index 96e7faec101..950849e15ec 100644
--- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C
+++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C
@@ -1385,12 +1385,23 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges
         {
             if (isMultiPatchPoint[pointI])
             {
-                if (patchConstraints[pointI].first() == 0)
+                if
+                (
+                    patchConstraints[pointI].first() == 0
+                 && allPatchConstraints[pointI].first() > 0
+                )
                 {
                     patchAttraction[pointI] = allPatchAttraction[pointI];
                     patchConstraints[pointI] = allPatchConstraints[pointI];
-                    //Pout<< "Adding constraint on multiPatchPoint:"
-                    //    << pp.localPoints()[pointI] << endl;
+
+                    if (multiPatchStr.valid())
+                    {
+                        Pout<< "Adding constraint on multiPatchPoint:"
+                            << pp.localPoints()[pointI]
+                            << " constraint:" << patchConstraints[pointI]
+                            << " attraction:" << patchAttraction[pointI]
+                            << endl;
+                    }
                 }
             }
         }
@@ -1407,7 +1418,12 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges
             label nMultiPatchPoints = 0;
             forAll(f, fp)
             {
-                if (isMultiPatchPoint[f[fp]])
+                label pointI = f[fp];
+                if
+                (
+                    isMultiPatchPoint[pointI]
+                 && patchConstraints[pointI].first() != 0
+                )
                 {
                     nMultiPatchPoints++;
                 }
-- 
GitLab