From ae2dddcff7953172b48f40a21ecfc5830c177a4a Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 6 Sep 2022 15:14:50 +0200 Subject: [PATCH 1/4] fix delaunay2d --- libsrc/meshing/delaunay2d.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libsrc/meshing/delaunay2d.cpp b/libsrc/meshing/delaunay2d.cpp index e88434bf..db6bcc71 100644 --- a/libsrc/meshing/delaunay2d.cpp +++ b/libsrc/meshing/delaunay2d.cpp @@ -668,6 +668,11 @@ namespace netgen for (auto pi : points_range) dmesh.AddPoint(pi); + auto first_new_point = points_range.Next(); + tempmesh.AddPoint(P3(temp_points[first_new_point])); + tempmesh.AddPoint(P3(temp_points[first_new_point+1])); + tempmesh.AddPoint(P3(temp_points[first_new_point+2])); + timer_addpoints.Stop(); static Timer taddseg("addseg"); From 61ea805bba7f2fa78fe4b89a09e3e1c7167de297 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Wed, 7 Sep 2022 13:44:35 +0200 Subject: [PATCH 2/4] DLL_HEADER for MinDistLP2 --- libsrc/gprim/geomtest3d.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/gprim/geomtest3d.hpp b/libsrc/gprim/geomtest3d.hpp index b26c9b41..954d32e7 100644 --- a/libsrc/gprim/geomtest3d.hpp +++ b/libsrc/gprim/geomtest3d.hpp @@ -69,10 +69,10 @@ extern double ComputeCylinderRadius (const Vec3d & n1, const Vec3d & n2, double h1, double h2); /// Minimal distance of point p to the line segment [lp1,lp2] -extern double MinDistLP2 (const Point2d & lp1, const Point2d & lp2, const Point2d & p); +DLL_HEADER double MinDistLP2 (const Point2d & lp1, const Point2d & lp2, const Point2d & p); /// Minimal distance of point p to the line segment [lp1,lp2] -extern double MinDistLP2 (const Point3d & lp1, const Point3d & lp2, const Point3d & p); +DLL_HEADER double MinDistLP2 (const Point3d & lp1, const Point3d & lp2, const Point3d & p); /// Minimal distance of point p to the triangle segment [tp1,tp2,pt3] DLL_HEADER double MinDistTP2 (const Point3d & tp1, const Point3d & tp2, From 09188b1a73ce698efad6ca380138fdf493d784aa Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Wed, 7 Sep 2022 13:44:55 +0200 Subject: [PATCH 3/4] no edge swapping for quads --- libsrc/meshing/improve2.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libsrc/meshing/improve2.cpp b/libsrc/meshing/improve2.cpp index b215bfd7..c46df8a0 100644 --- a/libsrc/meshing/improve2.cpp +++ b/libsrc/meshing/improve2.cpp @@ -339,6 +339,9 @@ namespace netgen if (swapped[t1]) return; + if(mesh[t1].GetNP() != 3) + return; + if (multithread.terminate) throw NgException ("Meshing stopped"); From d33d38f1130acd4abd314a11ee5315ebca482455 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Wed, 7 Sep 2022 13:50:05 +0200 Subject: [PATCH 4/4] faster 2d smoothing for certain mixed meshes don't consider quads with fixed points as "mixed mesh" (will be skipped during optimization anyway) --- libsrc/meshing/smoothing2.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libsrc/meshing/smoothing2.cpp b/libsrc/meshing/smoothing2.cpp index 11f21cb8..0e6db78a 100644 --- a/libsrc/meshing/smoothing2.cpp +++ b/libsrc/meshing/smoothing2.cpp @@ -756,10 +756,17 @@ namespace netgen { for (auto & se : mesh.SurfaceElements()) if (se.GetNP() != 3) - { - mixed = true; - break; - } + { + for(auto pi : se.PNums()) + if(mesh[pi].Type() == SURFACEPOINT) + { + mixed = true; + break; + } + if(mixed) + break; + } + const auto & getDofs = [&] (int i) { return elementsonpoint[i+PointIndex::BASE];