From 10377be7d70d62abcaf99422a4df819fe73ad299 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Fri, 19 Jan 2024 09:21:22 +0100 Subject: [PATCH] Don't do mesh smoothing at non-tet elements --- libsrc/meshing/smoothing3.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libsrc/meshing/smoothing3.cpp b/libsrc/meshing/smoothing3.cpp index 3cc10f7c..c9c533ff 100644 --- a/libsrc/meshing/smoothing3.cpp +++ b/libsrc/meshing/smoothing3.cpp @@ -335,6 +335,20 @@ namespace netgen { static Timer tim("PointFunction - build elementsonpoint table"); RegionTimer reg(tim); + Array bad_point(points.Size()); + bad_point = false; + // Don't optimize if point is adjacent to a non-tet element + ParallelForRange(elements.Range(), [&] (auto myrange) + { + for(auto ei : myrange) + { + const auto & el = elements[ei]; + if(el.NP()!=4) + for(auto pi : el.PNums()) + bad_point[pi] = true; + } + }); + elementsonpoint = ngcore::CreateSortedTable( elements.Range(), [&](auto & table, ElementIndex ei) { @@ -344,6 +358,7 @@ namespace netgen return; for (PointIndex pi : el.PNums()) + if(!bad_point[pi]) table.Add (pi, ei); }, points.Size()); }