From db3699f8ab3fcfc69c208b2ac14da6cba7d4e875 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Tue, 6 Dec 2016 09:10:30 +0000
Subject: [PATCH] ENH: redistributePar: remove shm data

---
 .../parallelProcessing/redistributePar/Make/options        | 6 ++++--
 .../parallelProcessing/redistributePar/redistributePar.C   | 7 ++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/applications/utilities/parallelProcessing/redistributePar/Make/options b/applications/utilities/parallelProcessing/redistributePar/Make/options
index 08d24a07f75..189902467f7 100644
--- a/applications/utilities/parallelProcessing/redistributePar/Make/options
+++ b/applications/utilities/parallelProcessing/redistributePar/Make/options
@@ -4,7 +4,8 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude \
     -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-    -I$(LIB_SRC)/dynamicMesh/lnInclude
+    -I$(LIB_SRC)/dynamicMesh/lnInclude \
+    -I$(LIB_SRC)/mesh/snappyHexMesh/lnInclude
 
 EXE_LIBS = \
     -lfiniteVolume \
@@ -14,4 +15,5 @@ EXE_LIBS = \
     -ldecompose \
     -lmeshTools \
     -llagrangian \
-    -ldynamicMesh
+    -ldynamicMesh \
+    -lsnappyHexMesh
diff --git a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C
index 6dc98535c0a..3e2e351ddda 100644
--- a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C
+++ b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C
@@ -81,6 +81,7 @@ Usage
 #include "parLagrangianRedistributor.H"
 #include "unmappedPassiveParticleCloud.H"
 #include "hexRef8Data.H"
+#include "meshRefinement.H"
 #include "pointFields.H"
 
 using namespace Foam;
@@ -1246,14 +1247,18 @@ autoPtr<mapDistributePolyMesh> redistributeAndWrite
         {
             runTime.TimePaths::caseName() = proc0CaseName;
         }
+
         // Make sure all processors have valid data (since only some will
         // read)
         refData.sync(io);
 
-
         // Distribute
         refData.distribute(map);
 
+
+        // Now we've read refinement data we can remove it
+        meshRefinement::removeFiles(mesh);
+
         if (nDestProcs == 1)
         {
             if (Pstream::master())
-- 
GitLab