From e7b9baa93bb5ff72829ab32da489961a8a0fe52a Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Thu, 19 Nov 2020 22:53:14 +0100 Subject: [PATCH] remove another reference of resized array --- libsrc/meshing/boundarylayer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libsrc/meshing/boundarylayer.cpp b/libsrc/meshing/boundarylayer.cpp index a9407248..bd5427ef 100644 --- a/libsrc/meshing/boundarylayer.cpp +++ b/libsrc/meshing/boundarylayer.cpp @@ -410,7 +410,8 @@ namespace netgen for(SurfaceElementIndex si = 0; si < nse; si++) { - auto& sel = mesh[si]; + // copy because surfaceels array will be resized! + auto sel = mesh[si]; if(si_map[sel.GetIndex()] != -1) { Array points(sel.PNums()); @@ -436,7 +437,7 @@ namespace netgen mesh.AddSurfaceElement(newel); } if(move_boundaries.Test(sel.GetIndex())) - for(auto& p : sel.PNums()) + for(auto& p : mesh[si].PNums()) if(mapto[p].Size()) p = mapto[p].Last(); }