mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
Fix SwapImprove2
Don't allow swaps if an adjacent element was deleted in the current optimization pass. Also update test restults.
This commit is contained in:
parent
da4f959a0f
commit
fbeb6137eb
@ -3716,6 +3716,18 @@ double MeshOptimize3d :: SwapImprove2 ( Mesh & mesh, OPTIMIZEGOAL goal, ElementI
|
|||||||
|
|
||||||
|
|
||||||
FlatArray<ElementIndex> row = elementsonnode[pi1];
|
FlatArray<ElementIndex> row = elementsonnode[pi1];
|
||||||
|
for(auto ei : row)
|
||||||
|
if (mesh[ei].IsDeleted()) return 0.0;
|
||||||
|
|
||||||
|
for(auto ei : elementsonnode[pi2])
|
||||||
|
if (mesh[ei].IsDeleted()) return 0.0;
|
||||||
|
|
||||||
|
for(auto ei : elementsonnode[pi3])
|
||||||
|
if (mesh[ei].IsDeleted()) return 0.0;
|
||||||
|
|
||||||
|
for(auto ei : elementsonnode[pi4])
|
||||||
|
if (mesh[ei].IsDeleted()) return 0.0;
|
||||||
|
|
||||||
for (int k = 0; k < row.Size(); k++)
|
for (int k = 0; k < row.Size(); k++)
|
||||||
{
|
{
|
||||||
ElementIndex eli2 = row[k];
|
ElementIndex eli2 = row[k];
|
||||||
@ -3723,7 +3735,6 @@ double MeshOptimize3d :: SwapImprove2 ( Mesh & mesh, OPTIMIZEGOAL goal, ElementI
|
|||||||
if ( eli1 != eli2 )
|
if ( eli1 != eli2 )
|
||||||
{
|
{
|
||||||
Element & elem2 = mesh[eli2];
|
Element & elem2 = mesh[eli2];
|
||||||
if (elem2.IsDeleted()) continue;
|
|
||||||
if (elem2.GetType() != TET)
|
if (elem2.GetType() != TET)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -3992,8 +4003,12 @@ void MeshOptimize3d :: SwapImprove2 (Mesh & mesh, OPTIMIZEGOAL goal)
|
|||||||
QuickSort(faces_with_improvement);
|
QuickSort(faces_with_improvement);
|
||||||
|
|
||||||
for (auto [dummy, eli,j] : faces_with_improvement)
|
for (auto [dummy, eli,j] : faces_with_improvement)
|
||||||
|
{
|
||||||
|
if(mesh[eli].IsDeleted())
|
||||||
|
continue;
|
||||||
if(SwapImprove2( mesh, goal, eli, j, elementsonnode, belementsonnode, false) < 0.0)
|
if(SwapImprove2( mesh, goal, eli, j, elementsonnode, belementsonnode, false) < 0.0)
|
||||||
cnt++;
|
cnt++;
|
||||||
|
}
|
||||||
|
|
||||||
PrintMessage (5, cnt, " swaps performed");
|
PrintMessage (5, cnt, " swaps performed");
|
||||||
|
|
||||||
|
@ -293,18 +293,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
14.466,
|
16.89,
|
||||||
161.38
|
158.0
|
||||||
],
|
],
|
||||||
"angles_trig": [
|
"angles_trig": [
|
||||||
13.564,
|
16.739,
|
||||||
150.65
|
133.14
|
||||||
],
|
],
|
||||||
"ne1d": 32,
|
"ne1d": 32,
|
||||||
"ne2d": 220,
|
"ne2d": 220,
|
||||||
"ne3d": 563,
|
"ne3d": 551,
|
||||||
"quality_histogram": "[0, 0, 0, 3, 3, 7, 24, 22, 35, 34, 40, 43, 45, 60, 61, 53, 58, 41, 27, 7]",
|
"quality_histogram": "[0, 0, 0, 0, 0, 3, 4, 16, 23, 34, 48, 43, 50, 61, 70, 53, 51, 48, 37, 10]",
|
||||||
"total_badness": 960.07699692
|
"total_badness": 860.81905284
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
@ -473,7 +473,7 @@
|
|||||||
"ne2d": 726,
|
"ne2d": 726,
|
||||||
"ne3d": 2167,
|
"ne3d": 2167,
|
||||||
"quality_histogram": "[0, 4, 17, 35, 75, 117, 114, 112, 77, 51, 58, 86, 115, 177, 248, 293, 239, 204, 118, 27]",
|
"quality_histogram": "[0, 4, 17, 35, 75, 117, 114, 112, 77, 51, 58, 86, 115, 177, 248, 293, 239, 204, 118, 27]",
|
||||||
"total_badness": 4176.9278168
|
"total_badness": 4176.9284057
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
@ -860,18 +860,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
16.061,
|
8.4923,
|
||||||
157.39
|
161.34
|
||||||
],
|
],
|
||||||
"angles_trig": [
|
"angles_trig": [
|
||||||
16.851,
|
20.122,
|
||||||
127.45
|
127.45
|
||||||
],
|
],
|
||||||
"ne1d": 36,
|
"ne1d": 36,
|
||||||
"ne2d": 152,
|
"ne2d": 152,
|
||||||
"ne3d": 385,
|
"ne3d": 358,
|
||||||
"quality_histogram": "[0, 0, 0, 0, 0, 10, 8, 21, 24, 22, 29, 37, 42, 28, 43, 24, 38, 22, 25, 12]",
|
"quality_histogram": "[0, 0, 1, 0, 0, 2, 5, 11, 21, 19, 22, 22, 31, 29, 35, 39, 57, 37, 17, 10]",
|
||||||
"total_badness": 647.21940974
|
"total_badness": 559.67849284
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
@ -1014,18 +1014,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
5.7043,
|
5.6074,
|
||||||
170.47
|
169.95
|
||||||
],
|
],
|
||||||
"angles_trig": [
|
"angles_trig": [
|
||||||
8.0227,
|
7.5945,
|
||||||
160.66
|
159.99
|
||||||
],
|
],
|
||||||
"ne1d": 0,
|
"ne1d": 0,
|
||||||
"ne2d": 192,
|
"ne2d": 192,
|
||||||
"ne3d": 749,
|
"ne3d": 748,
|
||||||
"quality_histogram": "[0, 2, 30, 63, 86, 89, 71, 68, 67, 54, 50, 43, 27, 28, 17, 23, 13, 9, 7, 2]",
|
"quality_histogram": "[0, 0, 30, 62, 87, 77, 80, 61, 72, 38, 54, 43, 34, 27, 27, 20, 18, 10, 7, 1]",
|
||||||
"total_badness": 2339.9827516
|
"total_badness": 2287.1659209
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
@ -1391,9 +1391,9 @@
|
|||||||
],
|
],
|
||||||
"ne1d": 5988,
|
"ne1d": 5988,
|
||||||
"ne2d": 11102,
|
"ne2d": 11102,
|
||||||
"ne3d": 29343,
|
"ne3d": 29344,
|
||||||
"quality_histogram": "[3, 4, 5, 8, 14, 42, 121, 248, 691, 1040, 1542, 2504, 3118, 3920, 4331, 4281, 3366, 2421, 1367, 317]",
|
"quality_histogram": "[3, 4, 5, 8, 14, 45, 122, 251, 692, 1044, 1527, 2497, 3115, 3927, 4328, 4293, 3367, 2421, 1363, 318]",
|
||||||
"total_badness": 43497.876838
|
"total_badness": 43503.906462
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
@ -1408,7 +1408,7 @@
|
|||||||
"ne2d": 23964,
|
"ne2d": 23964,
|
||||||
"ne3d": 80995,
|
"ne3d": 80995,
|
||||||
"quality_histogram": "[2, 14, 4, 20, 18, 40, 94, 225, 485, 1115, 2415, 4537, 7493, 10248, 12753, 13190, 12020, 9207, 5660, 1455]",
|
"quality_histogram": "[2, 14, 4, 20, 18, 40, 94, 225, 485, 1115, 2415, 4537, 7493, 10248, 12753, 13190, 12020, 9207, 5660, 1455]",
|
||||||
"total_badness": 111934.52308
|
"total_badness": 111934.5334
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"hinge.stl": [
|
"hinge.stl": [
|
||||||
@ -1490,7 +1490,7 @@
|
|||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
20.701,
|
20.701,
|
||||||
144.6
|
141.98
|
||||||
],
|
],
|
||||||
"angles_trig": [
|
"angles_trig": [
|
||||||
22.443,
|
22.443,
|
||||||
@ -1498,9 +1498,9 @@
|
|||||||
],
|
],
|
||||||
"ne1d": 1862,
|
"ne1d": 1862,
|
||||||
"ne2d": 19474,
|
"ne2d": 19474,
|
||||||
"ne3d": 136546,
|
"ne3d": 136541,
|
||||||
"quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 12, 59, 281, 864, 2538, 6435, 13014, 21236, 29154, 31109, 24006, 7837]",
|
"quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 8, 59, 274, 862, 2533, 6435, 12998, 21248, 29157, 31131, 24003, 7832]",
|
||||||
"total_badness": 165965.29798
|
"total_badness": 165944.59425
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"lense.in2d": [
|
"lense.in2d": [
|
||||||
@ -1795,7 +1795,7 @@
|
|||||||
"ne2d": 830,
|
"ne2d": 830,
|
||||||
"ne3d": 2488,
|
"ne3d": 2488,
|
||||||
"quality_histogram": "[0, 0, 3, 37, 71, 155, 161, 102, 158, 211, 284, 276, 249, 203, 195, 139, 108, 79, 42, 15]",
|
"quality_histogram": "[0, 0, 3, 37, 71, 155, 161, 102, 158, 211, 284, 276, 249, 203, 195, 139, 108, 79, 42, 15]",
|
||||||
"total_badness": 5146.3098744
|
"total_badness": 5146.3098762
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
@ -2045,18 +2045,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
11.213,
|
11.356,
|
||||||
163.54
|
162.52
|
||||||
],
|
],
|
||||||
"angles_trig": [
|
"angles_trig": [
|
||||||
13.446,
|
16.741,
|
||||||
152.87
|
141.37
|
||||||
],
|
],
|
||||||
"ne1d": 232,
|
"ne1d": 232,
|
||||||
"ne2d": 598,
|
"ne2d": 598,
|
||||||
"ne3d": 1380,
|
"ne3d": 1418,
|
||||||
"quality_histogram": "[0, 0, 0, 2, 10, 15, 36, 48, 63, 92, 116, 131, 160, 158, 151, 113, 125, 91, 56, 13]",
|
"quality_histogram": "[0, 0, 0, 2, 9, 14, 27, 47, 66, 97, 109, 150, 161, 159, 147, 133, 119, 96, 66, 16]",
|
||||||
"total_badness": 2309.6335564
|
"total_badness": 2344.2576172
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
@ -2132,8 +2132,8 @@
|
|||||||
"ne1d": 570,
|
"ne1d": 570,
|
||||||
"ne2d": 1202,
|
"ne2d": 1202,
|
||||||
"ne3d": 1839,
|
"ne3d": 1839,
|
||||||
"quality_histogram": "[2, 21, 37, 57, 67, 78, 110, 136, 161, 177, 190, 158, 155, 149, 115, 78, 69, 51, 24, 4]",
|
"quality_histogram": "[2, 21, 37, 57, 66, 75, 111, 134, 161, 173, 193, 158, 151, 145, 117, 81, 73, 54, 25, 5]",
|
||||||
"total_badness": 4553.9697099
|
"total_badness": 4538.6020288
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
@ -2445,8 +2445,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
15.158,
|
15.154,
|
||||||
158.0
|
159.78
|
||||||
],
|
],
|
||||||
"angles_trig": [
|
"angles_trig": [
|
||||||
17.101,
|
17.101,
|
||||||
@ -2454,14 +2454,14 @@
|
|||||||
],
|
],
|
||||||
"ne1d": 410,
|
"ne1d": 410,
|
||||||
"ne2d": 606,
|
"ne2d": 606,
|
||||||
"ne3d": 796,
|
"ne3d": 791,
|
||||||
"quality_histogram": "[0, 0, 0, 0, 1, 3, 5, 6, 28, 40, 56, 62, 82, 83, 128, 96, 88, 75, 29, 14]",
|
"quality_histogram": "[0, 0, 0, 0, 2, 3, 4, 7, 33, 42, 54, 61, 88, 86, 118, 92, 89, 72, 29, 11]",
|
||||||
"total_badness": 1204.2331383
|
"total_badness": 1208.0636246
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
12.907,
|
12.907,
|
||||||
159.86
|
158.51
|
||||||
],
|
],
|
||||||
"angles_trig": [
|
"angles_trig": [
|
||||||
11.963,
|
11.963,
|
||||||
@ -2469,9 +2469,9 @@
|
|||||||
],
|
],
|
||||||
"ne1d": 510,
|
"ne1d": 510,
|
||||||
"ne2d": 1004,
|
"ne2d": 1004,
|
||||||
"ne3d": 1838,
|
"ne3d": 1859,
|
||||||
"quality_histogram": "[0, 0, 0, 4, 9, 30, 35, 80, 75, 109, 121, 152, 156, 200, 242, 206, 210, 105, 80, 24]",
|
"quality_histogram": "[0, 0, 0, 3, 7, 29, 43, 74, 68, 95, 115, 158, 153, 213, 250, 232, 206, 107, 81, 25]",
|
||||||
"total_badness": 3018.9734455
|
"total_badness": 3021.4076425
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
@ -2997,18 +2997,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
1.6657,
|
1.9786,
|
||||||
174.24
|
173.68
|
||||||
],
|
],
|
||||||
"angles_trig": [
|
"angles_trig": [
|
||||||
4.1081,
|
3.8198,
|
||||||
164.43
|
165.45
|
||||||
],
|
],
|
||||||
"ne1d": 0,
|
"ne1d": 0,
|
||||||
"ne2d": 692,
|
"ne2d": 692,
|
||||||
"ne3d": 2737,
|
"ne3d": 2726,
|
||||||
"quality_histogram": "[17, 200, 365, 335, 363, 301, 234, 187, 154, 143, 106, 84, 56, 48, 38, 45, 27, 19, 12, 3]",
|
"quality_histogram": "[19, 190, 366, 339, 352, 304, 237, 182, 157, 143, 110, 86, 53, 46, 34, 43, 30, 24, 10, 1]",
|
||||||
"total_badness": 13234.755766
|
"total_badness": 13096.6735
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
@ -3365,33 +3365,33 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
19.944,
|
20.148,
|
||||||
152.59
|
153.82
|
||||||
],
|
],
|
||||||
"angles_trig": [
|
"angles_trig": [
|
||||||
25.599,
|
25.599,
|
||||||
123.4
|
118.3
|
||||||
],
|
],
|
||||||
"ne1d": 68,
|
"ne1d": 68,
|
||||||
"ne2d": 100,
|
"ne2d": 100,
|
||||||
"ne3d": 130,
|
"ne3d": 135,
|
||||||
"quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 1, 3, 6, 7, 9, 5, 13, 21, 16, 21, 19, 7, 1]",
|
"quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 0, 4, 5, 2, 9, 5, 18, 25, 16, 22, 20, 7, 1]",
|
||||||
"total_badness": 187.02414176
|
"total_badness": 190.82756065
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
12.268,
|
12.268,
|
||||||
164.21
|
164.96
|
||||||
],
|
],
|
||||||
"angles_trig": [
|
"angles_trig": [
|
||||||
15.1,
|
15.698,
|
||||||
144.2
|
145.1
|
||||||
],
|
],
|
||||||
"ne1d": 102,
|
"ne1d": 102,
|
||||||
"ne2d": 238,
|
"ne2d": 238,
|
||||||
"ne3d": 468,
|
"ne3d": 471,
|
||||||
"quality_histogram": "[0, 0, 1, 10, 5, 27, 33, 42, 51, 36, 38, 28, 35, 40, 29, 26, 37, 24, 4, 2]",
|
"quality_histogram": "[0, 0, 1, 6, 3, 23, 25, 45, 63, 40, 34, 29, 30, 34, 27, 33, 43, 25, 8, 2]",
|
||||||
"total_badness": 980.42864262
|
"total_badness": 950.55701299
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"angles_tet": [
|
"angles_tet": [
|
||||||
|
Loading…
Reference in New Issue
Block a user