mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 14:10:34 +05:00
Merge branch 'fix_blayer_meshopt' into 'master'
Fix blayer meshoptimization See merge request ngsolve/netgen!647
This commit is contained in:
commit
6e2eae70ad
@ -169,6 +169,7 @@ public:
|
||||
/// Inserts element acont into row i. BASE-based. Does not test if already used, assumes to have enough memory
|
||||
inline void AddSave (int i, const T & acont)
|
||||
{
|
||||
NETGEN_CHECK_RANGE(i, BASE, data.Size()+BASE);
|
||||
((T*)data[i-BASE].col)[data[i-BASE].size] = acont;
|
||||
data[i-BASE].size++;
|
||||
}
|
||||
|
@ -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