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

refinement-expressions corrected

parent 4de96d0f
......@@ -37,8 +37,6 @@ public:
RefinementExpression(ProblemStat& prob, int component = 0, bool doCalcMeshSize_ = false)
: mesh(prob.getMesh(component)),
adaptInfo(NULL),
refineOperation(NULL),
numRefinements0(15),
doCalcMeshSize(doCalcMeshSize_),
onlyRefine(false),
......@@ -48,13 +46,13 @@ public:
coarseningManager = prob.getCoarseningManager();
refinementManager = prob.getRefinementManager();
numRefinements = numRefinements0;
refineOperation = new StandardRefineOperation;
standardRefineOperation.reset(new StandardRefineOperation);
refineOperation = standardRefineOperation.get();
}
RefinementExpression(Mesh *mesh_, bool doCalcMeshSize_ = false)
: mesh(mesh_),
adaptInfo(NULL),
refineOperation(NULL),
numRefinements0(15),
doCalcMeshSize(doCalcMeshSize_),
onlyRefine(false),
......@@ -81,8 +79,8 @@ public:
}
numRefinements = numRefinements0;
refineOperation = new StandardRefineOperation;
standardRefineOperation.reset(new StandardRefineOperation);
refineOperation = standardRefineOperation.get();
}
virtual ~RefinementExpression()
......@@ -93,9 +91,6 @@ public:
delete coarseningManager;
delete refinementManager;
}
if (refineOperation)
delete refineOperation;
}
void finalize()
......@@ -315,9 +310,6 @@ public:
void setRefineOperation(AdaptInfo* adaptInfo_,
StandardRefineOperation* refineOperation_)
{
if (refineOperation)
delete refineOperation;
adaptInfo = adaptInfo_;
refineOperation = refineOperation_;
}
......@@ -338,8 +330,10 @@ protected:
RefinementManager* refinementManager;
CoarseningManager* coarseningManager;
AdaptInfo* adaptInfo;
StandardRefineOperation* refineOperation;
AdaptInfo* adaptInfo = nullptr;
std::shared_ptr<StandardRefineOperation> standardRefineOperation;
StandardRefineOperation* refineOperation = nullptr;
int numRefinements;
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