From 016b1692e2b10ebcc8ac24755c5fdd40a7bb0711 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 1 Mar 2022 13:23:06 +0100 Subject: [PATCH] fix point type of geo vertices (FIXEDPOINT) -> locked points --- libsrc/meshing/basegeom.cpp | 2 ++ libsrc/meshing/boundarylayer.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libsrc/meshing/basegeom.cpp b/libsrc/meshing/basegeom.cpp index ca1b7651..2b221de6 100644 --- a/libsrc/meshing/basegeom.cpp +++ b/libsrc/meshing/basegeom.cpp @@ -529,6 +529,8 @@ namespace netgen tree.Insert(mesh[pi], pi); vert2meshpt[vert->GetHash()] = pi; mesh[pi].Singularity(vert->properties.hpref); + mesh[pi].SetType(FIXEDPOINT); + mesh.AddLockedPoint(pi); if(vert->properties.name) { diff --git a/libsrc/meshing/boundarylayer.cpp b/libsrc/meshing/boundarylayer.cpp index 8ae125ab..4c1bd8c0 100644 --- a/libsrc/meshing/boundarylayer.cpp +++ b/libsrc/meshing/boundarylayer.cpp @@ -276,7 +276,11 @@ namespace netgen bool have_single_segments = HaveSingleSegments(mesh); Array segments; if(have_single_segments) + { segments = BuildSegments(mesh); + mesh.SetNextMajorTimeStamp(); + mesh.UpdateTopology(); + } else segments = mesh.LineSegments(); @@ -492,25 +496,29 @@ namespace netgen if(seg.edgenr-1 == edgenr && mesh[seg[0]].Type() == FIXEDPOINT) { points.Append(seg[0]); + points.Append(seg[1]); break; } } while(true) { + bool point_found = false; for(auto si : meshtopo.GetVertexSegments(points.Last())) { const auto& seg = mesh[si]; if(seg.edgenr-1 != edgenr) continue; - if(seg[0] == points.Last() && - (points.Size() < 2 || points[points.Size()-2] !=seg[1])) + if(seg[0] == points.Last() && points[points.Size()-2] !=seg[1]) { points.Append(seg[1]); + point_found = true; break; } } if(mesh[points.Last()].Type() == FIXEDPOINT) break; + if(!point_found) + throw Exception(string("Could not find connected list of line segements for edge ") + edgenr); } // tangential part of growth vectors