typ is hardcoded to 1, so init pf directly as local variable

This commit is contained in:
Matthias Hochsteger 2019-07-16 12:14:19 +02:00
parent 765dc6d86a
commit 2cc3908847

View File

@ -1357,8 +1357,6 @@ void Mesh :: ImproveMesh (const MeshingParameters & mp, OPTIMIZEGOAL goal)
{ {
static Timer t("Mesh::ImproveMesh"); RegionTimer reg(t); static Timer t("Mesh::ImproveMesh"); RegionTimer reg(t);
int typ = 1;
(*testout) << "Improve Mesh" << "\n"; (*testout) << "Improve Mesh" << "\n";
PrintMessage (3, "ImproveMesh"); PrintMessage (3, "ImproveMesh");
@ -1407,16 +1405,9 @@ void Mesh :: ImproveMesh (const MeshingParameters & mp, OPTIMIZEGOAL goal)
//int uselocalh = mparam.uselocalh; //int uselocalh = mparam.uselocalh;
PointFunction * pf; PointFunction pf(points, volelements, mp);
if (typ == 1)
pf = new PointFunction(points, volelements, mp);
else
pf = new CheapPointFunction(points, volelements, mp);
// pf->SetLocalH (h);
Opti3FreeMinFunction freeminf(*pf); Opti3FreeMinFunction freeminf(pf);
OptiParameters par; OptiParameters par;
par.maxit_linsearch = 20; par.maxit_linsearch = 20;
@ -1470,11 +1461,11 @@ void Mesh :: ImproveMesh (const MeshingParameters & mp, OPTIMIZEGOAL goal)
if ( (pi+1-PointIndex::BASE) % printmod == 0) PrintDot (printdot); if ( (pi+1-PointIndex::BASE) % printmod == 0) PrintDot (printdot);
double lh = pointh[pi]; double lh = pointh[pi];
pf->SetLocalH (lh); pf.SetLocalH (lh);
par.typx = lh; par.typx = lh;
freeminf.SetPoint (points[pi]); freeminf.SetPoint (points[pi]);
pf->SetPointIndex (pi); pf.SetPointIndex (pi);
x = 0; x = 0;
int pok; int pok;
@ -1482,10 +1473,10 @@ void Mesh :: ImproveMesh (const MeshingParameters & mp, OPTIMIZEGOAL goal)
if (!pok) if (!pok)
{ {
pok = pf->MovePointToInner (); pok = pf.MovePointToInner ();
freeminf.SetPoint (points[pi]); freeminf.SetPoint (points[pi]);
pf->SetPointIndex (pi); pf.SetPointIndex (pi);
} }
if (pok) if (pok)
@ -1500,8 +1491,6 @@ void Mesh :: ImproveMesh (const MeshingParameters & mp, OPTIMIZEGOAL goal)
} }
PrintDot ('\n'); PrintDot ('\n');
delete pf;
multithread.task = savetask; multithread.task = savetask;
if (goal == OPT_QUALITY) if (goal == OPT_QUALITY)