mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
Do bad element Optimization only when requested
This commit is contained in:
parent
ff505f1e41
commit
78a3d24fde
@ -659,13 +659,16 @@ namespace netgen
|
||||
|
||||
// optimize only bad elements first
|
||||
optmesh.SetMinBadness(1000.);
|
||||
bool do_split = mp.optimize3d.find('d') != string::npos;
|
||||
bool do_swap = mp.optimize3d.find('s') != string::npos;
|
||||
bool do_swap2 = mp.optimize3d.find('t') != string::npos;
|
||||
for(auto i : Range(mp.optsteps3d))
|
||||
{
|
||||
auto [total_badness, max_badness, bad_els] = optmesh.UpdateBadness();
|
||||
if(bad_els==0) break;
|
||||
optmesh.SplitImprove();
|
||||
optmesh.SwapImprove();
|
||||
optmesh.SwapImprove2();
|
||||
if(do_split) optmesh.SplitImprove();
|
||||
if(do_swap) optmesh.SwapImprove();
|
||||
if(do_swap2) optmesh.SwapImprove2();
|
||||
}
|
||||
|
||||
// Now optimize all elements
|
||||
|
Loading…
Reference in New Issue
Block a user