Don't add new segments in blayer if 'only_add_volume_elements' is set

This commit is contained in:
Matthias Hochsteger 2024-10-25 15:04:34 +02:00
parent 4f927f5469
commit 99be6bbc0e
2 changed files with 14 additions and 1 deletions

View File

@ -285,6 +285,7 @@ BoundaryLayerTool::BoundaryLayerTool(Mesh& mesh_,
topo.SetBuildVertex2Element(true);
mesh.UpdateTopology();
old_segments = mesh.LineSegments();
have_single_segments = HaveSingleSegments(mesh);
if (have_single_segments)
@ -1082,6 +1083,13 @@ void BoundaryLayerTool ::AddSegments()
if (params.disable_curving)
{
for (auto& seg : old_segments)
if (mapto[seg[0]].Size() || mapto[seg[1]].Size())
{
seg.epgeominfo[0].edgenr = -1;
seg.epgeominfo[0].edgenr = -1;
}
for (auto& seg : segments)
if (is_edge_moved[seg.si])
{
@ -1314,6 +1322,11 @@ void BoundaryLayerTool ::Perform()
mesh[pi] += height * (*gw);
}
if (insert_only_volume_elements)
{
mesh.LineSegments() = old_segments;
}
mesh.CalcSurfacesOfNode();
mesh.GetTopology().ClearEdges();
mesh.SetNextMajorTimeStamp();

View File

@ -69,7 +69,7 @@ public:
Array<size_t> par_project_boundaries;
bool have_single_segments;
Array<Segment> segments, new_segments, new_segments_on_moved_bnd;
Array<Segment> old_segments, segments, new_segments, new_segments_on_moved_bnd;
Array<Element2d, SurfaceElementIndex> new_sels, new_sels_on_moved_bnd;
Array<Array<PointIndex>, PointIndex> mapto;
Array<PointIndex, PointIndex> mapfrom;