From 9730a383fdf94d0bf8f1a857d85ed46612a0c123 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Wed, 2 Mar 2022 11:34:02 +0100 Subject: [PATCH] geo vertices as pointelements not locked points --- libsrc/meshing/basegeom.cpp | 12 ++++-------- libsrc/meshing/meshclass.cpp | 2 ++ libsrc/meshing/meshfunc.cpp | 7 +++++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libsrc/meshing/basegeom.cpp b/libsrc/meshing/basegeom.cpp index 2b221de6..ff994594 100644 --- a/libsrc/meshing/basegeom.cpp +++ b/libsrc/meshing/basegeom.cpp @@ -530,15 +530,11 @@ namespace netgen vert2meshpt[vert->GetHash()] = pi; mesh[pi].Singularity(vert->properties.hpref); mesh[pi].SetType(FIXEDPOINT); - mesh.AddLockedPoint(pi); - if(vert->properties.name) - { - Element0d el(pi, pi); - el.name = vert->properties.GetName(); - mesh.SetCD3Name(pi, el.name); - mesh.pointelements.Append (el); - } + Element0d el(pi, pi); + el.name = vert->properties.GetName(); + mesh.SetCD3Name(pi, el.name); + mesh.pointelements.Append (el); } for(auto & vert : vertices) diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index b381f760..89375e47 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -2352,6 +2352,8 @@ namespace netgen for (int i = 0; i < lockedpoints.Size(); i++) points[lockedpoints[i]].SetType(FIXEDPOINT); + for(const auto& pointel : pointelements) + points[pointel.pnum].SetType(FIXEDPOINT); /* for (i = 0; i < openelements.Size(); i++) diff --git a/libsrc/meshing/meshfunc.cpp b/libsrc/meshing/meshfunc.cpp index 700137e1..07c2ed58 100644 --- a/libsrc/meshing/meshfunc.cpp +++ b/libsrc/meshing/meshfunc.cpp @@ -102,7 +102,7 @@ namespace netgen // mark locked/fixed points for each domain TODO: domain bounding box to add only relevant points? for(auto pi : mesh.LockedPoints()) for(auto i : Range(ret)) - ipmap[i][pi] = 1; + ipmap[i][pi] = 2; // add used points to domain mesh, build point mapping for(auto i : Range(ret)) @@ -113,7 +113,10 @@ namespace netgen for(auto pi : Range(ipmap[i])) if(ipmap[i][pi]) { - auto pi_new = m.AddPoint( mesh[pi] ); + const auto& mp = mesh[pi]; + auto pi_new = m.AddPoint( mp, mp.GetLayer(), mp.Type() ); + if(ipmap[i][pi] == 2) + mesh.AddLockedPoint(pi_new); ipmap[i][pi] = pi_new; pmap.Append( pi ); }