Commit 2d7e06ee authored by Praetorius, Simon's avatar Praetorius, Simon

refinement-expressions corrected

parent 4de96d0f
...@@ -37,8 +37,6 @@ public: ...@@ -37,8 +37,6 @@ public:
RefinementExpression(ProblemStat& prob, int component = 0, bool doCalcMeshSize_ = false) RefinementExpression(ProblemStat& prob, int component = 0, bool doCalcMeshSize_ = false)
: mesh(prob.getMesh(component)), : mesh(prob.getMesh(component)),
adaptInfo(NULL),
refineOperation(NULL),
numRefinements0(15), numRefinements0(15),
doCalcMeshSize(doCalcMeshSize_), doCalcMeshSize(doCalcMeshSize_),
onlyRefine(false), onlyRefine(false),
...@@ -48,13 +46,13 @@ public: ...@@ -48,13 +46,13 @@ public:
coarseningManager = prob.getCoarseningManager(); coarseningManager = prob.getCoarseningManager();
refinementManager = prob.getRefinementManager(); refinementManager = prob.getRefinementManager();
numRefinements = numRefinements0; numRefinements = numRefinements0;
refineOperation = new StandardRefineOperation;
standardRefineOperation.reset(new StandardRefineOperation);
refineOperation = standardRefineOperation.get();
} }
RefinementExpression(Mesh *mesh_, bool doCalcMeshSize_ = false) RefinementExpression(Mesh *mesh_, bool doCalcMeshSize_ = false)
: mesh(mesh_), : mesh(mesh_),
adaptInfo(NULL),
refineOperation(NULL),
numRefinements0(15), numRefinements0(15),
doCalcMeshSize(doCalcMeshSize_), doCalcMeshSize(doCalcMeshSize_),
onlyRefine(false), onlyRefine(false),
...@@ -81,8 +79,8 @@ public: ...@@ -81,8 +79,8 @@ public:
} }
numRefinements = numRefinements0; numRefinements = numRefinements0;
standardRefineOperation.reset(new StandardRefineOperation);
refineOperation = new StandardRefineOperation; refineOperation = standardRefineOperation.get();
} }
virtual ~RefinementExpression() virtual ~RefinementExpression()
...@@ -93,9 +91,6 @@ public: ...@@ -93,9 +91,6 @@ public:
delete coarseningManager; delete coarseningManager;
delete refinementManager; delete refinementManager;
} }
if (refineOperation)
delete refineOperation;
} }
void finalize() void finalize()
...@@ -315,9 +310,6 @@ public: ...@@ -315,9 +310,6 @@ public:
void setRefineOperation(AdaptInfo* adaptInfo_, void setRefineOperation(AdaptInfo* adaptInfo_,
StandardRefineOperation* refineOperation_) StandardRefineOperation* refineOperation_)
{ {
if (refineOperation)
delete refineOperation;
adaptInfo = adaptInfo_; adaptInfo = adaptInfo_;
refineOperation = refineOperation_; refineOperation = refineOperation_;
} }
...@@ -338,8 +330,10 @@ protected: ...@@ -338,8 +330,10 @@ protected:
RefinementManager* refinementManager; RefinementManager* refinementManager;
CoarseningManager* coarseningManager; CoarseningManager* coarseningManager;
AdaptInfo* adaptInfo; AdaptInfo* adaptInfo = nullptr;
StandardRefineOperation* refineOperation;
std::shared_ptr<StandardRefineOperation> standardRefineOperation;
StandardRefineOperation* refineOperation = nullptr;
int numRefinements; int numRefinements;
int numRefinements0; int numRefinements0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment