mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
Fix SwapImprove
This commit is contained in:
parent
e17aa88cad
commit
ce8ba71f33
@ -2015,6 +2015,8 @@ double MeshOptimize3d :: SwapImproveEdge (Mesh & mesh, OPTIMIZEGOAL goal,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool have_bad_element = false;
|
||||||
|
|
||||||
for (ElementIndex ei : hasbothpoints)
|
for (ElementIndex ei : hasbothpoints)
|
||||||
{
|
{
|
||||||
if (mesh[ei].GetType () != TET)
|
if (mesh[ei].GetType () != TET)
|
||||||
@ -2037,10 +2039,13 @@ double MeshOptimize3d :: SwapImproveEdge (Mesh & mesh, OPTIMIZEGOAL goal,
|
|||||||
|
|
||||||
if ((goal == OPT_LEGAL) &&
|
if ((goal == OPT_LEGAL) &&
|
||||||
mesh.LegalTet (mesh[ei]) &&
|
mesh.LegalTet (mesh[ei]) &&
|
||||||
CalcBad (mesh.Points(), mesh[ei], 0) < 1e3)
|
CalcBad (mesh.Points(), mesh[ei], 0) >= 1e3)
|
||||||
return 0.0;
|
have_bad_element = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((goal == OPT_LEGAL) && !have_bad_element)
|
||||||
|
return 0.0;
|
||||||
|
|
||||||
int nsuround = hasbothpoints.Size();
|
int nsuround = hasbothpoints.Size();
|
||||||
int mattyp = mesh[hasbothpoints[0]].GetIndex();
|
int mattyp = mesh[hasbothpoints[0]].GetIndex();
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user