From 3d3eecba3cda720256ad621453f5fe9b6439c588 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 13 May 2025 16:55:39 +0200 Subject: [PATCH] Blayers: Revert to old behavior for adding segments in case that insert_only_volume_elements is set --- libsrc/meshing/boundarylayer.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libsrc/meshing/boundarylayer.cpp b/libsrc/meshing/boundarylayer.cpp index 11a32cfb..b5c56929 100644 --- a/libsrc/meshing/boundarylayer.cpp +++ b/libsrc/meshing/boundarylayer.cpp @@ -1157,6 +1157,22 @@ void BoundaryLayerTool ::SetDomInOutSides () void BoundaryLayerTool ::AddSegments () { + if (insert_only_volume_elements) + { + if (params.disable_curving) + { + auto is_mapped = [&] (PointIndex pi) { + return pi >= mapto.Range().Next() || mapto[pi].Size() > 0; + }; + for (auto& seg : old_segments) + if (is_mapped(seg[0]) || is_mapped(seg[1])) + { + seg.epgeominfo[0].edgenr = -1; + seg.epgeominfo[1].edgenr = -1; + } + } + } + auto& new_segs = insert_only_volume_elements ? new_segments_on_moved_bnd : new_segments; @@ -1425,6 +1441,11 @@ void BoundaryLayerTool ::Perform () } } + // there is still a bug with segment edge numbers in moved boundaries. + // As a workaround, don't add them at all if only volume elements are inserted + if (insert_only_volume_elements) + mesh.LineSegments() = old_segments; + mesh.CalcSurfacesOfNode(); mesh.GetTopology().ClearEdges(); mesh.SetNextMajorTimeStamp();