From e06c68ea0a643f25390fe16e76d76df953d1c47f Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Thu, 20 Aug 2009 14:10:49 +0000
Subject: [PATCH] better remove dir

---
 CMakeLists.txt                   | 3 +--
 Geo/MElementCut.cpp              | 9 +++++----
 benchmarks/levelset/carreTri.geo | 9 ++++++---
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f5024b339..b83c415b52 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -769,8 +769,7 @@ if(UNIX)
   # (on Mac for example "make package; make package_source" would lead
   # to huge file lists getting generated due to the 'Applications'
   # symlink in the bundle)
-  set(CPACK_INSTALL_COMMANDS 
-      "${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/_CPack_Packages")
+  set(CPACK_INSTALL_COMMANDS "rm -rf ${CMAKE_BINARY_DIR}/_CPack_Packages")
 endif(UNIX)
 
 if(APPLE)
diff --git a/Geo/MElementCut.cpp b/Geo/MElementCut.cpp
index 2f93e14265..f2c5b33293 100644
--- a/Geo/MElementCut.cpp
+++ b/Geo/MElementCut.cpp
@@ -382,10 +382,11 @@ int getElementVertexNum (DI_Point p, MElement *e)
 void assignPhysicals(GModel *GM, std::vector<int> gePhysicals, int reg, int dim,
                      std::map<int, std::map<int, std::string> > physicals[4])
 {
-  for(unsigned int i = 0; i < gePhysicals.size(); i++)
-    if(gePhysicals[i] && (!physicals[dim].count(reg) ||
-                          !physicals[dim][reg].count(gePhysicals[i])))
-      physicals[dim][reg][gePhysicals[i]] = GM->getPhysicalName(dim, gePhysicals[i]);
+  for(unsigned int i = 0; i < gePhysicals.size(); i++){
+    int phys = gePhysicals[i];
+    if(phys && (!physicals[dim].count(reg) || !physicals[dim][reg].count(phys)))
+      physicals[dim][reg][phys] = GM->getPhysicalName(dim, phys);
+  }
 }
 
 bool equalV(MVertex *v, DI_Point p)
diff --git a/benchmarks/levelset/carreTri.geo b/benchmarks/levelset/carreTri.geo
index 451c869209..bb87b84a93 100644
--- a/benchmarks/levelset/carreTri.geo
+++ b/benchmarks/levelset/carreTri.geo
@@ -1,6 +1,6 @@
 
 l=2;
-nb=5;
+nb=10;
 cl=l/nb;
 
 Point(1) = {-l/2,-l/2,0,cl};
@@ -29,10 +29,13 @@ Mesh 2;
 
 Levelset Plane (1) = {0,-1,0,0.5};
 Levelset Plane (2) = {-1,0,0,0.5};
-Levelset Sphere (3) = {{0,0,0},0.75};
+Levelset Sphere (3) = {{0,0,0},0.5};
 Levelset Ellipsoid (4) = { {0,0,0}, {1,0,0}, 0.55, 0.55, 0.75 };
 Levelset Intersection (10) = {1,4};
-Levelset CutMesh {10};
+
+Levelset CutMesh {3};
+
+Physical Surface(2000) = 7;
 
 //Transfinite Line{1,3}=nb+1;
 //Transfinite Line{2,4}=2*nb+1+1;
-- 
GitLab