From b84975586c5dc3e2d555385c18378f98d677d4c4 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Mon, 28 Apr 2025 16:32:05 +0200 Subject: [PATCH] Boundarylayer thickness limitation fix Don't check for intersecting mapped trigs if only volume elements are added (and no mapped surface elements). In case of only inserted volume elements, we don't care about the limit at special points. --- libsrc/meshing/boundarylayer_limiter.hpp | 30 ++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/libsrc/meshing/boundarylayer_limiter.hpp b/libsrc/meshing/boundarylayer_limiter.hpp index 6904a61d..e869c69b 100644 --- a/libsrc/meshing/boundarylayer_limiter.hpp +++ b/libsrc/meshing/boundarylayer_limiter.hpp @@ -505,6 +505,25 @@ struct GrowthVectorLimiter RegionTimer reg(t); // check if surface trigs are intersecting each other bool changed = true; + std::set special_points; + + if (tool.insert_only_volume_elements) + for (auto [pi, special_point] : tool.special_boundary_points) + { + special_points.insert(pi); + for (auto& group : special_point.growth_groups) + special_points.insert(group.new_points.Last()); + } + + auto skip_trig = [&] (const Element2d& tri) { + if (!tool.insert_only_volume_elements) + return false; + for (auto pi : tri.PNums()) + if (special_points.find(pi) != special_points.end()) + return true; + return false; + }; + while (changed) { changed = false; @@ -516,6 +535,9 @@ struct GrowthVectorLimiter { const Element2d& tri = Get(sei); + if (skip_trig(tri)) + continue; + Box<3> box(Box<3>::EMPTY_BOX); for (PointIndex pi : tri.PNums()) box.Add(GetPoint(pi, 1.0, true)); @@ -528,6 +550,9 @@ struct GrowthVectorLimiter { const Element2d& tri = Get(sei); + if (skip_trig(tri)) + continue; + Box<3> box(Box<3>::EMPTY_BOX); for (PointIndex pi : tri.PNums()) box.Add(GetPoint(pi, 1.0, true)); @@ -684,8 +709,9 @@ struct GrowthVectorLimiter for (auto pi : Range(growthvectors)) check_point(pi); - for (auto& [special_pi, special_point] : tool.special_boundary_points) - check_point(special_pi); + if (!tool.insert_only_volume_elements) + for (auto& [special_pi, special_point] : tool.special_boundary_points) + check_point(special_pi); } void Perform ()