From adb83ad6d20a5e72b45f4dc6967fb589c7b482be Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Thu, 3 Oct 2019 11:44:24 +0100
Subject: [PATCH] ENH: patchSet: wrong logic to compress points. See #1453.

---
 src/sampling/sampledSet/patchEdge/patchEdgeSet.C | 3 ++-
 src/sampling/sampledSet/patchEdge/patchEdgeSet.H | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/sampling/sampledSet/patchEdge/patchEdgeSet.C b/src/sampling/sampledSet/patchEdge/patchEdgeSet.C
index 69756b4769b..6cf8f382b0d 100644
--- a/src/sampling/sampledSet/patchEdge/patchEdgeSet.C
+++ b/src/sampling/sampledSet/patchEdge/patchEdgeSet.C
@@ -138,8 +138,9 @@ void Foam::patchEdgeSet::genSamples()
         origin_
     );
 
-    if (nMerged == 0)
+    if (nMerged == samplingPts.size())
     {
+        // Nothing merged
         setSamples
         (
             samplingPts,
diff --git a/src/sampling/sampledSet/patchEdge/patchEdgeSet.H b/src/sampling/sampledSet/patchEdge/patchEdgeSet.H
index eee1e664edc..7558bc69f7a 100644
--- a/src/sampling/sampledSet/patchEdge/patchEdgeSet.H
+++ b/src/sampling/sampledSet/patchEdge/patchEdgeSet.H
@@ -94,8 +94,12 @@ Usage
     \endtable
 
 Note
-    The ordering of the points is according to the distance to the specified
+    - The ordering of the points is according to the distance to the specified
     origin.
+    - Collocated points get merged if closer than SMALL (1e-15 in double prec).
+    (hardcoded). Collocated points can occur if patch points are exactly
+    on the sampling plane. Note that (in parallel) any point merging gets
+    done locally before sending to the master.
 
 SourceFiles
     patchEdgeSet.C
-- 
GitLab