From 071d561224b54e511221104b9b790f3a190b8bda Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Mon, 11 Jun 2018 13:13:44 +0100
Subject: [PATCH] BUG: refineWallLayer: incorrect handlign of useSet option.
 Fixes #864.

---
 .../mesh/advanced/refineWallLayer/refineWallLayer.C        | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C
index 0f8b5c1ed03..256b84ee106 100644
--- a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C
+++ b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C
@@ -137,10 +137,9 @@ int main(int argc, char *argv[])
             << cells.instance()/cells.local()/cells.name()
             << nl << endl;
 
-        for (const label celli : cells)
-        {
-            cutCells.erase(celli);
-        }
+
+        cutCells.retain(cells);
+
         Info<< "Removed from cells to cut all the ones not in set "
             << setName << nl << endl;
     }
-- 
GitLab