From 4d218fa042799cdcf4a330faf8991454c7025672 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 8 Oct 2019 17:03:49 +0200 Subject: [PATCH 01/10] Restructure MeshOptimize2d::EdgeSwapping() --- libsrc/meshing/improve2.cpp | 310 +++++++++++++++++------------------- libsrc/meshing/improve2.hpp | 16 ++ 2 files changed, 163 insertions(+), 163 deletions(-) diff --git a/libsrc/meshing/improve2.cpp b/libsrc/meshing/improve2.cpp index 07e32fef..4c6ec4a3 100644 --- a/libsrc/meshing/improve2.cpp +++ b/libsrc/meshing/improve2.cpp @@ -7,20 +7,6 @@ namespace netgen { - class Neighbour - { - int nr[3]; - int orient[3]; - - public: - Neighbour () { ; } - - void SetNr (int side, int anr) { nr[side] = anr; } - int GetNr (int side) { return nr[side]; } - - void SetOrientation (int side, int aorient) { orient[side] = aorient; } - int GetOrientation (int side) { return orient[side]; } - }; @@ -37,6 +23,152 @@ namespace netgen }; + bool MeshOptimize2d :: EdgeSwapping (Mesh & mesh, const int usemetric, + Array &neighbors, + Array &swapped, + const SurfaceElementIndex t1, const int o1, + const int surfnr, + const int t, + NgArray &pdef, + const bool check_only) + { + bool should; + bool do_swap = false; + + SurfaceElementIndex t2 = neighbors[t1].GetNr (o1); + int o2 = neighbors[t1].GetOrientation (o1); + + if (t2 == -1) return false; + if (swapped[t1] || swapped[t2]) return false; + + + PointIndex pi1 = mesh[t1].PNumMod(o1+1+1); + PointIndex pi2 = mesh[t1].PNumMod(o1+1+2); + PointIndex pi3 = mesh[t1].PNumMod(o1+1); + PointIndex pi4 = mesh[t2].PNumMod(o2+1); + + PointGeomInfo gi1 = mesh[t1].GeomInfoPiMod(o1+1+1); + PointGeomInfo gi2 = mesh[t1].GeomInfoPiMod(o1+1+2); + PointGeomInfo gi3 = mesh[t1].GeomInfoPiMod(o1+1); + PointGeomInfo gi4 = mesh[t2].GeomInfoPiMod(o2+1); + + bool allowswap = true; + + Vec<3> auxvec1 = mesh[pi3]-mesh[pi4]; + Vec<3> auxvec2 = mesh[pi1]-mesh[pi4]; + + allowswap = allowswap && fabs(1.-(auxvec1*auxvec2)/(auxvec1.Length()*auxvec2.Length())) > 1e-4; + + if(!allowswap) + return false; + + // normal of new + Vec<3> nv1 = Cross (auxvec1, auxvec2); + + auxvec1 = mesh.Point(pi4)-mesh.Point(pi3); + auxvec2 = mesh.Point(pi2)-mesh.Point(pi3); + allowswap = allowswap && fabs(1.-(auxvec1*auxvec2)/(auxvec1.Length()*auxvec2.Length())) > 1e-4; + + + if(!allowswap) + return false; + + Vec<3> nv2 = Cross (auxvec1, auxvec2); + + + // normals of original + Vec<3> nv3 = Cross (mesh[pi1]-mesh[pi4], mesh[pi2]-mesh[pi4]); + Vec<3> nv4 = Cross (mesh[pi2]-mesh[pi3], mesh[pi1]-mesh[pi3]); + + nv3 *= -1; + nv4 *= -1; + nv3.Normalize(); + nv4.Normalize(); + + nv1.Normalize(); + nv2.Normalize(); + + Vec<3> nvp3, nvp4; + GetNormalVector (surfnr, mesh.Point(pi3), gi3, nvp3); + + nvp3.Normalize(); + + GetNormalVector (surfnr, mesh.Point(pi4), gi4, nvp4); + + nvp4.Normalize(); + + + + double critval = cos (M_PI / 6); // 30 degree + allowswap = allowswap && + (nv1 * nvp3 > critval) && + (nv1 * nvp4 > critval) && + (nv2 * nvp3 > critval) && + (nv2 * nvp4 > critval) && + (nvp3 * nv3 > critval) && + (nvp4 * nv4 > critval); + + + double horder = Dist (mesh[pi1], mesh[pi2]); + + if ( // nv1 * nv2 >= 0 && + nv1.Length() > 1e-3 * horder * horder && + nv2.Length() > 1e-3 * horder * horder && + allowswap ) + { + if (!usemetric) + { + int e = pdef[pi1] + pdef[pi2] - pdef[pi3] - pdef[pi4]; + double d = + Dist2 (mesh[pi1], mesh[pi2]) - + Dist2 (mesh[pi3], mesh[pi4]); + + should = e >= t && (e > 2 || d > 0); + } + else + { + double loch = mesh.GetH(mesh[pi1]); + should = + CalcTriangleBadness (mesh[pi4], mesh[pi3], mesh[pi1], metricweight, loch) + + CalcTriangleBadness (mesh[pi3], mesh[pi4], mesh[pi2], metricweight, loch) < + CalcTriangleBadness (mesh[pi1], mesh[pi2], mesh[pi3], metricweight, loch) + + CalcTriangleBadness (mesh[pi2], mesh[pi1], mesh[pi4], metricweight, loch); + } + + if (allowswap) + { + Element2d sw1 (pi4, pi3, pi1); + Element2d sw2 (pi3, pi4, pi2); + + int legal1 = + mesh.LegalTrig (mesh[t1]) + + mesh.LegalTrig (mesh[t2]); + int legal2 = + mesh.LegalTrig (sw1) + mesh.LegalTrig (sw2); + + if (legal1 < legal2) should = true; + if (legal2 < legal1) should = false; + } + + do_swap = should; + if (should && !check_only) + { + // do swapping ! + + mesh[t1] = { { pi1, gi1 }, { pi4, gi4 }, { pi3, gi3 } }; + mesh[t2] = { { pi2, gi2 }, { pi3, gi3 }, { pi4, gi4 } }; + + pdef[pi1]--; + pdef[pi2]--; + pdef[pi3]++; + pdef[pi4]++; + + swapped[t1] = true; + swapped[t2] = true; + } + } + return do_swap; + } void MeshOptimize2d :: EdgeSwapping (Mesh & mesh, int usemetric) @@ -261,155 +393,7 @@ namespace netgen throw NgException ("Meshing stopped"); for (int o1 = 0; o1 < 3; o1++) - { - bool should; - - SurfaceElementIndex t2 = neighbors[t1].GetNr (o1); - int o2 = neighbors[t1].GetOrientation (o1); - - if (t2 == -1) continue; - if (swapped[t1] || swapped[t2]) continue; - - - PointIndex pi1 = mesh[t1].PNumMod(o1+1+1); - PointIndex pi2 = mesh[t1].PNumMod(o1+1+2); - PointIndex pi3 = mesh[t1].PNumMod(o1+1); - PointIndex pi4 = mesh[t2].PNumMod(o2+1); - - PointGeomInfo gi1 = mesh[t1].GeomInfoPiMod(o1+1+1); - PointGeomInfo gi2 = mesh[t1].GeomInfoPiMod(o1+1+2); - PointGeomInfo gi3 = mesh[t1].GeomInfoPiMod(o1+1); - PointGeomInfo gi4 = mesh[t2].GeomInfoPiMod(o2+1); - - bool allowswap = true; - - Vec<3> auxvec1 = mesh[pi3]-mesh[pi4]; - Vec<3> auxvec2 = mesh[pi1]-mesh[pi4]; - - allowswap = allowswap && fabs(1.-(auxvec1*auxvec2)/(auxvec1.Length()*auxvec2.Length())) > 1e-4; - - if(!allowswap) - continue; - - // normal of new - Vec<3> nv1 = Cross (auxvec1, auxvec2); - - auxvec1 = mesh.Point(pi4)-mesh.Point(pi3); - auxvec2 = mesh.Point(pi2)-mesh.Point(pi3); - allowswap = allowswap && fabs(1.-(auxvec1*auxvec2)/(auxvec1.Length()*auxvec2.Length())) > 1e-4; - - - if(!allowswap) - continue; - - Vec<3> nv2 = Cross (auxvec1, auxvec2); - - - // normals of original - Vec<3> nv3 = Cross (mesh[pi1]-mesh[pi4], mesh[pi2]-mesh[pi4]); - Vec<3> nv4 = Cross (mesh[pi2]-mesh[pi3], mesh[pi1]-mesh[pi3]); - - nv3 *= -1; - nv4 *= -1; - nv3.Normalize(); - nv4.Normalize(); - - nv1.Normalize(); - nv2.Normalize(); - - Vec<3> nvp3, nvp4; - GetNormalVector (surfnr, mesh.Point(pi3), gi3, nvp3); - - nvp3.Normalize(); - - GetNormalVector (surfnr, mesh.Point(pi4), gi4, nvp4); - - nvp4.Normalize(); - - - - double critval = cos (M_PI / 6); // 30 degree - allowswap = allowswap && - (nv1 * nvp3 > critval) && - (nv1 * nvp4 > critval) && - (nv2 * nvp3 > critval) && - (nv2 * nvp4 > critval) && - (nvp3 * nv3 > critval) && - (nvp4 * nv4 > critval); - - - double horder = Dist (mesh[pi1], mesh[pi2]); - - if ( // nv1 * nv2 >= 0 && - nv1.Length() > 1e-3 * horder * horder && - nv2.Length() > 1e-3 * horder * horder && - allowswap ) - { - if (!usemetric) - { - int e = pdef[pi1] + pdef[pi2] - pdef[pi3] - pdef[pi4]; - double d = - Dist2 (mesh[pi1], mesh[pi2]) - - Dist2 (mesh[pi3], mesh[pi4]); - - should = e >= t && (e > 2 || d > 0); - } - else - { - double loch = mesh.GetH(mesh[pi1]); - should = - CalcTriangleBadness (mesh[pi4], mesh[pi3], mesh[pi1], metricweight, loch) + - CalcTriangleBadness (mesh[pi3], mesh[pi4], mesh[pi2], metricweight, loch) < - CalcTriangleBadness (mesh[pi1], mesh[pi2], mesh[pi3], metricweight, loch) + - CalcTriangleBadness (mesh[pi2], mesh[pi1], mesh[pi4], metricweight, loch); - } - - if (allowswap) - { - Element2d sw1 (pi4, pi3, pi1); - Element2d sw2 (pi3, pi4, pi2); - - int legal1 = - mesh.LegalTrig (mesh[t1]) + - mesh.LegalTrig (mesh[t2]); - int legal2 = - mesh.LegalTrig (sw1) + mesh.LegalTrig (sw2); - - if (legal1 < legal2) should = true; - if (legal2 < legal1) should = false; - } - - if (should) - { - // do swapping ! - - done = true; - - /* - mesh[t1] = { pi1, pi4, pi3 }; - mesh[t2] = { pi2, pi3, pi4 }; - - mesh[t1].GeomInfoPi(1) = gi1; - mesh[t1].GeomInfoPi(2) = gi4; - mesh[t1].GeomInfoPi(3) = gi3; - - mesh[t2].GeomInfoPi(1) = gi2; - mesh[t2].GeomInfoPi(2) = gi3; - mesh[t2].GeomInfoPi(3) = gi4; - */ - mesh[t1] = { { pi1, gi1 }, { pi4, gi4 }, { pi3, gi3 } }; - mesh[t2] = { { pi2, gi2 }, { pi3, gi3 }, { pi4, gi4 } }; - - pdef[pi1]--; - pdef[pi2]--; - pdef[pi3]++; - pdef[pi4]++; - - swapped[t1] = true; - swapped[t2] = true; - } - } - } + done |= EdgeSwapping(mesh, usemetric, neighbors, swapped, t1, o1, surfnr, t, pdef, false); } t--; } diff --git a/libsrc/meshing/improve2.hpp b/libsrc/meshing/improve2.hpp index ec09b237..d84d2d01 100644 --- a/libsrc/meshing/improve2.hpp +++ b/libsrc/meshing/improve2.hpp @@ -2,6 +2,20 @@ #define FILE_IMPROVE2 +class Neighbour +{ + int nr[3]; + int orient[3]; + +public: + Neighbour () { ; } + + void SetNr (int side, int anr) { nr[side] = anr; } + int GetNr (int side) { return nr[side]; } + + void SetOrientation (int side, int aorient) { orient[side] = aorient; } + int GetOrientation (int side) { return orient[side]; } +}; /// class MeshOptimize2d @@ -22,6 +36,8 @@ public: void ProjectBoundaryPoints(NgArray & surfaceindex, const NgArray* > & from, NgArray* > & dest); + bool EdgeSwapping (Mesh & mesh, const int usemetric, Array &neighbors, Array &swapped, + const SurfaceElementIndex t1, const int edge, const int surfnr, const int t, NgArray &pdef, const bool check_only=false); void EdgeSwapping (Mesh & mesh, int usemetric); void CombineImprove (Mesh & mesh); void SplitImprove (Mesh & mesh); From f24a749fb2a01eacd1fa1ffed1eccc6cf29887dc Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 8 Oct 2019 17:29:38 +0200 Subject: [PATCH 02/10] Parallel MeshOptimize2d::EdgeSwapping() (individual faces) --- libsrc/meshing/improve2.cpp | 38 +- tests/pytest/results.json | 974 ++++++++++++++++++------------------ 2 files changed, 513 insertions(+), 499 deletions(-) diff --git a/libsrc/meshing/improve2.cpp b/libsrc/meshing/improve2.cpp index 4c6ec4a3..e0efde2a 100644 --- a/libsrc/meshing/improve2.cpp +++ b/libsrc/meshing/improve2.cpp @@ -375,26 +375,40 @@ namespace netgen + Array> improvement_candidates(3*seia.Size()); + atomic cnt(0); + int t = 4; bool done = false; while (!done && t >= 2) { - for (int i = 0; i < seia.Size(); i++) - { - SurfaceElementIndex t1 = seia[i]; + cnt = 0; + ParallelForRange( Range(seia), [&] (auto myrange) + { + for (auto i : myrange) + { + SurfaceElementIndex t1 = seia[i]; - if (mesh[t1].IsDeleted()) - continue; + if (mesh[t1].IsDeleted()) + continue; - if (mesh[t1].GetIndex() != faceindex) - continue; + if (mesh[t1].GetIndex() != faceindex) + continue; - if (multithread.terminate) - throw NgException ("Meshing stopped"); + if (multithread.terminate) + throw NgException ("Meshing stopped"); - for (int o1 = 0; o1 < 3; o1++) - done |= EdgeSwapping(mesh, usemetric, neighbors, swapped, t1, o1, surfnr, t, pdef, false); - } + for (int o1 = 0; o1 < 3; o1++) + if(EdgeSwapping(mesh, usemetric, neighbors, swapped, t1, o1, surfnr, t, pdef, true)) + improvement_candidates[cnt++]= std::make_pair(t1,o1); + } + }); + + auto elements_with_improvement = improvement_candidates.Range(cnt.load()); + QuickSort(elements_with_improvement); + + for (auto [t1,o1] : elements_with_improvement) + done |= EdgeSwapping(mesh, usemetric, neighbors, swapped, t1, o1, surfnr, t, pdef, false); t--; } diff --git a/tests/pytest/results.json b/tests/pytest/results.json index 4a1bcf12..79f56322 100644 --- a/tests/pytest/results.json +++ b/tests/pytest/results.json @@ -3,9 +3,9 @@ { "ne1d": 74, "ne2d": 54, - "ne3d": 50, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 5, 8, 13, 3, 9, 5, 0, 1, 1]", - "total_badness": 74.774553826 + "ne3d": 40, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 7, 16, 1, 5, 2, 0, 0, 0]", + "total_badness": 61.085020201 }, { "ne1d": 59, @@ -24,32 +24,32 @@ { "ne1d": 74, "ne2d": 54, - "ne3d": 50, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 5, 8, 13, 3, 9, 5, 0, 1, 1]", - "total_badness": 74.77454941 + "ne3d": 40, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 7, 16, 1, 5, 2, 0, 0, 0]", + "total_badness": 61.085020201 }, { "ne1d": 118, "ne2d": 140, "ne3d": 165, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 5, 13, 13, 25, 31, 25, 20, 17, 12, 1]", - "total_badness": 228.72078637 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 9, 13, 23, 20, 31, 24, 22, 14, 6, 1]", + "total_badness": 233.73391407 }, { "ne1d": 181, "ne2d": 323, - "ne3d": 507, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 9, 20, 35, 56, 56, 81, 90, 83, 59, 15]", - "total_badness": 661.00817809 + "ne3d": 513, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 15, 34, 56, 67, 96, 86, 86, 46, 18]", + "total_badness": 667.61850419 } ], "boxcyl.geo": [ { "ne1d": 190, "ne2d": 468, - "ne3d": 858, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 31, 91, 73, 79, 87, 106, 114, 102, 89, 66, 18]", - "total_badness": 1232.0426735 + "ne3d": 846, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 4, 30, 91, 78, 91, 92, 93, 102, 104, 80, 59, 22]", + "total_badness": 1226.0578147 }, { "ne1d": 94, @@ -61,39 +61,39 @@ { "ne1d": 136, "ne2d": 222, - "ne3d": 384, - "quality_histogram": "[0, 0, 1, 0, 3, 3, 3, 6, 11, 17, 21, 28, 34, 44, 68, 64, 49, 19, 11, 2]", - "total_badness": 598.99833044 + "ne3d": 381, + "quality_histogram": "[0, 0, 0, 0, 0, 2, 4, 3, 7, 15, 16, 27, 38, 51, 68, 67, 49, 17, 16, 1]", + "total_badness": 567.29889026 }, { "ne1d": 190, "ne2d": 468, - "ne3d": 850, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 29, 87, 73, 75, 86, 106, 97, 112, 87, 75, 21]", - "total_badness": 1214.229893 + "ne3d": 833, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 30, 87, 78, 78, 90, 88, 104, 103, 87, 64, 22]", + "total_badness": 1198.1799119 }, { "ne1d": 284, - "ne2d": 938, - "ne3d": 3761, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 20, 59, 118, 250, 456, 628, 751, 755, 564, 153]", - "total_badness": 4693.1208525 + "ne2d": 936, + "ne3d": 3833, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 17, 53, 160, 270, 442, 625, 795, 755, 544, 165]", + "total_badness": 4795.1972581 }, { "ne1d": 456, "ne2d": 2496, - "ne3d": 18969, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 5, 8, 15, 43, 130, 353, 876, 1713, 3018, 4122, 4317, 3271, 1098]", - "total_badness": 23072.833527 + "ne3d": 19027, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 6, 16, 41, 134, 386, 861, 1759, 3032, 4100, 4323, 3238, 1129]", + "total_badness": 23153.342852 } ], "circle_on_cube.geo": [ { "ne1d": 94, - "ne2d": 174, - "ne3d": 646, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 10, 23, 48, 81, 117, 100, 123, 86, 43, 10]", - "total_badness": 859.43881883 + "ne2d": 170, + "ne3d": 634, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 21, 37, 42, 77, 93, 99, 106, 106, 40, 9]", + "total_badness": 852.35637426 }, { "ne1d": 40, @@ -105,39 +105,39 @@ { "ne1d": 62, "ne2d": 94, - "ne3d": 182, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 14, 21, 35, 35, 33, 19, 9, 8, 0]", - "total_badness": 258.4064329 + "ne3d": 185, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 7, 12, 31, 26, 37, 27, 19, 14, 8, 0]", + "total_badness": 264.64378082 }, { "ne1d": 94, - "ne2d": 174, - "ne3d": 621, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 11, 45, 59, 93, 114, 121, 104, 53, 14]", - "total_badness": 804.68562065 + "ne2d": 170, + "ne3d": 609, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 9, 28, 31, 67, 80, 97, 121, 106, 53, 12]", + "total_badness": 797.71713532 }, { "ne1d": 138, "ne2d": 382, - "ne3d": 2054, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 15, 57, 129, 210, 330, 426, 450, 321, 109]", - "total_badness": 2526.4427939 + "ne3d": 2047, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 12, 24, 77, 153, 249, 384, 402, 417, 254, 72]", + "total_badness": 2570.7494356 }, { "ne1d": 224, - "ne2d": 944, - "ne3d": 11988, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 2, 17, 33, 82, 226, 556, 1140, 1929, 2512, 2801, 2061, 628]", - "total_badness": 14608.275962 + "ne2d": 942, + "ne3d": 12152, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 15, 83, 237, 599, 1170, 1934, 2615, 2796, 2123, 572]", + "total_badness": 14806.696612 } ], "cone.geo": [ { "ne1d": 64, "ne2d": 722, - "ne3d": 1231, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 8, 22, 29, 50, 88, 118, 123, 158, 175, 140, 137, 111, 52, 19]", - "total_badness": 1853.3096959 + "ne3d": 1234, + "quality_histogram": "[0, 0, 0, 0, 0, 3, 1, 15, 38, 55, 88, 123, 143, 139, 184, 147, 119, 105, 57, 17]", + "total_badness": 1861.257399 }, { "ne1d": 32, @@ -156,23 +156,23 @@ { "ne1d": 64, "ne2d": 722, - "ne3d": 1208, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 2, 15, 22, 47, 81, 110, 131, 144, 172, 150, 145, 112, 62, 14]", - "total_badness": 1783.4859474 + "ne3d": 1211, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 8, 20, 59, 82, 118, 147, 128, 167, 157, 135, 108, 65, 15]", + "total_badness": 1789.8591485 }, { "ne1d": 96, "ne2d": 1660, - "ne3d": 4423, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 4, 35, 88, 158, 276, 400, 584, 726, 802, 735, 464, 150]", - "total_badness": 5769.9946848 + "ne3d": 4464, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 4, 11, 30, 74, 185, 273, 414, 599, 748, 785, 747, 434, 160]", + "total_badness": 5840.7208133 }, { "ne1d": 160, "ne2d": 4748, - "ne3d": 27126, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 3, 13, 31, 83, 303, 735, 1519, 2944, 4316, 5668, 5807, 4355, 1349]", - "total_badness": 33434.663911 + "ne3d": 27166, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 4, 14, 38, 87, 310, 736, 1515, 2971, 4344, 5642, 5811, 4361, 1333]", + "total_badness": 33504.993018 } ], "cube.geo": [ @@ -213,54 +213,54 @@ }, { "ne1d": 72, - "ne2d": 118, - "ne3d": 184, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 10, 7, 19, 18, 37, 33, 33, 14, 6]", - "total_badness": 241.24676972 + "ne2d": 116, + "ne3d": 167, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 4, 2, 5, 5, 16, 8, 18, 30, 31, 29, 12, 6]", + "total_badness": 224.72495191 } ], "cubeandring.geo": [ { "ne1d": 262, - "ne2d": 722, - "ne3d": 2188, - "quality_histogram": "[1, 9, 25, 36, 90, 100, 108, 114, 90, 73, 63, 100, 149, 190, 251, 264, 241, 168, 96, 20]", - "total_badness": 4412.1941358 + "ne2d": 724, + "ne3d": 2220, + "quality_histogram": "[3, 13, 18, 47, 87, 95, 119, 121, 98, 68, 86, 122, 167, 187, 216, 243, 225, 169, 111, 25]", + "total_badness": 4594.1424775 }, { "ne1d": 134, "ne2d": 162, - "ne3d": 252, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 1, 2, 1, 3, 8, 24, 28, 49, 38, 41, 29, 19, 7, 1]", - "total_badness": 365.81827351 + "ne3d": 247, + "quality_histogram": "[0, 0, 0, 0, 0, 2, 0, 0, 4, 2, 11, 19, 35, 48, 38, 39, 24, 14, 9, 2]", + "total_badness": 361.08642754 }, { "ne1d": 190, - "ne2d": 298, - "ne3d": 613, - "quality_histogram": "[0, 0, 0, 0, 2, 0, 0, 4, 3, 17, 49, 47, 61, 93, 110, 82, 52, 60, 28, 5]", - "total_badness": 897.54658869 + "ne2d": 300, + "ne3d": 630, + "quality_histogram": "[0, 0, 0, 1, 2, 0, 0, 3, 10, 16, 51, 70, 62, 108, 101, 78, 62, 43, 19, 4]", + "total_badness": 945.8223883 }, { "ne1d": 262, - "ne2d": 722, - "ne3d": 2054, - "quality_histogram": "[0, 3, 12, 28, 61, 84, 109, 97, 80, 55, 48, 68, 112, 166, 245, 277, 249, 212, 116, 32]", - "total_badness": 3795.4750393 + "ne2d": 724, + "ne3d": 2075, + "quality_histogram": "[0, 3, 10, 24, 70, 91, 119, 86, 82, 50, 48, 83, 125, 169, 212, 265, 273, 210, 123, 32]", + "total_badness": 3839.258335 }, { "ne1d": 378, "ne2d": 1412, - "ne3d": 7752, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 1, 9, 13, 27, 56, 136, 281, 548, 921, 1256, 1534, 1557, 1091, 320]", - "total_badness": 9761.7065165 + "ne3d": 7646, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 2, 9, 19, 60, 144, 300, 559, 885, 1284, 1510, 1488, 1055, 330]", + "total_badness": 9628.2237959 }, { "ne1d": 624, - "ne2d": 3942, - "ne3d": 38282, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 3, 10, 28, 117, 334, 795, 2026, 3889, 5942, 8057, 8537, 6447, 2097]", - "total_badness": 46825.777983 + "ne2d": 3944, + "ne3d": 43287, + "quality_histogram": "[0, 0, 0, 0, 2, 40, 194, 422, 757, 1077, 1754, 2592, 3765, 4982, 5953, 6630, 6135, 5003, 3105, 876]", + "total_badness": 61333.463425 } ], "cubeandspheres.geo": [ @@ -268,131 +268,131 @@ "ne1d": 144, "ne2d": 148, "ne3d": 98, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 3, 4, 18, 19, 13, 20, 2, 9, 1, 0]", - "total_badness": 145.83375109 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 3, 4, 16, 18, 14, 20, 4, 8, 2, 0]", + "total_badness": 145.06570717 }, { "ne1d": 144, "ne2d": 150, "ne3d": 100, "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 7, 10, 16, 18, 15, 17, 6, 5, 4, 0]", - "total_badness": 146.646861 + "total_badness": 146.6442139 }, { "ne1d": 144, "ne2d": 148, "ne3d": 98, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 6, 6, 19, 21, 12, 18, 5, 4, 4, 0]", - "total_badness": 145.14580662 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 6, 6, 17, 20, 14, 18, 5, 6, 3, 0]", + "total_badness": 144.34810104 }, { "ne1d": 144, "ne2d": 148, "ne3d": 98, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 3, 4, 18, 19, 13, 20, 2, 9, 1, 0]", - "total_badness": 145.83375109 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 3, 4, 16, 18, 14, 20, 4, 8, 2, 0]", + "total_badness": 145.06570717 }, { "ne1d": 264, - "ne2d": 386, - "ne3d": 365, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 6, 24, 31, 43, 39, 53, 35, 44, 51, 28, 9, 0]", - "total_badness": 553.03362076 + "ne2d": 388, + "ne3d": 366, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 2, 4, 21, 28, 39, 47, 52, 37, 58, 40, 25, 10, 2]", + "total_badness": 550.46676248 }, { "ne1d": 428, - "ne2d": 930, - "ne3d": 1080, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 2, 19, 59, 37, 100, 136, 100, 123, 162, 160, 66, 65, 28, 22]", - "total_badness": 1684.1500639 + "ne2d": 926, + "ne3d": 1075, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 24, 51, 37, 103, 144, 97, 121, 156, 155, 71, 61, 31, 22]", + "total_badness": 1676.2336937 } ], "cubemcyl.geo": [ { "ne1d": 142, - "ne2d": 2488, - "ne3d": 20940, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 22, 78, 213, 367, 738, 1237, 1875, 2588, 3120, 3314, 3117, 2521, 1385, 365]", - "total_badness": 29036.424267 + "ne2d": 2490, + "ne3d": 20799, + "quality_histogram": "[0, 0, 0, 0, 0, 3, 28, 79, 219, 382, 656, 1158, 1775, 2464, 3005, 3406, 3192, 2557, 1522, 353]", + "total_badness": 28706.828456 }, { "ne1d": 64, "ne2d": 642, - "ne3d": 3203, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 3, 12, 17, 66, 128, 250, 364, 425, 515, 512, 463, 282, 137, 29]", - "total_badness": 4539.3174908 + "ne3d": 3229, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 12, 32, 67, 160, 255, 358, 490, 500, 493, 420, 301, 113, 27]", + "total_badness": 4623.4755628 }, { "ne1d": 102, - "ne2d": 1404, - "ne3d": 8421, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 7, 30, 87, 181, 362, 596, 792, 1120, 1271, 1262, 1165, 892, 516, 140]", - "total_badness": 11848.69595 + "ne2d": 1402, + "ne3d": 8204, + "quality_histogram": "[0, 0, 0, 0, 0, 1, 8, 22, 59, 164, 348, 591, 842, 1045, 1356, 1225, 1109, 817, 472, 145]", + "total_badness": 11539.42633 }, { "ne1d": 142, - "ne2d": 2488, - "ne3d": 19608, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 6, 40, 75, 246, 608, 1243, 2030, 2896, 3459, 3612, 2986, 1887, 518]", - "total_badness": 25605.226153 + "ne2d": 2490, + "ne3d": 19461, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 9, 29, 93, 229, 518, 1070, 1941, 2741, 3474, 3670, 3200, 1969, 518]", + "total_badness": 25234.660253 }, { "ne1d": 210, "ne2d": 5508, - "ne3d": 88843, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 23, 113, 364, 946, 2450, 5445, 10022, 14690, 18368, 18746, 13521, 4155]", - "total_badness": 109927.85826 + "ne3d": 88594, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 4, 31, 113, 362, 1035, 2435, 5625, 9861, 14712, 18443, 18771, 13294, 3908]", + "total_badness": 109777.71823 }, { "ne1d": 362, - "ne2d": 15120, - "ne3d": 521218, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 25, 119, 374, 1224, 3269, 9296, 24328, 50521, 82283, 109285, 119759, 91721, 29013]", - "total_badness": 633985.71695 + "ne2d": 15116, + "ne3d": 520770, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 25, 134, 437, 1202, 3273, 9236, 24185, 50863, 82792, 109294, 119384, 91342, 28599]", + "total_badness": 633693.0884 } ], "cubemsphere.geo": [ { "ne1d": 90, - "ne2d": 698, - "ne3d": 4877, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 6, 28, 55, 96, 194, 261, 445, 559, 740, 798, 698, 576, 333, 87]", - "total_badness": 6790.976699 + "ne2d": 700, + "ne3d": 4935, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 12, 29, 67, 121, 206, 278, 432, 625, 745, 752, 705, 569, 317, 77]", + "total_badness": 6938.6199468 }, { "ne1d": 44, - "ne2d": 280, - "ne3d": 783, - "quality_histogram": "[0, 0, 0, 0, 1, 2, 6, 19, 38, 61, 70, 94, 100, 91, 104, 76, 58, 38, 24, 1]", - "total_badness": 1271.4564508 + "ne2d": 278, + "ne3d": 771, + "quality_histogram": "[0, 0, 0, 1, 2, 1, 8, 23, 33, 57, 75, 84, 89, 119, 95, 69, 50, 35, 24, 6]", + "total_badness": 1259.9745028 }, { "ne1d": 68, "ne2d": 402, - "ne3d": 1571, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 5, 12, 20, 68, 134, 170, 243, 246, 237, 214, 145, 59, 17]", - "total_badness": 2230.374452 + "ne3d": 1556, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 6, 11, 21, 46, 111, 170, 223, 255, 263, 222, 133, 82, 13]", + "total_badness": 2179.1819908 }, { "ne1d": 90, - "ne2d": 698, - "ne3d": 4583, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 4, 9, 25, 77, 128, 251, 516, 657, 826, 857, 685, 432, 116]", - "total_badness": 5995.4068967 + "ne2d": 700, + "ne3d": 4607, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 3, 12, 47, 76, 137, 256, 520, 708, 812, 832, 677, 406, 120]", + "total_badness": 6067.5841219 }, { "ne1d": 146, - "ne2d": 1490, - "ne3d": 17783, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 3, 11, 31, 90, 203, 496, 1110, 1957, 3109, 3695, 3723, 2641, 714]", - "total_badness": 22085.583903 + "ne2d": 1486, + "ne3d": 17868, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 13, 20, 79, 207, 494, 1105, 1981, 2974, 3738, 3793, 2707, 757]", + "total_badness": 22135.731945 }, { "ne1d": 248, - "ne2d": 4356, - "ne3d": 113522, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 9, 35, 117, 341, 885, 2307, 5764, 11384, 18322, 23667, 25754, 19043, 5893]", - "total_badness": 138835.8933 + "ne2d": 4358, + "ne3d": 113948, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 14, 42, 113, 326, 855, 2300, 5766, 11158, 18354, 23917, 25885, 19416, 5801]", + "total_badness": 139251.67592 } ], "cylinder.geo": [ @@ -471,148 +471,148 @@ { "ne1d": 152, "ne2d": 1084, - "ne3d": 2865, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 3, 3, 28, 44, 88, 157, 276, 340, 471, 505, 493, 358, 99]", - "total_badness": 3710.287399 + "ne3d": 2848, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 5, 17, 49, 92, 153, 260, 359, 461, 527, 497, 339, 88]", + "total_badness": 3685.3796091 }, { "ne1d": 248, "ne2d": 2820, - "ne3d": 17765, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 6, 15, 48, 129, 362, 859, 1699, 2843, 3786, 4041, 3023, 954]", - "total_badness": 21668.180843 + "ne3d": 17783, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 5, 16, 43, 133, 373, 852, 1712, 2853, 3822, 4037, 2968, 969]", + "total_badness": 21702.916892 } ], "ellipsoid.geo": [ { "ne1d": 0, "ne2d": 704, - "ne3d": 1262, - "quality_histogram": "[0, 0, 0, 0, 1, 0, 8, 26, 39, 86, 118, 127, 178, 146, 148, 147, 107, 76, 43, 12]", - "total_badness": 1984.8094939 + "ne3d": 1278, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 5, 20, 57, 75, 122, 125, 161, 167, 137, 161, 107, 83, 45, 13]", + "total_badness": 1996.4481212 }, { "ne1d": 0, "ne2d": 192, - "ne3d": 942, - "quality_histogram": "[22, 148, 137, 126, 91, 56, 81, 69, 47, 36, 29, 32, 23, 13, 12, 9, 5, 5, 1, 0]", - "total_badness": 5747.5204438 + "ne3d": 899, + "quality_histogram": "[19, 132, 126, 95, 104, 78, 56, 48, 58, 43, 26, 22, 29, 20, 13, 8, 10, 9, 2, 1]", + "total_badness": 5295.2975939 }, { "ne1d": 0, "ne2d": 394, - "ne3d": 598, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 5, 15, 17, 44, 69, 81, 100, 91, 53, 54, 39, 20, 9]", - "total_badness": 903.65236615 + "ne3d": 590, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 4, 11, 24, 40, 74, 80, 100, 88, 58, 41, 40, 19, 11]", + "total_badness": 889.56775696 }, { "ne1d": 0, "ne2d": 704, - "ne3d": 1256, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 18, 35, 52, 103, 128, 169, 173, 155, 154, 121, 81, 49, 18]", - "total_badness": 1908.051206 + "ne3d": 1261, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 13, 44, 60, 101, 111, 156, 158, 153, 168, 123, 101, 55, 17]", + "total_badness": 1904.2716478 }, { "ne1d": 0, "ne2d": 1618, - "ne3d": 5592, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 22, 74, 178, 307, 491, 711, 944, 1067, 921, 675, 199]", - "total_badness": 7199.7867843 + "ne3d": 5680, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 0, 4, 29, 94, 160, 324, 548, 748, 969, 1061, 936, 638, 167]", + "total_badness": 7360.2666331 }, { "ne1d": 0, "ne2d": 4236, - "ne3d": 41345, - "quality_histogram": "[0, 0, 0, 0, 3, 20, 108, 266, 403, 644, 1110, 1904, 2921, 4621, 6100, 6869, 6568, 5527, 3324, 957]", - "total_badness": 56476.648492 + "ne3d": 37387, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 8, 18, 81, 226, 652, 1604, 3366, 5913, 7905, 8838, 6765, 2011]", + "total_badness": 45343.133766 } ], "ellipticcone.geo": [ { "ne1d": 174, "ne2d": 1556, - "ne3d": 5213, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 7, 26, 47, 141, 216, 357, 555, 760, 902, 879, 712, 459, 151]", - "total_badness": 6957.997336 + "ne3d": 5138, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 12, 22, 57, 112, 186, 396, 517, 723, 897, 960, 680, 434, 141]", + "total_badness": 6849.0044378 }, { "ne1d": 86, "ne2d": 380, - "ne3d": 587, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 3, 8, 8, 14, 33, 55, 67, 67, 76, 85, 69, 56, 32, 14]", - "total_badness": 853.7762584 + "ne3d": 590, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 5, 15, 15, 32, 45, 67, 79, 88, 83, 67, 48, 31, 14]", + "total_badness": 857.18307391 }, { "ne1d": 130, "ne2d": 864, - "ne3d": 1780, - "quality_histogram": "[0, 0, 0, 1, 3, 4, 12, 22, 34, 43, 79, 96, 136, 191, 227, 251, 258, 253, 129, 41]", - "total_badness": 2537.0484182 + "ne3d": 1713, + "quality_histogram": "[0, 0, 0, 0, 0, 3, 8, 21, 30, 51, 83, 106, 145, 221, 218, 248, 246, 180, 122, 31]", + "total_badness": 2456.9795033 }, { "ne1d": 174, "ne2d": 1556, - "ne3d": 4971, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 3, 17, 53, 107, 248, 431, 665, 897, 978, 791, 593, 187]", - "total_badness": 6359.4493283 + "ne3d": 4936, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 4, 15, 52, 109, 256, 443, 654, 865, 1006, 810, 538, 184]", + "total_badness": 6327.3304435 }, { "ne1d": 258, - "ne2d": 3454, - "ne3d": 13441, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 8, 29, 62, 198, 341, 643, 1044, 1682, 2259, 2506, 2486, 1671, 511]", - "total_badness": 17201.441954 + "ne2d": 3460, + "ne3d": 13213, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 4, 24, 96, 177, 365, 657, 1010, 1665, 2371, 2477, 2270, 1591, 505]", + "total_badness": 16972.974746 }, { "ne1d": 432, - "ne2d": 9518, - "ne3d": 69596, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 5, 40, 121, 306, 826, 1862, 3802, 7575, 11204, 14503, 14913, 11126, 3312]", - "total_badness": 85930.227173 + "ne2d": 9520, + "ne3d": 70326, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 13, 40, 122, 338, 786, 1853, 4006, 7465, 11360, 14481, 15208, 11188, 3466]", + "total_badness": 86818.381106 } ], "ellipticcyl.geo": [ { "ne1d": 156, "ne2d": 994, - "ne3d": 2275, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 10, 26, 44, 84, 125, 208, 263, 341, 376, 326, 261, 175, 35]", - "total_badness": 3156.3970605 + "ne3d": 2287, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 9, 28, 50, 88, 151, 203, 262, 348, 377, 324, 245, 168, 32]", + "total_badness": 3194.7013193 }, { "ne1d": 76, "ne2d": 238, "ne3d": 325, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 18, 28, 26, 37, 71, 54, 46, 27, 10, 2]", - "total_badness": 459.39040523 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 18, 28, 26, 37, 71, 53, 46, 28, 10, 2]", + "total_badness": 459.38557223 }, { "ne1d": 116, "ne2d": 596, - "ne3d": 1114, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 10, 17, 41, 80, 144, 172, 205, 165, 155, 97, 25]", - "total_badness": 1483.3007518 + "ne3d": 1141, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 4, 18, 32, 47, 73, 144, 189, 173, 199, 141, 102, 19]", + "total_badness": 1536.9702483 }, { "ne1d": 156, "ne2d": 994, - "ne3d": 2199, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 2, 8, 35, 43, 95, 163, 238, 314, 377, 378, 307, 193, 45]", - "total_badness": 2944.2434449 + "ne3d": 2213, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 2, 10, 31, 49, 117, 191, 232, 335, 376, 366, 281, 184, 38]", + "total_badness": 2990.869979 }, { "ne1d": 232, - "ne2d": 2198, - "ne3d": 8225, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 3, 5, 9, 46, 106, 269, 605, 988, 1459, 1629, 1655, 1138, 313]", - "total_badness": 10297.191925 + "ne2d": 2200, + "ne3d": 8317, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 5, 11, 47, 106, 271, 598, 1029, 1448, 1700, 1606, 1173, 322]", + "total_badness": 10409.762502 }, { "ne1d": 388, - "ne2d": 6124, - "ne3d": 55078, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 10, 28, 97, 356, 939, 2483, 5114, 8528, 11618, 12908, 9908, 3088]", - "total_badness": 66822.93034 + "ne2d": 6118, + "ne3d": 55159, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 9, 34, 86, 288, 797, 2294, 4900, 8294, 11813, 13122, 10147, 3374]", + "total_badness": 66617.550244 } ], "fichera.geo": [ @@ -654,62 +654,62 @@ { "ne1d": 144, "ne2d": 274, - "ne3d": 514, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 14, 32, 55, 87, 97, 91, 71, 52, 13]", - "total_badness": 666.67507269 + "ne3d": 516, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 16, 31, 59, 88, 103, 78, 75, 49, 12]", + "total_badness": 672.7632765 } ], "frame.step": [ { "ne1d": 12694, - "ne2d": 40474, - "ne3d": 221182, - "quality_histogram": "[2, 7, 8, 9, 8, 45, 297, 719, 1786, 3439, 6255, 10896, 17573, 25401, 32432, 35856, 35294, 28822, 17734, 4599]", - "total_badness": 301822.09951 + "ne2d": 40376, + "ne3d": 221132, + "quality_histogram": "[3, 8, 4, 13, 7, 42, 248, 732, 1691, 3393, 6209, 10718, 17518, 25459, 32156, 35899, 35412, 28951, 18016, 4653]", + "total_badness": 301320.76786 }, { "ne1d": 6026, - "ne2d": 11330, - "ne3d": 33930, - "quality_histogram": "[4, 44, 54, 95, 236, 493, 862, 1288, 1877, 2386, 2810, 3502, 3735, 3948, 3901, 3241, 2597, 1776, 871, 210]", - "total_badness": 59128.564033 + "ne2d": 11296, + "ne3d": 30460, + "quality_histogram": "[4, 6, 6, 7, 21, 43, 92, 257, 679, 1046, 1696, 2567, 3361, 4142, 4605, 4273, 3551, 2428, 1345, 331]", + "total_badness": 45199.935474 }, { "ne1d": 9704, - "ne2d": 24358, - "ne3d": 85648, - "quality_histogram": "[2, 6, 5, 10, 5, 24, 87, 165, 425, 1072, 2383, 4552, 7532, 10936, 13505, 14259, 13226, 10274, 5670, 1510]", - "total_badness": 117436.51999 + "ne2d": 24292, + "ne3d": 85251, + "quality_histogram": "[1, 6, 5, 10, 11, 34, 74, 181, 467, 1085, 2453, 4566, 7709, 11061, 13565, 14164, 12961, 9900, 5659, 1339]", + "total_badness": 117271.18554 } ], "hinge.stl": [ { "ne1d": 456, "ne2d": 1230, - "ne3d": 1990, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 2, 13, 19, 39, 60, 137, 183, 248, 311, 282, 280, 231, 136, 47]", - "total_badness": 2776.6730441 + "ne3d": 2006, + "quality_histogram": "[0, 0, 0, 0, 0, 2, 5, 9, 24, 42, 72, 137, 165, 225, 325, 287, 304, 216, 146, 47]", + "total_badness": 2804.4326922 }, { "ne1d": 298, - "ne2d": 610, - "ne3d": 793, - "quality_histogram": "[0, 0, 0, 3, 10, 12, 25, 19, 34, 52, 79, 76, 93, 95, 86, 82, 58, 40, 22, 7]", - "total_badness": 1364.5936087 + "ne2d": 612, + "ne3d": 800, + "quality_histogram": "[0, 0, 1, 5, 8, 14, 26, 21, 33, 47, 74, 78, 98, 89, 89, 80, 63, 44, 24, 6]", + "total_badness": 1384.3451953 }, { "ne1d": 370, "ne2d": 860, "ne3d": 1148, "quality_histogram": "[0, 0, 0, 0, 2, 4, 16, 24, 25, 32, 78, 104, 135, 154, 165, 176, 112, 66, 43, 12]", - "total_badness": 1761.668236 + "total_badness": 1761.6622395 }, { "ne1d": 516, "ne2d": 1584, "ne3d": 2528, - "quality_histogram": "[0, 0, 0, 0, 2, 1, 9, 16, 23, 49, 125, 186, 212, 309, 339, 362, 346, 314, 191, 44]", - "total_badness": 3558.9972665 + "quality_histogram": "[0, 0, 0, 0, 2, 1, 9, 16, 23, 49, 125, 185, 212, 311, 338, 362, 347, 313, 191, 44]", + "total_badness": 3559.0498754 }, { "ne1d": 722, @@ -720,10 +720,10 @@ }, { "ne1d": 1862, - "ne2d": 19514, - "ne3d": 137132, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 8, 37, 119, 375, 1131, 3044, 6883, 13679, 21959, 28650, 31016, 22896, 7333]", - "total_badness": 167715.38485 + "ne2d": 19516, + "ne3d": 137265, + "quality_histogram": "[0, 0, 0, 0, 0, 1, 3, 5, 47, 136, 444, 1131, 2812, 6902, 13203, 22054, 29007, 30796, 23323, 7401]", + "total_badness": 167751.20764 } ], "lshape3d.geo": [ @@ -731,8 +731,8 @@ "ne1d": 44, "ne2d": 28, "ne3d": 18, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 12, 0, 3, 0, 0, 0, 0]", - "total_badness": 27.289065401 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 16, 0, 1, 0, 0, 0, 0]", + "total_badness": 27.266612058 }, { "ne1d": 36, @@ -752,98 +752,98 @@ "ne1d": 44, "ne2d": 28, "ne3d": 18, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 12, 0, 3, 0, 0, 0, 0]", - "total_badness": 27.289065401 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 16, 0, 1, 0, 0, 0, 0]", + "total_badness": 27.266612058 }, { "ne1d": 80, "ne2d": 76, "ne3d": 88, "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 10, 9, 21, 23, 7, 6, 1, 4]", - "total_badness": 121.1271849 + "total_badness": 121.12718489 }, { "ne1d": 122, "ne2d": 204, - "ne3d": 331, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 7, 21, 26, 41, 39, 61, 57, 46, 24, 7]", - "total_badness": 443.95235947 + "ne3d": 326, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 11, 17, 43, 51, 53, 56, 50, 33, 6]", + "total_badness": 427.78776756 } ], "manyholes.geo": [ { "ne1d": 5886, - "ne2d": 48038, - "ne3d": 179405, - "quality_histogram": "[0, 0, 2, 1, 8, 27, 65, 207, 559, 1418, 3370, 7627, 12710, 20134, 27407, 30177, 29994, 24813, 16843, 4043]", - "total_badness": 238774.17579 + "ne2d": 48026, + "ne3d": 179303, + "quality_histogram": "[0, 0, 1, 4, 9, 24, 48, 165, 522, 1374, 3347, 7698, 12503, 20091, 27314, 30044, 29908, 25015, 17206, 4030]", + "total_badness": 238306.19112 }, { "ne1d": 2746, - "ne2d": 13838, - "ne3d": 29184, - "quality_histogram": "[0, 0, 0, 1, 5, 26, 45, 181, 387, 817, 1524, 2280, 3331, 4394, 4120, 3700, 3202, 2567, 1880, 724]", - "total_badness": 42098.721268 + "ne2d": 13834, + "ne3d": 29076, + "quality_histogram": "[0, 0, 0, 2, 13, 18, 50, 160, 398, 849, 1531, 2349, 3232, 4336, 4115, 3734, 3102, 2591, 1888, 708]", + "total_badness": 41978.532959 }, { "ne1d": 4106, - "ne2d": 27992, - "ne3d": 70789, - "quality_histogram": "[0, 0, 0, 2, 30, 78, 189, 443, 837, 1706, 2919, 4402, 7061, 9455, 10197, 10269, 9498, 7395, 4474, 1834]", - "total_badness": 100213.31676 + "ne2d": 27964, + "ne3d": 70880, + "quality_histogram": "[0, 0, 0, 3, 32, 74, 190, 412, 841, 1713, 2945, 4403, 7020, 9345, 10339, 10430, 9445, 7405, 4499, 1784]", + "total_badness": 100324.40391 } ], "manyholes2.geo": [ { "ne1d": 10202, - "ne2d": 55340, - "ne3d": 128088, - "quality_histogram": "[0, 0, 0, 0, 7, 30, 95, 288, 823, 2105, 4573, 7847, 11840, 18008, 18739, 18350, 16782, 14747, 10264, 3590]", - "total_badness": 176960.02706 + "ne2d": 55316, + "ne3d": 127893, + "quality_histogram": "[0, 0, 0, 1, 5, 36, 93, 304, 799, 2072, 4456, 7947, 11984, 17504, 18676, 18332, 17069, 14736, 10402, 3477]", + "total_badness": 176567.71812 } ], "matrix.geo": [ { "ne1d": 174, - "ne2d": 1194, - "ne3d": 5295, - "quality_histogram": "[0, 0, 32, 147, 135, 100, 130, 147, 177, 237, 361, 409, 554, 617, 583, 555, 457, 385, 212, 57]", - "total_badness": 9761.5954211 + "ne2d": 1196, + "ne3d": 5364, + "quality_histogram": "[0, 0, 38, 139, 142, 92, 140, 174, 157, 227, 340, 437, 522, 624, 575, 548, 536, 390, 222, 61]", + "total_badness": 9855.8573843 }, { "ne1d": 106, "ne2d": 600, - "ne3d": 2001, - "quality_histogram": "[0, 3, 20, 65, 122, 160, 137, 169, 184, 189, 172, 190, 184, 137, 89, 53, 45, 54, 20, 8]", - "total_badness": 4865.5803344 + "ne3d": 1993, + "quality_histogram": "[0, 3, 20, 76, 113, 151, 141, 159, 190, 172, 186, 171, 195, 136, 92, 65, 49, 47, 20, 7]", + "total_badness": 4853.2906164 }, { "ne1d": 132, "ne2d": 828, - "ne3d": 2783, - "quality_histogram": "[0, 0, 13, 51, 108, 146, 173, 161, 225, 265, 333, 287, 211, 205, 173, 161, 117, 93, 45, 16]", - "total_badness": 5980.1022567 + "ne3d": 2747, + "quality_histogram": "[0, 1, 16, 89, 90, 146, 158, 183, 205, 244, 313, 287, 231, 215, 178, 146, 89, 87, 52, 17]", + "total_badness": 6032.3841165 }, { "ne1d": 174, - "ne2d": 1194, - "ne3d": 5105, - "quality_histogram": "[0, 0, 20, 134, 116, 78, 117, 149, 152, 188, 285, 371, 498, 547, 578, 611, 503, 441, 254, 63]", - "total_badness": 9068.0076408 + "ne2d": 1196, + "ne3d": 5197, + "quality_histogram": "[0, 0, 25, 120, 129, 78, 122, 155, 136, 210, 281, 370, 474, 594, 563, 605, 538, 466, 258, 73]", + "total_badness": 9197.4127362 }, { "ne1d": 248, "ne2d": 2324, - "ne3d": 16255, - "quality_histogram": "[0, 0, 0, 0, 0, 5, 24, 75, 128, 202, 346, 678, 1062, 1517, 2149, 2515, 2754, 2540, 1722, 538]", - "total_badness": 21663.043545 + "ne3d": 16300, + "quality_histogram": "[0, 0, 0, 0, 0, 5, 23, 71, 137, 184, 373, 655, 1098, 1629, 2112, 2498, 2788, 2503, 1712, 512]", + "total_badness": 21759.792772 }, { "ne1d": 418, "ne2d": 5966, - "ne3d": 100388, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 6, 24, 71, 195, 503, 1186, 2824, 5989, 10497, 16251, 20497, 21258, 16049, 5037]", - "total_badness": 124129.95267 + "ne3d": 101129, + "quality_histogram": "[0, 0, 0, 0, 0, 2, 6, 17, 67, 187, 481, 1246, 2896, 6099, 10667, 16234, 20660, 21479, 16058, 5030]", + "total_badness": 125108.89116 } ], "ortho.geo": [ @@ -884,10 +884,10 @@ }, { "ne1d": 72, - "ne2d": 116, - "ne3d": 180, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 14, 9, 27, 39, 31, 30, 17, 5]", - "total_badness": 233.34798934 + "ne2d": 114, + "ne3d": 177, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 7, 13, 27, 39, 31, 32, 13, 6]", + "total_badness": 228.88985644 } ], "part1.stl": [ @@ -900,10 +900,10 @@ }, { "ne1d": 112, - "ne2d": 214, - "ne3d": 345, - "quality_histogram": "[0, 0, 0, 1, 3, 8, 9, 11, 16, 24, 47, 47, 42, 33, 41, 22, 22, 12, 5, 2]", - "total_badness": 612.66129201 + "ne2d": 212, + "ne3d": 329, + "quality_histogram": "[0, 0, 1, 2, 6, 8, 7, 12, 15, 28, 32, 46, 35, 35, 33, 26, 24, 8, 8, 3]", + "total_badness": 600.29793129 }, { "ne1d": 134, @@ -915,178 +915,178 @@ { "ne1d": 194, "ne2d": 596, - "ne3d": 1742, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 5, 13, 28, 73, 140, 199, 290, 262, 276, 254, 165, 37]", - "total_badness": 2317.9250987 + "ne3d": 1754, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 13, 28, 71, 147, 204, 282, 267, 286, 247, 166, 40]", + "total_badness": 2331.111722 }, { "ne1d": 266, "ne2d": 990, "ne3d": 4027, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 3, 6, 26, 75, 146, 296, 557, 679, 794, 780, 509, 155]", - "total_badness": 5077.2355534 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 3, 6, 26, 75, 146, 296, 557, 678, 795, 780, 509, 155]", + "total_badness": 5077.23567 }, { "ne1d": 674, "ne2d": 6870, - "ne3d": 81834, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 4, 21, 75, 257, 677, 1770, 4204, 8071, 12904, 17072, 18304, 14037, 4436]", - "total_badness": 100045.3114 + "ne3d": 81452, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 3, 4, 25, 77, 250, 594, 1752, 4117, 8196, 12789, 16981, 18438, 13807, 4419]", + "total_badness": 99550.92563 } ], "period.geo": [ { "ne1d": 344, - "ne2d": 1130, - "ne3d": 3294, - "quality_histogram": "[0, 0, 0, 0, 0, 11, 22, 35, 81, 112, 210, 253, 402, 409, 494, 439, 371, 274, 135, 46]", - "total_badness": 4918.0434035 + "ne2d": 1128, + "ne3d": 3333, + "quality_histogram": "[0, 0, 0, 0, 1, 2, 23, 34, 77, 133, 193, 290, 368, 443, 452, 422, 391, 299, 160, 45]", + "total_badness": 4947.3560633 }, { "ne1d": 160, "ne2d": 286, - "ne3d": 659, - "quality_histogram": "[0, 4, 8, 11, 15, 22, 23, 30, 40, 58, 66, 57, 66, 59, 57, 36, 43, 42, 16, 6]", - "total_badness": 1346.7559432 + "ne3d": 668, + "quality_histogram": "[0, 2, 16, 21, 17, 19, 28, 37, 40, 57, 60, 60, 75, 44, 43, 45, 44, 43, 14, 3]", + "total_badness": 1452.2340762 }, { "ne1d": 232, - "ne2d": 590, - "ne3d": 1593, - "quality_histogram": "[0, 0, 21, 30, 45, 47, 61, 92, 104, 145, 141, 138, 146, 148, 134, 114, 107, 63, 46, 11]", - "total_badness": 3241.6735555 + "ne2d": 598, + "ne3d": 1548, + "quality_histogram": "[0, 17, 27, 27, 36, 51, 53, 75, 99, 120, 139, 129, 156, 145, 138, 103, 115, 66, 46, 6]", + "total_badness": 3338.4078035 }, { "ne1d": 344, - "ne2d": 1130, - "ne3d": 3209, - "quality_histogram": "[0, 0, 0, 0, 0, 4, 19, 29, 56, 85, 162, 229, 352, 413, 479, 468, 390, 320, 156, 47]", - "total_badness": 4660.4012194 + "ne2d": 1128, + "ne3d": 3278, + "quality_histogram": "[0, 0, 0, 0, 0, 2, 19, 24, 49, 97, 171, 244, 348, 402, 467, 462, 419, 350, 182, 42]", + "total_badness": 4737.6478788 }, { "ne1d": 480, - "ne2d": 2260, - "ne3d": 11824, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 2, 15, 44, 152, 298, 546, 944, 1504, 2045, 2229, 2105, 1531, 408]", - "total_badness": 15109.078092 + "ne2d": 2252, + "ne3d": 11707, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 3, 19, 40, 147, 287, 574, 934, 1513, 1977, 2229, 2130, 1425, 428]", + "total_badness": 14969.835667 }, { "ne1d": 820, "ne2d": 6218, - "ne3d": 68383, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 12, 37, 108, 252, 694, 1708, 3917, 7031, 11058, 14173, 14782, 11158, 3451]", - "total_badness": 84181.20294 + "ne3d": 68314, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 7, 25, 88, 259, 691, 1670, 3656, 7155, 11221, 14072, 14790, 11219, 3459]", + "total_badness": 84011.916463 } ], "plane.stl": [ { "ne1d": 890, - "ne2d": 2646, - "ne3d": 8503, - "quality_histogram": "[4, 9, 28, 39, 37, 47, 43, 74, 102, 194, 278, 421, 644, 952, 1193, 1275, 1330, 1019, 645, 169]", - "total_badness": 12679.208033 + "ne2d": 2644, + "ne3d": 8437, + "quality_histogram": "[4, 11, 34, 34, 47, 50, 47, 73, 116, 174, 285, 458, 661, 938, 1281, 1251, 1245, 989, 581, 158]", + "total_badness": 12699.585283 }, { - "ne1d": 570, - "ne2d": 1220, - "ne3d": 1876, - "quality_histogram": "[4, 18, 43, 52, 44, 59, 75, 90, 120, 136, 177, 191, 179, 176, 167, 129, 108, 64, 28, 16]", - "total_badness": 4320.750155 + "ne1d": 572, + "ne2d": 1216, + "ne3d": 1895, + "quality_histogram": "[2, 19, 47, 57, 49, 63, 79, 93, 109, 155, 175, 199, 174, 176, 167, 136, 98, 57, 35, 5]", + "total_badness": 4388.7508089 }, { "ne1d": 724, - "ne2d": 1746, - "ne3d": 3289, - "quality_histogram": "[4, 21, 25, 37, 42, 45, 44, 74, 117, 151, 194, 292, 340, 395, 460, 353, 330, 228, 114, 23]", - "total_badness": 5983.1897176 + "ne2d": 1752, + "ne3d": 3251, + "quality_histogram": "[3, 18, 30, 51, 30, 49, 50, 70, 104, 143, 167, 291, 330, 404, 438, 402, 312, 195, 130, 34]", + "total_badness": 5918.1573233 }, { "ne1d": 956, - "ne2d": 2882, - "ne3d": 8726, - "quality_histogram": "[3, 11, 23, 49, 48, 47, 50, 58, 94, 137, 181, 359, 611, 946, 1233, 1398, 1436, 1193, 656, 193]", - "total_badness": 12772.914527 + "ne2d": 2886, + "ne3d": 8911, + "quality_histogram": "[3, 13, 24, 44, 52, 48, 50, 62, 86, 136, 201, 367, 548, 881, 1299, 1464, 1419, 1260, 761, 193]", + "total_badness": 12992.010429 }, { "ne1d": 1554, "ne2d": 6466, - "ne3d": 32040, - "quality_histogram": "[5, 6, 7, 7, 25, 52, 53, 68, 107, 199, 330, 692, 1305, 2499, 3880, 5430, 6303, 5976, 3971, 1125]", - "total_badness": 41506.110521 + "ne3d": 32098, + "quality_histogram": "[5, 6, 8, 6, 24, 52, 56, 72, 117, 168, 382, 731, 1379, 2486, 3961, 5463, 6259, 5888, 3926, 1109]", + "total_badness": 41680.677329 }, { "ne1d": 2992, - "ne2d": 23396, - "ne3d": 276589, - "quality_histogram": "[5, 7, 11, 7, 11, 22, 33, 88, 192, 471, 1192, 2796, 6844, 15362, 28665, 44479, 57706, 60282, 44709, 13707]", - "total_badness": 341214.55024 + "ne2d": 23400, + "ne3d": 315912, + "quality_histogram": "[9, 29, 30, 35, 91, 431, 1451, 3248, 5258, 8159, 12957, 19461, 28353, 38474, 46243, 48391, 44070, 33858, 19987, 5377]", + "total_badness": 451886.52052 } ], "revolution.geo": [ { "ne1d": 320, "ne2d": 3080, - "ne3d": 8493, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 14, 37, 141, 292, 516, 761, 908, 1113, 1149, 1153, 1021, 809, 454, 124]", - "total_badness": 12348.498749 + "ne3d": 8389, + "quality_histogram": "[0, 0, 0, 0, 0, 1, 12, 49, 144, 303, 528, 693, 889, 1085, 1176, 1168, 962, 783, 479, 117]", + "total_badness": 12207.237452 }, { "ne1d": 160, - "ne2d": 822, - "ne3d": 1275, - "quality_histogram": "[0, 0, 0, 0, 1, 13, 46, 79, 104, 128, 151, 162, 143, 122, 97, 67, 79, 44, 33, 6]", - "total_badness": 2301.511908 + "ne2d": 820, + "ne3d": 1259, + "quality_histogram": "[0, 0, 0, 0, 3, 18, 57, 79, 96, 139, 150, 150, 140, 112, 90, 67, 72, 52, 27, 7]", + "total_badness": 2309.7736571 }, { "ne1d": 240, - "ne2d": 1814, - "ne3d": 4263, - "quality_histogram": "[0, 0, 0, 1, 24, 48, 98, 178, 257, 329, 374, 485, 464, 451, 424, 377, 341, 236, 134, 42]", - "total_badness": 7266.9014253 + "ne2d": 1816, + "ne3d": 3912, + "quality_histogram": "[0, 0, 0, 1, 5, 8, 26, 38, 114, 181, 332, 423, 495, 494, 492, 433, 381, 261, 179, 49]", + "total_badness": 6017.6961316 }, { "ne1d": 320, "ne2d": 3080, - "ne3d": 8289, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 6, 11, 68, 186, 384, 601, 825, 1052, 1157, 1179, 1159, 966, 521, 172]", - "total_badness": 11619.248926 + "ne3d": 8206, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 13, 75, 206, 400, 590, 774, 1006, 1185, 1210, 1118, 927, 556, 142]", + "total_badness": 11528.119325 }, { "ne1d": 480, - "ne2d": 6802, - "ne3d": 32879, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 4, 12, 84, 271, 645, 1296, 2517, 4137, 5621, 6316, 6268, 4405, 1302]", - "total_badness": 41520.358013 + "ne2d": 6812, + "ne3d": 33032, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 15, 51, 244, 651, 1370, 2554, 4178, 5705, 6486, 6299, 4285, 1193]", + "total_badness": 41750.279607 }, { "ne1d": 800, - "ne2d": 17838, - "ne3d": 201709, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 11, 55, 165, 539, 1581, 4149, 10238, 19945, 31707, 42528, 45753, 34593, 10445]", - "total_badness": 246377.26479 + "ne2d": 17842, + "ne3d": 201922, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 13, 28, 162, 589, 1600, 4381, 10379, 20232, 32341, 42476, 45161, 34103, 10457]", + "total_badness": 246992.09017 } ], "screw.step": [ { "ne1d": 400, - "ne2d": 1426, - "ne3d": 2472, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 12, 81, 91, 181, 174, 234, 298, 277, 288, 283, 242, 190, 101, 19]", - "total_badness": 3876.6679484 + "ne2d": 1422, + "ne3d": 2422, + "quality_histogram": "[0, 0, 0, 0, 1, 0, 16, 95, 102, 173, 183, 248, 286, 295, 268, 252, 217, 167, 92, 27]", + "total_badness": 3858.3545304 }, { "ne1d": 530, - "ne2d": 2672, - "ne3d": 7959, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 6, 13, 27, 70, 146, 225, 454, 786, 1144, 1323, 1454, 1239, 822, 250]", - "total_badness": 10425.046404 + "ne2d": 2688, + "ne3d": 7916, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 6, 15, 31, 62, 150, 285, 487, 728, 1064, 1322, 1395, 1296, 847, 228]", + "total_badness": 10396.315052 }, { "ne1d": 668, - "ne2d": 4982, - "ne3d": 31524, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 2, 5, 18, 51, 119, 302, 759, 1716, 3303, 5151, 6604, 6989, 5042, 1462]", - "total_badness": 38816.567058 + "ne2d": 4986, + "ne3d": 31777, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 3, 4, 13, 47, 127, 321, 774, 1693, 3177, 5250, 6673, 7110, 5062, 1523]", + "total_badness": 39090.830215 } ], "sculpture.geo": [ @@ -1094,8 +1094,8 @@ "ne1d": 192, "ne2d": 412, "ne3d": 474, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 1, 1, 4, 16, 22, 41, 56, 66, 94, 93, 45, 22, 10, 2]", - "total_badness": 694.32501707 + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 4, 2, 18, 18, 35, 60, 68, 91, 99, 43, 23, 10, 2]", + "total_badness": 692.74185155 }, { "ne1d": 102, @@ -1114,67 +1114,67 @@ { "ne1d": 192, "ne2d": 412, - "ne3d": 473, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 1, 3, 16, 22, 41, 56, 67, 94, 93, 45, 22, 10, 2]", - "total_badness": 690.01007288 + "ne3d": 474, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 3, 2, 19, 19, 35, 61, 69, 89, 99, 43, 23, 10, 2]", + "total_badness": 691.25814875 }, { "ne1d": 288, "ne2d": 962, - "ne3d": 1342, - "quality_histogram": "[0, 0, 0, 0, 1, 0, 8, 25, 55, 76, 126, 141, 130, 145, 122, 136, 146, 128, 84, 19]", - "total_badness": 2068.4211724 + "ne3d": 1325, + "quality_histogram": "[0, 0, 0, 0, 0, 1, 6, 21, 58, 89, 111, 133, 132, 141, 122, 142, 143, 129, 78, 19]", + "total_badness": 2041.1919863 }, { "ne1d": 480, - "ne2d": 2396, - "ne3d": 6759, - "quality_histogram": "[0, 0, 0, 0, 3, 7, 8, 20, 26, 48, 63, 134, 286, 497, 697, 1121, 1313, 1288, 944, 304]", - "total_badness": 8628.8134106 + "ne2d": 2388, + "ne3d": 6681, + "quality_histogram": "[0, 0, 0, 0, 2, 4, 12, 6, 31, 34, 69, 140, 276, 472, 730, 1096, 1313, 1260, 928, 308]", + "total_badness": 8505.1301083 } ], "shaft.geo": [ { "ne1d": 708, - "ne2d": 1726, - "ne3d": 2758, - "quality_histogram": "[5, 19, 22, 27, 27, 37, 60, 74, 82, 160, 296, 372, 295, 251, 231, 278, 234, 181, 86, 21]", - "total_badness": 5318.0297732 + "ne2d": 1718, + "ne3d": 2723, + "quality_histogram": "[7, 17, 22, 29, 34, 36, 57, 78, 100, 148, 283, 376, 278, 247, 219, 285, 228, 172, 81, 26]", + "total_badness": 5343.3499358 }, { "ne1d": 410, "ne2d": 604, - "ne3d": 951, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 6, 17, 32, 42, 65, 90, 111, 140, 137, 132, 103, 58, 17]", - "total_badness": 1354.4698007 + "ne3d": 928, + "quality_histogram": "[0, 0, 0, 0, 0, 3, 3, 5, 14, 38, 49, 69, 88, 133, 134, 124, 128, 75, 49, 16]", + "total_badness": 1353.3692968 }, { "ne1d": 510, - "ne2d": 1012, - "ne3d": 2088, - "quality_histogram": "[20, 46, 76, 95, 111, 105, 97, 134, 91, 101, 96, 141, 150, 177, 193, 168, 177, 56, 41, 13]", - "total_badness": 6181.8600404 + "ne2d": 1008, + "ne3d": 2093, + "quality_histogram": "[16, 63, 82, 96, 76, 99, 82, 124, 108, 111, 111, 143, 147, 174, 187, 181, 176, 66, 42, 9]", + "total_badness": 6035.6762331 }, { "ne1d": 708, - "ne2d": 1726, - "ne3d": 2749, - "quality_histogram": "[0, 2, 15, 16, 32, 30, 44, 71, 72, 143, 302, 400, 289, 259, 236, 273, 259, 196, 88, 22]", - "total_badness": 4725.048506 + "ne2d": 1718, + "ne3d": 2703, + "quality_histogram": "[0, 4, 9, 8, 26, 26, 65, 65, 82, 150, 268, 404, 295, 251, 234, 289, 229, 185, 85, 28]", + "total_badness": 4626.0082323 }, { "ne1d": 1138, - "ne2d": 4220, - "ne3d": 11186, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 3, 30, 80, 154, 350, 602, 945, 1409, 1830, 2160, 1870, 1352, 400]", - "total_badness": 14442.588212 + "ne2d": 4218, + "ne3d": 11164, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 3, 3, 29, 92, 190, 361, 576, 929, 1450, 1802, 2078, 1943, 1307, 401]", + "total_badness": 14449.209478 }, { "ne1d": 1792, "ne2d": 10588, - "ne3d": 63583, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 16, 57, 199, 505, 1317, 3246, 6239, 10147, 13375, 14218, 10750, 3513]", - "total_badness": 77700.722539 + "ne3d": 63419, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 4, 10, 67, 184, 593, 1440, 3345, 6289, 10045, 13306, 14094, 10552, 3488]", + "total_badness": 77657.59067 } ], "sphere.geo": [ @@ -1194,10 +1194,10 @@ }, { "ne1d": 0, - "ne2d": 80, - "ne3d": 80, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 12, 28, 24, 10, 4, 0, 0, 0]", - "total_badness": 114.85441614 + "ne2d": 72, + "ne3d": 72, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 14, 26, 23, 8, 0, 0, 0]", + "total_badness": 97.58858068 }, { "ne1d": 0, @@ -1252,105 +1252,105 @@ }, { "ne1d": 74, - "ne2d": 416, - "ne3d": 1711, - "quality_histogram": "[0, 0, 0, 0, 2, 3, 7, 15, 23, 28, 56, 85, 135, 188, 256, 270, 252, 194, 131, 66]", - "total_badness": 2380.2313828 + "ne2d": 418, + "ne3d": 1749, + "quality_histogram": "[0, 0, 0, 0, 0, 5, 4, 12, 26, 34, 61, 126, 161, 221, 244, 240, 263, 186, 131, 35]", + "total_badness": 2468.6863723 }, { "ne1d": 122, - "ne2d": 1080, - "ne3d": 13950, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 2, 8, 27, 100, 220, 499, 870, 1449, 2270, 2791, 2947, 2086, 679]", - "total_badness": 17374.576935 + "ne2d": 1082, + "ne3d": 14003, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 3, 8, 29, 100, 200, 460, 911, 1478, 2207, 2867, 2900, 2169, 671]", + "total_badness": 17411.619104 } ], "torus.geo": [ { "ne1d": 0, "ne2d": 2534, - "ne3d": 5567, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 24, 44, 120, 251, 427, 577, 708, 736, 700, 671, 555, 393, 274, 86]", - "total_badness": 8384.3048813 + "ne3d": 5714, + "quality_histogram": "[0, 0, 0, 0, 0, 5, 20, 60, 155, 280, 408, 597, 707, 753, 762, 701, 541, 400, 246, 79]", + "total_badness": 8662.1200343 }, { "ne1d": 0, "ne2d": 692, - "ne3d": 3145, - "quality_histogram": "[195, 700, 454, 360, 340, 221, 170, 157, 140, 91, 96, 60, 44, 31, 33, 26, 12, 7, 6, 2]", - "total_badness": 25137.501541 + "ne3d": 3096, + "quality_histogram": "[174, 698, 478, 383, 321, 195, 183, 161, 107, 83, 75, 67, 49, 32, 28, 28, 18, 7, 7, 2]", + "total_badness": 24704.214641 }, { "ne1d": 0, "ne2d": 1446, - "ne3d": 2727, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 5, 12, 62, 161, 219, 352, 418, 401, 380, 266, 239, 155, 55]", - "total_badness": 3909.4618458 + "ne3d": 2722, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 4, 18, 49, 142, 269, 320, 396, 414, 370, 294, 222, 160, 64]", + "total_badness": 3891.2372171 }, { "ne1d": 0, "ne2d": 2534, - "ne3d": 5419, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 19, 42, 209, 332, 508, 665, 720, 748, 656, 613, 495, 305, 103]", - "total_badness": 7868.8410035 + "ne3d": 5565, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 18, 68, 187, 321, 551, 613, 741, 847, 714, 597, 516, 298, 90]", + "total_badness": 8072.4927096 }, { "ne1d": 0, "ne2d": 5892, - "ne3d": 25297, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 4, 6, 57, 140, 381, 917, 1672, 2967, 4341, 5051, 5114, 3588, 1059]", - "total_badness": 31635.159095 + "ne3d": 25273, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 8, 34, 127, 400, 875, 1667, 2853, 4059, 5213, 5256, 3667, 1113]", + "total_badness": 31491.532498 }, { "ne1d": 0, "ne2d": 16286, - "ne3d": 175540, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 2, 23, 105, 378, 1086, 3067, 7730, 16270, 26910, 37673, 40911, 31553, 9832]", - "total_badness": 212959.87194 + "ne3d": 174919, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 4, 30, 126, 410, 1095, 3093, 7938, 16499, 26903, 36715, 40658, 31546, 9902]", + "total_badness": 212371.24291 } ], "trafo.geo": [ { "ne1d": 690, - "ne2d": 1684, - "ne3d": 5207, - "quality_histogram": "[0, 1, 2, 0, 8, 23, 26, 43, 130, 209, 256, 376, 434, 574, 672, 714, 598, 554, 460, 127]", - "total_badness": 7609.297723 + "ne2d": 1682, + "ne3d": 5174, + "quality_histogram": "[3, 4, 2, 6, 7, 24, 43, 53, 118, 191, 297, 326, 455, 561, 646, 718, 596, 538, 447, 139]", + "total_badness": 7745.7698571 }, { "ne1d": 390, "ne2d": 522, "ne3d": 1348, - "quality_histogram": "[0, 2, 3, 17, 13, 39, 77, 130, 126, 139, 162, 128, 136, 115, 80, 88, 48, 32, 11, 2]", - "total_badness": 2770.7952646 + "quality_histogram": "[0, 0, 3, 17, 12, 37, 76, 125, 124, 143, 166, 124, 148, 108, 84, 89, 45, 35, 10, 2]", + "total_badness": 2736.3657445 }, { "ne1d": 512, - "ne2d": 876, - "ne3d": 2390, - "quality_histogram": "[0, 0, 2, 1, 11, 17, 45, 82, 116, 145, 178, 211, 303, 386, 349, 231, 147, 96, 45, 25]", - "total_badness": 3971.1275129 + "ne2d": 874, + "ne3d": 2401, + "quality_histogram": "[0, 0, 0, 1, 9, 23, 43, 69, 133, 144, 188, 205, 309, 385, 348, 236, 141, 92, 48, 27]", + "total_badness": 3976.5898975 }, { "ne1d": 690, - "ne2d": 1684, - "ne3d": 5136, - "quality_histogram": "[0, 0, 0, 0, 3, 14, 20, 37, 122, 193, 254, 362, 416, 558, 664, 720, 625, 547, 463, 138]", - "total_badness": 7387.3184406 + "ne2d": 1682, + "ne3d": 5101, + "quality_histogram": "[0, 0, 1, 0, 2, 13, 30, 36, 119, 183, 283, 338, 427, 561, 657, 697, 618, 543, 455, 138]", + "total_badness": 7362.8828691 }, { "ne1d": 1050, - "ne2d": 3816, - "ne3d": 17915, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 6, 26, 41, 68, 180, 504, 1428, 2170, 2266, 2730, 2780, 2666, 2365, 685]", - "total_badness": 23360.270089 + "ne2d": 3810, + "ne3d": 17924, + "quality_histogram": "[0, 0, 0, 0, 0, 1, 7, 24, 46, 81, 198, 556, 1378, 2215, 2473, 2727, 2672, 2656, 2255, 635]", + "total_badness": 23477.047631 }, { "ne1d": 1722, - "ne2d": 10044, - "ne3d": 84569, - "quality_histogram": "[0, 0, 0, 0, 3, 8, 60, 1414, 732, 421, 765, 1392, 2637, 5659, 9077, 13242, 16177, 16531, 12448, 4003]", - "total_badness": 108711.84635 + "ne2d": 10040, + "ne3d": 84573, + "quality_histogram": "[0, 0, 0, 0, 0, 5, 61, 1368, 731, 437, 763, 1424, 2694, 5632, 8974, 13002, 16406, 16573, 12468, 4035]", + "total_badness": 108616.3402 } ], "twobricks.geo": [ @@ -1384,17 +1384,17 @@ }, { "ne1d": 116, - "ne2d": 136, - "ne3d": 171, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 7, 10, 12, 40, 34, 23, 22, 13, 3]", - "total_badness": 228.1897295 + "ne2d": 134, + "ne3d": 177, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 12, 10, 18, 38, 22, 27, 22, 18, 7]", + "total_badness": 234.47334257 }, { "ne1d": 186, - "ne2d": 346, - "ne3d": 594, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 22, 29, 70, 88, 100, 109, 115, 43, 14]", - "total_badness": 771.14009171 + "ne2d": 342, + "ne3d": 608, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11, 23, 29, 65, 89, 111, 104, 105, 65, 5]", + "total_badness": 792.94333095 } ], "twocubes.geo": [ @@ -1428,17 +1428,17 @@ }, { "ne1d": 116, - "ne2d": 136, - "ne3d": 171, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 7, 10, 12, 40, 34, 23, 22, 13, 3]", - "total_badness": 228.1897295 + "ne2d": 134, + "ne3d": 177, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 12, 10, 18, 38, 22, 27, 22, 18, 7]", + "total_badness": 234.47334257 }, { "ne1d": 186, - "ne2d": 346, - "ne3d": 594, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 22, 29, 70, 88, 100, 109, 115, 43, 14]", - "total_badness": 771.14009171 + "ne2d": 342, + "ne3d": 608, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11, 23, 29, 65, 89, 111, 104, 105, 65, 5]", + "total_badness": 792.94333095 } ], "twocyl.geo": [ @@ -1458,10 +1458,10 @@ }, { "ne1d": 102, - "ne2d": 236, - "ne3d": 551, - "quality_histogram": "[0, 29, 41, 30, 31, 36, 49, 40, 55, 27, 38, 32, 26, 26, 20, 13, 37, 16, 4, 1]", - "total_badness": 1900.92706 + "ne2d": 238, + "ne3d": 558, + "quality_histogram": "[4, 34, 33, 32, 30, 37, 52, 45, 67, 43, 31, 27, 16, 19, 20, 17, 36, 12, 3, 0]", + "total_badness": 2092.5126876 }, { "ne1d": 144, @@ -1473,16 +1473,16 @@ { "ne1d": 214, "ne2d": 910, - "ne3d": 1894, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 20, 72, 118, 190, 292, 365, 352, 262, 179, 40]", - "total_badness": 2477.4306124 + "ne3d": 1914, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 28, 76, 128, 227, 305, 346, 351, 232, 167, 40]", + "total_badness": 2533.9115448 }, { "ne1d": 350, "ne2d": 2374, - "ne3d": 13452, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 25, 83, 244, 626, 1288, 2202, 2860, 3100, 2290, 728]", - "total_badness": 16367.358392 + "ne3d": 13491, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 2, 7, 24, 85, 255, 615, 1330, 2192, 2925, 3114, 2247, 695]", + "total_badness": 16437.08459 } ] } \ No newline at end of file From 288bd2c3d89fb6bc5669704bbbf1e4475f9c6f56 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 8 Oct 2019 18:12:10 +0200 Subject: [PATCH 03/10] EdgeSwapping() - all faces at once --- libsrc/meshing/improve2.cpp | 74 +++++++++++++++------------------- libsrc/meshing/improve2.hpp | 2 +- libsrc/meshing/improve2gen.cpp | 1 + 3 files changed, 35 insertions(+), 42 deletions(-) diff --git a/libsrc/meshing/improve2.cpp b/libsrc/meshing/improve2.cpp index e0efde2a..799c33c5 100644 --- a/libsrc/meshing/improve2.cpp +++ b/libsrc/meshing/improve2.cpp @@ -27,7 +27,6 @@ namespace netgen Array &neighbors, Array &swapped, const SurfaceElementIndex t1, const int o1, - const int surfnr, const int t, NgArray &pdef, const bool check_only) @@ -41,6 +40,8 @@ namespace netgen if (t2 == -1) return false; if (swapped[t1] || swapped[t2]) return false; + const int faceindex = mesh[t1].GetIndex(); + const int surfnr = mesh.GetFaceDescriptor (faceindex).SurfNr(); PointIndex pi1 = mesh[t1].PNumMod(o1+1+1); PointIndex pi2 = mesh[t1].PNumMod(o1+1+2); @@ -174,51 +175,41 @@ namespace netgen void MeshOptimize2d :: EdgeSwapping (Mesh & mesh, int usemetric) { static Timer timer("EdgeSwapping (2D)"); RegionTimer reg(timer); - if (!faceindex) - { - if (usemetric) - PrintMessage (3, "Edgeswapping, metric"); - else - PrintMessage (3, "Edgeswapping, topological"); - - for (faceindex = 1; faceindex <= mesh.GetNFD(); faceindex++) - { - EdgeSwapping (mesh, usemetric); - - if (multithread.terminate) - throw NgException ("Meshing stopped"); - } - - faceindex = 0; - mesh.CalcSurfacesOfNode(); - return; - } - + if (usemetric) + PrintMessage (3, "Edgeswapping, metric"); + else + PrintMessage (3, "Edgeswapping, topological"); static int timerstart = NgProfiler::CreateTimer ("EdgeSwapping 2D start"); NgProfiler::StartTimer (timerstart); - Array seia; - mesh.GetSurfaceElementsOfFace (faceindex, seia); + bool mixed = false; + if(faceindex==0) + { + seia.SetSize(mesh.GetNSE()); + ParallelForRange( Range(seia), [&] (auto myrange) + { + for (auto i : myrange) + { + SurfaceElementIndex sei(i); + seia[i] = sei; + if (mesh[sei].GetNP() != 3) + mixed = true; + } + }); + } + else + { + mesh.GetSurfaceElementsOfFace (faceindex, seia); + for (SurfaceElementIndex sei : seia) + if (mesh[sei].GetNP() != 3) + mixed = true; + } - /* - for (int i = 0; i < seia.Size(); i++) - if (mesh[seia[i]].GetNP() != 3) - { - GenericImprove (mesh); - return; - } - */ - for (SurfaceElementIndex sei : seia) - if (mesh[sei].GetNP() != 3) - { - GenericImprove (mesh); - return; - } + if(mixed) + return GenericImprove(mesh); - int surfnr = mesh.GetFaceDescriptor (faceindex).SurfNr(); - Array neighbors(mesh.GetNSE()); INDEX_2_HASHTABLE other(2*seia.Size() + 2); @@ -399,7 +390,7 @@ namespace netgen throw NgException ("Meshing stopped"); for (int o1 = 0; o1 < 3; o1++) - if(EdgeSwapping(mesh, usemetric, neighbors, swapped, t1, o1, surfnr, t, pdef, true)) + if(EdgeSwapping(mesh, usemetric, neighbors, swapped, t1, o1, t, pdef, true)) improvement_candidates[cnt++]= std::make_pair(t1,o1); } }); @@ -408,11 +399,12 @@ namespace netgen QuickSort(elements_with_improvement); for (auto [t1,o1] : elements_with_improvement) - done |= EdgeSwapping(mesh, usemetric, neighbors, swapped, t1, o1, surfnr, t, pdef, false); + done |= EdgeSwapping(mesh, usemetric, neighbors, swapped, t1, o1, t, pdef, false); t--; } mesh.SetNextTimeStamp(); + mesh.CalcSurfacesOfNode(); } diff --git a/libsrc/meshing/improve2.hpp b/libsrc/meshing/improve2.hpp index d84d2d01..3d62ee45 100644 --- a/libsrc/meshing/improve2.hpp +++ b/libsrc/meshing/improve2.hpp @@ -37,7 +37,7 @@ public: const NgArray* > & from, NgArray* > & dest); bool EdgeSwapping (Mesh & mesh, const int usemetric, Array &neighbors, Array &swapped, - const SurfaceElementIndex t1, const int edge, const int surfnr, const int t, NgArray &pdef, const bool check_only=false); + const SurfaceElementIndex t1, const int edge, const int t, NgArray &pdef, const bool check_only=false); void EdgeSwapping (Mesh & mesh, int usemetric); void CombineImprove (Mesh & mesh); void SplitImprove (Mesh & mesh); diff --git a/libsrc/meshing/improve2gen.cpp b/libsrc/meshing/improve2gen.cpp index 07587ed9..326afbf2 100644 --- a/libsrc/meshing/improve2gen.cpp +++ b/libsrc/meshing/improve2gen.cpp @@ -21,6 +21,7 @@ namespace netgen void MeshOptimize2d :: GenericImprove (Mesh & mesh) { + static Timer timer("MeshOptimize2d::GenericImprove"); RegionTimer reg(timer); if (!faceindex) { if (writestatus) From a651a2d97e0fe9d5212d39cc3b13fb6f2d109bfd Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 8 Oct 2019 18:35:20 +0200 Subject: [PATCH 04/10] EdgeSwapping() - some cleanup and parallelization of table building --- libsrc/meshing/improve2.cpp | 148 +++++++++++++++++------------------- libsrc/meshing/improve2.hpp | 2 +- 2 files changed, 72 insertions(+), 78 deletions(-) diff --git a/libsrc/meshing/improve2.cpp b/libsrc/meshing/improve2.cpp index 799c33c5..af0a6edf 100644 --- a/libsrc/meshing/improve2.cpp +++ b/libsrc/meshing/improve2.cpp @@ -8,6 +8,7 @@ namespace netgen { + using ngcore::ParallelForRange; @@ -28,7 +29,7 @@ namespace netgen Array &swapped, const SurfaceElementIndex t1, const int o1, const int t, - NgArray &pdef, + Array &pdef, const bool check_only) { bool should; @@ -175,6 +176,7 @@ namespace netgen void MeshOptimize2d :: EdgeSwapping (Mesh & mesh, int usemetric) { static Timer timer("EdgeSwapping (2D)"); RegionTimer reg(timer); + static Timer timer_nb("EdgeSwapping-Find neighbors"); if (usemetric) PrintMessage (3, "Edgeswapping, metric"); else @@ -215,59 +217,68 @@ namespace netgen Array swapped(mesh.GetNSE()); - NgArray pdef(mesh.GetNP()); - NgArray pangle(mesh.GetNP()); + Array pdef(mesh.GetNP()); + Array pangle(mesh.GetNP()); - - // int e; - // double d; - // Vec3d nv1, nv2; - - // double loch(-1); static const double minangle[] = { 0, 1.481, 2.565, 3.627, 4.683, 5.736, 7, 9 }; - for (int i = 0; i < seia.Size(); i++) + if(faceindex == 0) { - const Element2d & sel = mesh[seia[i]]; - for (int j = 0; j < 3; j++) - pangle[sel[j]] = 0.0; + ParallelForRange( Range(pangle), [&] (auto myrange) + { + for (auto i : myrange) + pangle[i] = 0.0; + }); } - // pangle = 0; - - for (int i = 0; i < seia.Size(); i++) + else { - const Element2d & sel = mesh[seia[i]]; - for (int j = 0; j < 3; j++) - { - POINTTYPE typ = mesh[sel[j]].Type(); - if (typ == FIXEDPOINT || typ == EDGEPOINT) - { - pangle[sel[j]] += - Angle (mesh[sel[(j+1)%3]] - mesh[sel[j]], - mesh[sel[(j+2)%3]] - mesh[sel[j]]); - } - } + ParallelForRange( Range(seia), [&] (auto myrange) + { + for (auto i : myrange) + { + const Element2d & sel = mesh[seia[i]]; + for (int j = 0; j < 3; j++) + pangle[sel[j]] = 0.0; + } + }); } - // for (PointIndex pi = PointIndex::BASE; - // pi < mesh.GetNP()+PointIndex::BASE; pi++) - - // pdef = 0; - for (int i = 0; i < seia.Size(); i++) - { - const Element2d & sel = mesh[seia[i]]; - for (int j = 0; j < 3; j++) - { - PointIndex pi = sel[j]; - if (mesh[pi].Type() == INNERPOINT || mesh[pi].Type() == SURFACEPOINT) - pdef[pi] = -6; - else - for (int j = 0; j < 8; j++) - if (pangle[pi] >= minangle[j]) - pdef[pi] = -1-j; + ParallelForRange( Range(seia), [&] (auto myrange) + { + for (auto i : myrange) + { + const Element2d & sel = mesh[seia[i]]; + for (int j = 0; j < 3; j++) + { + POINTTYPE typ = mesh[sel[j]].Type(); + if (typ == FIXEDPOINT || typ == EDGEPOINT) + { + pangle[sel[j]] += + Angle (mesh[sel[(j+1)%3]] - mesh[sel[j]], + mesh[sel[(j+2)%3]] - mesh[sel[j]]); + } + } } - } + }); + + ParallelForRange( Range(seia), [&] (auto myrange) + { + for (auto i : myrange) + { + const Element2d & sel = mesh[seia[i]]; + for (int j = 0; j < 3; j++) + { + PointIndex pi = sel[j]; + if (mesh[pi].Type() == INNERPOINT || mesh[pi].Type() == SURFACEPOINT) + pdef[pi] = -6; + else + for (int j = 0; j < 8; j++) + if (pangle[pi] >= minangle[j]) + pdef[pi] = -1-j; + } + } + }); /* for (int i = 0; i < seia.Size(); i++) @@ -277,41 +288,23 @@ namespace netgen pdef[sel[j]]++; } */ - for (SurfaceElementIndex sei : seia) - for (PointIndex pi : mesh[sei].PNums<3>()) - pdef[pi]++; - - // for (int i = 0; i < seia.Size(); i++) - for (SurfaceElementIndex sei : seia) - for (int j = 0; j < 3; j++) + ParallelForRange( Range(seia), [&] (auto myrange) { - neighbors[sei].SetNr (j, -1); - neighbors[sei].SetOrientation (j, 0); - } - - /* - NgArray normals(mesh.GetNP()); - for (i = 1; i <= mesh.GetNSE(); i++) - { - Element2d & hel = mesh.SurfaceElement(i); - if (hel.GetIndex() == faceindex) - for (k = 1; k <= 3; k++) - { - int pi = hel.PNum(k); - SelectSurfaceOfPoint (mesh.Point(pi), hel.GeomInfoPi(k)); - int surfi = mesh.GetFaceDescriptor(faceindex).SurfNr(); - GetNormalVector (surfi, mesh.Point(pi), normals.Elem(pi)); - normals.Elem(pi) /= normals.Elem(pi).Length(); - } - } - */ - - /* - for (int i = 0; i < seia.Size(); i++) - { - const Element2d & sel = mesh[seia[i]]; - */ + for (auto i : myrange) + { + auto sei = seia[i]; + for (PointIndex pi : mesh[sei].template PNums<3>()) + AsAtomic(pdef[pi])++; + for (int j = 0; j < 3; j++) + { + neighbors[sei].SetNr (j, -1); + neighbors[sei].SetOrientation (j, 0); + } + } + }); + + timer_nb.Start(); for (SurfaceElementIndex sei : seia) { const Element2d & sel = mesh[sei]; @@ -358,6 +351,7 @@ namespace netgen } } } + timer_nb.Stop(); for (SurfaceElementIndex sei : seia) swapped[sei] = false; diff --git a/libsrc/meshing/improve2.hpp b/libsrc/meshing/improve2.hpp index 3d62ee45..03ff5559 100644 --- a/libsrc/meshing/improve2.hpp +++ b/libsrc/meshing/improve2.hpp @@ -37,7 +37,7 @@ public: const NgArray* > & from, NgArray* > & dest); bool EdgeSwapping (Mesh & mesh, const int usemetric, Array &neighbors, Array &swapped, - const SurfaceElementIndex t1, const int edge, const int t, NgArray &pdef, const bool check_only=false); + const SurfaceElementIndex t1, const int edge, const int t, Array &pdef, const bool check_only=false); void EdgeSwapping (Mesh & mesh, int usemetric); void CombineImprove (Mesh & mesh); void SplitImprove (Mesh & mesh); From 64a685c2eae47ffdd5eae56d7ac62fb5e59d1ee5 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Fri, 4 Oct 2019 17:07:10 +0200 Subject: [PATCH 05/10] CreateSurface2ElementTable for individual faces --- libsrc/meshing/meshclass.cpp | 39 +++++++++++++++++++++++++++--------- libsrc/meshing/meshclass.hpp | 2 +- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 25b60e88..e6067a5f 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -6205,22 +6205,41 @@ namespace netgen { for (PointIndex pi : myrange) QuickSort(elementsonnode[pi]); - }); + }, ngcore::TasksPerThread(4)); return move(elementsonnode); } - Table Mesh :: CreatePoint2SurfaceElementTable() const + Table Mesh :: CreatePoint2SurfaceElementTable( int faceindex ) const { + static Timer timer("Mesh::CreatePoint2SurfaceElementTable"); RegionTimer rt(timer); + TableCreator creator(GetNP()); - for ( ; !creator.Done(); creator++) - ngcore::ParallelForRange - (Range(surfelements), [&] (auto myrange) - { - for (SurfaceElementIndex ei : myrange) - for (PointIndex pi : (*this)[ei].PNums()) - creator.Add (pi, ei); - }); + + if(faceindex==0) + { + for ( ; !creator.Done(); creator++) + ngcore::ParallelForRange + (Range(surfelements), [&] (auto myrange) + { + for (SurfaceElementIndex ei : myrange) + for (PointIndex pi : (*this)[ei].PNums()) + creator.Add (pi, ei); + }, ngcore::TasksPerThread(4)); + } + else + { + Array face_els; + GetSurfaceElementsOfFace(faceindex, face_els); + for ( ; !creator.Done(); creator++) + ngcore::ParallelForRange + (Range(face_els), [&] (auto myrange) + { + for (auto i : myrange) + for (PointIndex pi : (*this)[face_els[i]].PNums()) + creator.Add (pi, face_els[i]); + }, ngcore::TasksPerThread(4)); + } auto elementsonnode = creator.MoveTable(); ngcore::ParallelForRange diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp index 372430ee..6431afad 100644 --- a/libsrc/meshing/meshclass.hpp +++ b/libsrc/meshing/meshclass.hpp @@ -762,7 +762,7 @@ namespace netgen Table CreatePoint2ElementTable() const; - Table CreatePoint2SurfaceElementTable() const; + Table CreatePoint2SurfaceElementTable( int faceindex=0 ) const; DLL_HEADER bool PureTrigMesh (int faceindex = 0) const; DLL_HEADER bool PureTetMesh () const; From 18bdd9df93cc557f613ed4c2e2ca4a48dea0b263 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 8 Oct 2019 19:26:43 +0200 Subject: [PATCH 06/10] Build neighbors list in parallel Check in new results (part1.stl does not mesh with very_coarse anymore) --- libsrc/meshing/improve2.cpp | 97 +++++++------------ libsrc/stlgeom/meshstlsurface.cpp | 1 - tests/pytest/results.json | 153 ++++++++++++++---------------- tests/pytest/test_tutorials.py | 2 + 4 files changed, 111 insertions(+), 142 deletions(-) diff --git a/libsrc/meshing/improve2.cpp b/libsrc/meshing/improve2.cpp index af0a6edf..462fee8c 100644 --- a/libsrc/meshing/improve2.cpp +++ b/libsrc/meshing/improve2.cpp @@ -187,6 +187,7 @@ namespace netgen Array seia; bool mixed = false; + if(faceindex==0) { seia.SetSize(mesh.GetNSE()); @@ -213,8 +214,7 @@ namespace netgen return GenericImprove(mesh); Array neighbors(mesh.GetNSE()); - INDEX_2_HASHTABLE other(2*seia.Size() + 2); - + auto elements_on_node = mesh.CreatePoint2SurfaceElementTable(faceindex); Array swapped(mesh.GetNSE()); Array pdef(mesh.GetNP()); @@ -254,9 +254,9 @@ namespace netgen POINTTYPE typ = mesh[sel[j]].Type(); if (typ == FIXEDPOINT || typ == EDGEPOINT) { - pangle[sel[j]] += + AtomicAdd(pangle[sel[j]], Angle (mesh[sel[(j+1)%3]] - mesh[sel[j]], - mesh[sel[(j+2)%3]] - mesh[sel[j]]); + mesh[sel[(j+2)%3]] - mesh[sel[j]])); } } } @@ -280,14 +280,6 @@ namespace netgen } }); - /* - for (int i = 0; i < seia.Size(); i++) - { - const Element2d & sel = mesh[seia[i]]; - for (int j = 0; j < 3; j++) - pdef[sel[j]]++; - } - */ ParallelForRange( Range(seia), [&] (auto myrange) { for (auto i : myrange) @@ -300,58 +292,41 @@ namespace netgen neighbors[sei].SetNr (j, -1); neighbors[sei].SetOrientation (j, 0); } + + const auto sel = mesh[sei]; + for (int j = 0; j < 3; j++) + { + PointIndex pi1 = sel.PNumMod(j+2); + PointIndex pi2 = sel.PNumMod(j+3); + + for (auto sei_other : elements_on_node[pi1]) + { + if(sei_other==sei) continue; + const auto & other = mesh[sei_other]; + int pi1_other = -1; + int pi2_other = -1; + bool common_edge = false; + for (int k = 0; k < 3; k++) + { + if(other[k] == pi1) + pi1_other = k; + if(other[k] == pi2) + { + pi2_other = k; + common_edge = true; + } + } + + if(common_edge) + { + neighbors[sei].SetNr (j, sei_other); + neighbors[sei].SetOrientation (j, 3-pi1_other-pi2_other); + } + } + } } }); - - timer_nb.Start(); - for (SurfaceElementIndex sei : seia) - { - const Element2d & sel = mesh[sei]; - - for (int j = 0; j < 3; j++) - { - PointIndex pi1 = sel.PNumMod(j+2); - PointIndex pi2 = sel.PNumMod(j+3); - - // double loch = mesh.GetH(mesh[pi1]); - - // INDEX_2 edge(pi1, pi2); - // edge.Sort(); - - if (mesh.IsSegment (pi1, pi2)) - continue; - - /* - if (segments.Used (edge)) - continue; - */ - INDEX_2 ii2 (pi1, pi2); - if (other.Used (ii2)) - { - // INDEX_2 i2s(ii2); - // i2s.Sort(); - - /* - int i2 = other.Get(ii2).tnr; - int j2 = other.Get(ii2).sidenr; - */ - auto othertrig = other.Get(ii2); - SurfaceElementIndex i2 = othertrig.tnr; - int j2 = othertrig.sidenr; - - neighbors[sei].SetNr (j, i2); - neighbors[sei].SetOrientation (j, j2); - neighbors[i2].SetNr (j2, sei); - neighbors[i2].SetOrientation (j2, j); - } - else - { - other.Set (INDEX_2 (pi2, pi1), trionedge (sei, j)); - } - } - } - timer_nb.Stop(); for (SurfaceElementIndex sei : seia) swapped[sei] = false; diff --git a/libsrc/stlgeom/meshstlsurface.cpp b/libsrc/stlgeom/meshstlsurface.cpp index 4c50180b..6333ea26 100644 --- a/libsrc/stlgeom/meshstlsurface.cpp +++ b/libsrc/stlgeom/meshstlsurface.cpp @@ -306,7 +306,6 @@ int STLSurfaceMeshing (STLGeometry & geom, class Mesh & mesh, const MeshingParam mesh.CalcSurfacesOfNode(); optmesh.EdgeSwapping (mesh, 0); - mesh.CalcSurfacesOfNode(); optmesh.ImproveMesh (mesh, mparam); } diff --git a/tests/pytest/results.json b/tests/pytest/results.json index 79f56322..3ff60ef1 100644 --- a/tests/pytest/results.json +++ b/tests/pytest/results.json @@ -685,45 +685,45 @@ "hinge.stl": [ { "ne1d": 456, - "ne2d": 1230, - "ne3d": 2006, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 5, 9, 24, 42, 72, 137, 165, 225, 325, 287, 304, 216, 146, 47]", - "total_badness": 2804.4326922 + "ne2d": 1214, + "ne3d": 2019, + "quality_histogram": "[0, 0, 0, 0, 1, 1, 7, 10, 25, 53, 64, 135, 179, 260, 313, 277, 264, 228, 159, 43]", + "total_badness": 2840.0751587 }, { "ne1d": 298, - "ne2d": 612, - "ne3d": 800, - "quality_histogram": "[0, 0, 1, 5, 8, 14, 26, 21, 33, 47, 74, 78, 98, 89, 89, 80, 63, 44, 24, 6]", - "total_badness": 1384.3451953 + "ne2d": 594, + "ne3d": 803, + "quality_histogram": "[0, 0, 3, 10, 11, 10, 24, 29, 44, 52, 53, 101, 86, 104, 78, 76, 66, 29, 22, 5]", + "total_badness": 1443.356934 }, { "ne1d": 370, - "ne2d": 860, - "ne3d": 1148, - "quality_histogram": "[0, 0, 0, 0, 2, 4, 16, 24, 25, 32, 78, 104, 135, 154, 165, 176, 112, 66, 43, 12]", - "total_badness": 1761.6622395 + "ne2d": 842, + "ne3d": 1114, + "quality_histogram": "[0, 0, 0, 0, 0, 9, 18, 23, 29, 45, 67, 110, 146, 130, 166, 151, 102, 53, 52, 13]", + "total_badness": 1737.5505204 }, { "ne1d": 516, - "ne2d": 1584, - "ne3d": 2528, - "quality_histogram": "[0, 0, 0, 0, 2, 1, 9, 16, 23, 49, 125, 185, 212, 311, 338, 362, 347, 313, 191, 44]", - "total_badness": 3559.0498754 + "ne2d": 1566, + "ne3d": 2515, + "quality_histogram": "[0, 0, 0, 0, 1, 1, 2, 16, 33, 61, 109, 161, 234, 325, 376, 358, 314, 287, 192, 45]", + "total_badness": 3545.6814623 }, { "ne1d": 722, - "ne2d": 2888, - "ne3d": 6747, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 2, 3, 15, 27, 51, 174, 373, 644, 867, 1088, 1146, 1180, 929, 247]", - "total_badness": 8655.9198144 + "ne2d": 2870, + "ne3d": 6691, + "quality_histogram": "[0, 0, 0, 0, 0, 1, 2, 4, 17, 35, 66, 156, 354, 634, 871, 1042, 1219, 1171, 879, 240]", + "total_badness": 8595.0420119 }, { "ne1d": 1862, - "ne2d": 19516, - "ne3d": 137265, - "quality_histogram": "[0, 0, 0, 0, 0, 1, 3, 5, 47, 136, 444, 1131, 2812, 6902, 13203, 22054, 29007, 30796, 23323, 7401]", - "total_badness": 167751.20764 + "ne2d": 19490, + "ne3d": 137799, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 1, 4, 44, 149, 433, 1143, 3044, 7194, 13730, 22017, 28888, 30587, 23088, 7477]", + "total_badness": 168663.12974 } ], "lshape3d.geo": [ @@ -893,45 +893,38 @@ "part1.stl": [ { "ne1d": 170, - "ne2d": 454, - "ne3d": 1231, - "quality_histogram": "[0, 0, 0, 0, 0, 2, 4, 16, 11, 28, 52, 63, 111, 142, 191, 162, 178, 143, 94, 34]", - "total_badness": 1732.0556803 - }, - { - "ne1d": 112, - "ne2d": 212, - "ne3d": 329, - "quality_histogram": "[0, 0, 1, 2, 6, 8, 7, 12, 15, 28, 32, 46, 35, 35, 33, 26, 24, 8, 8, 3]", - "total_badness": 600.29793129 + "ne2d": 436, + "ne3d": 1229, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 3, 19, 29, 55, 87, 110, 138, 175, 205, 157, 142, 78, 29]", + "total_badness": 1729.0401722 }, { "ne1d": 134, - "ne2d": 288, - "ne3d": 502, - "quality_histogram": "[0, 0, 0, 3, 0, 8, 3, 6, 12, 12, 31, 38, 65, 61, 63, 78, 51, 46, 18, 7]", - "total_badness": 773.39426016 + "ne2d": 278, + "ne3d": 495, + "quality_histogram": "[0, 0, 0, 1, 2, 1, 3, 5, 14, 29, 31, 32, 59, 65, 55, 70, 58, 44, 23, 3]", + "total_badness": 754.26258256 }, { "ne1d": 194, - "ne2d": 596, - "ne3d": 1754, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 0, 3, 13, 28, 71, 147, 204, 282, 267, 286, 247, 166, 40]", - "total_badness": 2331.111722 + "ne2d": 588, + "ne3d": 1673, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 4, 9, 19, 53, 115, 189, 242, 295, 314, 237, 151, 44]", + "total_badness": 2197.2722054 }, { "ne1d": 266, - "ne2d": 990, - "ne3d": 4027, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 0, 1, 3, 6, 26, 75, 146, 296, 557, 678, 795, 780, 509, 155]", - "total_badness": 5077.23567 + "ne2d": 986, + "ne3d": 4070, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 0, 1, 11, 26, 61, 171, 329, 503, 679, 791, 819, 526, 151]", + "total_badness": 5135.4720603 }, { "ne1d": 674, - "ne2d": 6870, - "ne3d": 81452, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 3, 4, 25, 77, 250, 594, 1752, 4117, 8196, 12789, 16981, 18438, 13807, 4419]", - "total_badness": 99550.92563 + "ne2d": 6854, + "ne3d": 83365, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 2, 7, 13, 62, 230, 706, 1754, 4117, 8217, 13027, 17521, 18882, 14312, 4515]", + "total_badness": 101790.83606 } ], "period.geo": [ @@ -981,45 +974,45 @@ "plane.stl": [ { "ne1d": 890, - "ne2d": 2644, - "ne3d": 8437, - "quality_histogram": "[4, 11, 34, 34, 47, 50, 47, 73, 116, 174, 285, 458, 661, 938, 1281, 1251, 1245, 989, 581, 158]", - "total_badness": 12699.585283 + "ne2d": 2594, + "ne3d": 8251, + "quality_histogram": "[4, 12, 36, 32, 44, 50, 57, 71, 152, 239, 330, 506, 691, 890, 1189, 1240, 1122, 915, 537, 134]", + "total_badness": 12713.488612 }, { - "ne1d": 572, - "ne2d": 1216, - "ne3d": 1895, - "quality_histogram": "[2, 19, 47, 57, 49, 63, 79, 93, 109, 155, 175, 199, 174, 176, 167, 136, 98, 57, 35, 5]", - "total_badness": 4388.7508089 + "ne1d": 570, + "ne2d": 1162, + "ne3d": 1656, + "quality_histogram": "[6, 27, 35, 54, 64, 75, 98, 116, 138, 141, 155, 129, 151, 124, 127, 78, 75, 33, 26, 4]", + "total_badness": 4280.7158528 }, { "ne1d": 724, - "ne2d": 1752, - "ne3d": 3251, - "quality_histogram": "[3, 18, 30, 51, 30, 49, 50, 70, 104, 143, 167, 291, 330, 404, 438, 402, 312, 195, 130, 34]", - "total_badness": 5918.1573233 + "ne2d": 1706, + "ne3d": 3203, + "quality_histogram": "[6, 13, 36, 37, 49, 52, 75, 69, 129, 151, 215, 276, 365, 365, 390, 373, 301, 185, 94, 22]", + "total_badness": 6020.5769171 }, { "ne1d": 956, - "ne2d": 2886, - "ne3d": 8911, - "quality_histogram": "[3, 13, 24, 44, 52, 48, 50, 62, 86, 136, 201, 367, 548, 881, 1299, 1464, 1419, 1260, 761, 193]", - "total_badness": 12992.010429 + "ne2d": 2816, + "ne3d": 8620, + "quality_histogram": "[3, 12, 31, 46, 42, 59, 51, 64, 79, 151, 222, 364, 608, 987, 1214, 1341, 1385, 1113, 673, 175]", + "total_badness": 12750.84491 }, { "ne1d": 1554, - "ne2d": 6466, - "ne3d": 32098, - "quality_histogram": "[5, 6, 8, 6, 24, 52, 56, 72, 117, 168, 382, 731, 1379, 2486, 3961, 5463, 6259, 5888, 3926, 1109]", - "total_badness": 41680.677329 + "ne2d": 6388, + "ne3d": 31408, + "quality_histogram": "[4, 7, 11, 6, 23, 53, 61, 72, 104, 183, 368, 718, 1410, 2572, 3955, 5242, 6125, 5690, 3772, 1032]", + "total_badness": 40921.343431 }, { "ne1d": 2992, - "ne2d": 23400, - "ne3d": 315912, - "quality_histogram": "[9, 29, 30, 35, 91, 431, 1451, 3248, 5258, 8159, 12957, 19461, 28353, 38474, 46243, 48391, 44070, 33858, 19987, 5377]", - "total_badness": 451886.52052 + "ne2d": 23312, + "ne3d": 279657, + "quality_histogram": "[4, 11, 13, 15, 12, 35, 54, 98, 217, 519, 1182, 2752, 6855, 15439, 29353, 45547, 58301, 60932, 44659, 13659]", + "total_badness": 345287.15441 } ], "revolution.geo": [ @@ -1076,10 +1069,10 @@ }, { "ne1d": 530, - "ne2d": 2688, - "ne3d": 7916, - "quality_histogram": "[0, 0, 0, 0, 0, 0, 6, 15, 31, 62, 150, 285, 487, 728, 1064, 1322, 1395, 1296, 847, 228]", - "total_badness": 10396.315052 + "ne2d": 2690, + "ne3d": 7903, + "quality_histogram": "[0, 0, 0, 0, 0, 0, 4, 12, 30, 98, 166, 287, 493, 782, 1078, 1284, 1426, 1211, 797, 235]", + "total_badness": 10438.866877 }, { "ne1d": 668, diff --git a/tests/pytest/test_tutorials.py b/tests/pytest/test_tutorials.py index bb3be546..a0ba44a5 100644 --- a/tests/pytest/test_tutorials.py +++ b/tests/pytest/test_tutorials.py @@ -58,6 +58,8 @@ def getMeshingparameters(filename): return standard[:3] # this gets too big for finer meshsizes if filename == "screw.step": return standard[3:] # coarser meshes don't work here + if filename == "part1.stl": + return standard[0:1] + standard[2:] # very coarse does not work return standard _geofiles = [f for f in getFiles(".geo")] + [f for f in getFiles(".stl")] From fe78d9d7b48b4eee4c725716930fbec04a391b65 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 8 Oct 2019 20:39:29 +0200 Subject: [PATCH 07/10] Use AsAtomic from ngcore --- libsrc/general/parthreads.hpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libsrc/general/parthreads.hpp b/libsrc/general/parthreads.hpp index 05521df1..2e242484 100644 --- a/libsrc/general/parthreads.hpp +++ b/libsrc/general/parthreads.hpp @@ -96,12 +96,6 @@ void ParallelFor( int first, int next, const TFunc & f ) - template - inline atomic & AsAtomic (T & d) - { - return reinterpret_cast&> (d); - } - typedef void (*TaskManager)(std::function); typedef void (*Tracer)(string, bool); // false .. start, true .. stop From 95df0ea73e083857d6bbec4df043e03d7034a05e Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Wed, 9 Oct 2019 09:29:53 +0200 Subject: [PATCH 08/10] Explicit capture in lambda (due to MSVC compile problems) --- libsrc/meshing/improve2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/meshing/improve2.cpp b/libsrc/meshing/improve2.cpp index 462fee8c..82215d2d 100644 --- a/libsrc/meshing/improve2.cpp +++ b/libsrc/meshing/improve2.cpp @@ -280,7 +280,7 @@ namespace netgen } }); - ParallelForRange( Range(seia), [&] (auto myrange) + ParallelForRange( Range(seia), [&pdef, &neighbors, &mesh, &seia, &elements_on_node] (auto myrange) { for (auto i : myrange) { From 6e5d806d921449bf94c92e0d9bf9e8eb05fc9fb0 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Wed, 9 Oct 2019 09:57:37 +0200 Subject: [PATCH 09/10] Use ParallelFor instead of ParallelForRange better readability and no performance difference (if using NETGEN_LAMBDA_INLINE) --- libsrc/meshing/improve2.cpp | 176 ++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 100 deletions(-) diff --git a/libsrc/meshing/improve2.cpp b/libsrc/meshing/improve2.cpp index 82215d2d..7146476b 100644 --- a/libsrc/meshing/improve2.cpp +++ b/libsrc/meshing/improve2.cpp @@ -7,11 +7,6 @@ namespace netgen { - - using ngcore::ParallelForRange; - - - class trionedge { public: @@ -191,15 +186,12 @@ namespace netgen if(faceindex==0) { seia.SetSize(mesh.GetNSE()); - ParallelForRange( Range(seia), [&] (auto myrange) + ParallelFor( Range(seia), [&] (auto i) NETGEN_LAMBDA_INLINE { - for (auto i : myrange) - { - SurfaceElementIndex sei(i); - seia[i] = sei; - if (mesh[sei].GetNP() != 3) - mixed = true; - } + SurfaceElementIndex sei(i); + seia[i] = sei; + if (mesh[sei].GetNP() != 3) + mixed = true; }); } else @@ -225,103 +217,90 @@ namespace netgen if(faceindex == 0) { - ParallelForRange( Range(pangle), [&] (auto myrange) + ParallelFor( Range(pangle), [&] (auto i) NETGEN_LAMBDA_INLINE { - for (auto i : myrange) - pangle[i] = 0.0; + pangle[i] = 0.0; }); } else { - ParallelForRange( Range(seia), [&] (auto myrange) + ParallelFor( Range(seia), [&] (auto i) NETGEN_LAMBDA_INLINE { - for (auto i : myrange) - { - const Element2d & sel = mesh[seia[i]]; - for (int j = 0; j < 3; j++) - pangle[sel[j]] = 0.0; - } + const Element2d & sel = mesh[seia[i]]; + for (int j = 0; j < 3; j++) + pangle[sel[j]] = 0.0; }); } - ParallelForRange( Range(seia), [&] (auto myrange) + ParallelFor( Range(seia), [&] (auto i) NETGEN_LAMBDA_INLINE { - for (auto i : myrange) + const Element2d & sel = mesh[seia[i]]; + for (int j = 0; j < 3; j++) { - const Element2d & sel = mesh[seia[i]]; - for (int j = 0; j < 3; j++) + POINTTYPE typ = mesh[sel[j]].Type(); + if (typ == FIXEDPOINT || typ == EDGEPOINT) { - POINTTYPE typ = mesh[sel[j]].Type(); - if (typ == FIXEDPOINT || typ == EDGEPOINT) - { - AtomicAdd(pangle[sel[j]], - Angle (mesh[sel[(j+1)%3]] - mesh[sel[j]], - mesh[sel[(j+2)%3]] - mesh[sel[j]])); - } - } - } - }); - - ParallelForRange( Range(seia), [&] (auto myrange) - { - for (auto i : myrange) - { - const Element2d & sel = mesh[seia[i]]; - for (int j = 0; j < 3; j++) - { - PointIndex pi = sel[j]; - if (mesh[pi].Type() == INNERPOINT || mesh[pi].Type() == SURFACEPOINT) - pdef[pi] = -6; - else - for (int j = 0; j < 8; j++) - if (pangle[pi] >= minangle[j]) - pdef[pi] = -1-j; + AtomicAdd(pangle[sel[j]], + Angle (mesh[sel[(j+1)%3]] - mesh[sel[j]], + mesh[sel[(j+2)%3]] - mesh[sel[j]])); } } }); - ParallelForRange( Range(seia), [&pdef, &neighbors, &mesh, &seia, &elements_on_node] (auto myrange) + ParallelFor( Range(seia), [&] (auto i) NETGEN_LAMBDA_INLINE { - for (auto i : myrange) + const Element2d & sel = mesh[seia[i]]; + for (int j = 0; j < 3; j++) { - auto sei = seia[i]; - for (PointIndex pi : mesh[sei].template PNums<3>()) - AsAtomic(pdef[pi])++; - for (int j = 0; j < 3; j++) - { - neighbors[sei].SetNr (j, -1); - neighbors[sei].SetOrientation (j, 0); - } + PointIndex pi = sel[j]; + if (mesh[pi].Type() == INNERPOINT || mesh[pi].Type() == SURFACEPOINT) + pdef[pi] = -6; + else + for (int j = 0; j < 8; j++) + if (pangle[pi] >= minangle[j]) + pdef[pi] = -1-j; + } + }); - const auto sel = mesh[sei]; - for (int j = 0; j < 3; j++) - { - PointIndex pi1 = sel.PNumMod(j+2); - PointIndex pi2 = sel.PNumMod(j+3); + ParallelFor( Range(seia), [&pdef, &neighbors, &mesh, &seia, &elements_on_node] (auto i) NETGEN_LAMBDA_INLINE + { + auto sei = seia[i]; + for (PointIndex pi : mesh[sei].template PNums<3>()) + AsAtomic(pdef[pi])++; + for (int j = 0; j < 3; j++) + { + neighbors[sei].SetNr (j, -1); + neighbors[sei].SetOrientation (j, 0); + } - for (auto sei_other : elements_on_node[pi1]) + const auto sel = mesh[sei]; + for (int j = 0; j < 3; j++) + { + PointIndex pi1 = sel.PNumMod(j+2); + PointIndex pi2 = sel.PNumMod(j+3); + + for (auto sei_other : elements_on_node[pi1]) + { + if(sei_other==sei) continue; + const auto & other = mesh[sei_other]; + int pi1_other = -1; + int pi2_other = -1; + bool common_edge = false; + for (int k = 0; k < 3; k++) { - if(sei_other==sei) continue; - const auto & other = mesh[sei_other]; - int pi1_other = -1; - int pi2_other = -1; - bool common_edge = false; - for (int k = 0; k < 3; k++) + if(other[k] == pi1) + pi1_other = k; + if(other[k] == pi2) { - if(other[k] == pi1) - pi1_other = k; - if(other[k] == pi2) - { - pi2_other = k; - common_edge = true; - } + pi2_other = k; + common_edge = true; } + } - if(common_edge) - { - neighbors[sei].SetNr (j, sei_other); - neighbors[sei].SetOrientation (j, 3-pi1_other-pi2_other); - } + if(common_edge) + { + neighbors[sei].SetNr (j, sei_other); + neighbors[sei].SetOrientation (j, 3-pi1_other-pi2_other); } } } @@ -343,25 +322,22 @@ namespace netgen while (!done && t >= 2) { cnt = 0; - ParallelForRange( Range(seia), [&] (auto myrange) + ParallelFor( Range(seia), [&] (auto i) NETGEN_LAMBDA_INLINE { - for (auto i : myrange) - { - SurfaceElementIndex t1 = seia[i]; + SurfaceElementIndex t1 = seia[i]; - if (mesh[t1].IsDeleted()) - continue; + if (mesh[t1].IsDeleted()) + return; - if (mesh[t1].GetIndex() != faceindex) - continue; + if (mesh[t1].GetIndex() != faceindex) + return; - if (multithread.terminate) - throw NgException ("Meshing stopped"); + if (multithread.terminate) + throw NgException ("Meshing stopped"); - for (int o1 = 0; o1 < 3; o1++) - if(EdgeSwapping(mesh, usemetric, neighbors, swapped, t1, o1, t, pdef, true)) - improvement_candidates[cnt++]= std::make_pair(t1,o1); - } + for (int o1 = 0; o1 < 3; o1++) + if(EdgeSwapping(mesh, usemetric, neighbors, swapped, t1, o1, t, pdef, true)) + improvement_candidates[cnt++]= std::make_pair(t1,o1); }); auto elements_with_improvement = improvement_candidates.Range(cnt.load()); From e6953dc4cba447bdee7bdc6decefd987f604578c Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Wed, 9 Oct 2019 10:32:41 +0200 Subject: [PATCH 10/10] Remove unnecessary call to mesh.CalcSurfacesOfNode() --- libsrc/meshing/improve2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libsrc/meshing/improve2.cpp b/libsrc/meshing/improve2.cpp index 7146476b..71f652a9 100644 --- a/libsrc/meshing/improve2.cpp +++ b/libsrc/meshing/improve2.cpp @@ -349,7 +349,6 @@ namespace netgen } mesh.SetNextTimeStamp(); - mesh.CalcSurfacesOfNode(); }