diff --git a/libsrc/meshing/smoothing3.cpp b/libsrc/meshing/smoothing3.cpp index 039bbf64..4af0128a 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 non_tet_points(points.Size()); + non_tet_points = 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()) + non_tet_points[pi] = true; + } + }); + elementsonpoint = ngcore::CreateSortedTable( elements.Range(), [&](auto & table, ElementIndex ei) { @@ -344,6 +358,7 @@ namespace netgen return; for (PointIndex pi : el.PNums()) + if(!non_tet_points[pi]) table.Add (pi, ei); }, points.Size()); }