From 4b5b9b809f48c407883ac0935eb6b6b07b8bb511 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Thu, 24 May 2012 11:45:44 +0100
Subject: [PATCH] BUG: loadOrCreateMesh: remove polyMesh directory

---
 .../redistributePar/loadOrCreateMesh.C                   | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/applications/utilities/parallelProcessing/redistributePar/loadOrCreateMesh.C b/applications/utilities/parallelProcessing/redistributePar/loadOrCreateMesh.C
index 9e68e1f726e..136dea38820 100644
--- a/applications/utilities/parallelProcessing/redistributePar/loadOrCreateMesh.C
+++ b/applications/utilities/parallelProcessing/redistributePar/loadOrCreateMesh.C
@@ -51,9 +51,6 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
     // Check who has a mesh
     const bool haveMesh = isDir(io.time().path()/io.instance()/meshSubDir);
 
-Pout<< "meshpath:" << io.time().path()/io.instance()/meshSubDir << endl;
-Pout<< "haveMesh:" << haveMesh << endl;
-
     if (!haveMesh)
     {
         // Create dummy mesh. Only used on procs that don't have mesh.
@@ -293,8 +290,10 @@ Pout<< "haveMesh:" << haveMesh << endl;
     if (!haveMesh)
     {
         // We created a dummy mesh file above. Delete it.
-        //Pout<< "Removing dummy mesh " << io.objectPath() << endl;
-        rmDir(io.objectPath());
+        const fileName meshFiles = io.time().path()/io.instance()/meshSubDir;
+        //Pout<< "Removing dummy mesh " << meshFiles << endl;
+        mesh.removeFiles();
+        rmDir(meshFiles);
     }
 
     // Force recreation of globalMeshData.
-- 
GitLab