From c5501d36e07ea19c0c4cd8be34934e005e2a9159 Mon Sep 17 00:00:00 2001
From: Siqi Ling <lsq0473@gmail.com>
Date: Wed, 17 Jun 2015 13:32:00 +0000
Subject: [PATCH] small change

---
 .../demo/multimesh/src/diffuseDomain.cc       | 25 +++++++++++++------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/extensions/demo/multimesh/src/diffuseDomain.cc b/extensions/demo/multimesh/src/diffuseDomain.cc
index ba67e18f..37db35bd 100644
--- a/extensions/demo/multimesh/src/diffuseDomain.cc
+++ b/extensions/demo/multimesh/src/diffuseDomain.cc
@@ -76,9 +76,7 @@ struct DDProblemInstat : ProblemInstat
       epsilon(0.1),
       maxLevel(15),
       temperRefment(NULL),
-      temperRefFct(NULL),
-      c(radius, center),
-      ic(radius, center)
+      temperRefFct(NULL)
   { 
     Parameters::get("radius", radius);
     Parameters::get("epsilon", epsilon);
@@ -108,6 +106,14 @@ struct DDProblemInstat : ProblemInstat
     if (temperRefment)
       delete temperRefment;
     temperRefment = NULL;
+    
+    if (c)
+      delete c;
+    c = NULL;
+    
+    if (ic)
+      delete ic;
+    ic = NULL;
   }
 
   void initialize(Flag initFlag,
@@ -118,15 +124,18 @@ struct DDProblemInstat : ProblemInstat
 
     ProblemInstat::initialize(INIT_NOTHING);
     
+    c = new Circle(radius, center);
+    ic = new InverseCircle(radius, center);
+    
     phase = new DOFVector<double>(problemStat->getFeSpace(1), "phase2");
     phaseRefFct = new SignedDistRefinement(problemStat->getMesh(1));
     phaseRefment = new RefinementLevelCoords2(problemStat->getFeSpace(1), 
-					      phaseRefFct, &c);
+					      phaseRefFct, c);
     
     if (problemStat->getMeshes().size() == 2) {
       temperRefFct = new MySignedDistRefinement(problemStat->getMesh(0));
       temperRefment = new RefinementLevelCoords2(problemStat->getFeSpace(0), 
-						 temperRefFct, &c);
+						 temperRefFct, c);
     }
   }
 
@@ -138,7 +147,7 @@ struct DDProblemInstat : ProblemInstat
     Timer t;
     
     SignedDistFctToPhaseField* p = 
-      new SignedDistFctToPhaseField(epsilon, &ic, 3.0);
+      new SignedDistFctToPhaseField(epsilon, ic, 3.0);
     
     phaseRefment->refine(maxLevel);
     phase->interpol(p); 
@@ -183,8 +192,8 @@ protected:
   RefinementLevelCoords2* phaseRefment;
   RefinementLevelCoords2* temperRefment;
   
-  Circle c;
-  InverseCircle ic;
+  Circle* c;
+  InverseCircle* ic;
 
   DOFVector<double>* phase;
 
-- 
GitLab