don't use (maybe invalidated) reference after array resize

This commit is contained in:
Christopher Lackner 2020-11-19 22:36:30 +01:00
parent 6b30ec0b7c
commit 3440a43e99

View File

@ -133,7 +133,8 @@ namespace netgen
// create new FaceDescriptors // create new FaceDescriptors
for(auto i : Range(1, fd_old+1)) for(auto i : Range(1, fd_old+1))
{ {
auto& fd = mesh.GetFaceDescriptor(i); const auto& fd = mesh.GetFaceDescriptor(i);
string name = fd.GetBCName();
if(blp.surfid.Contains(i)) if(blp.surfid.Contains(i))
{ {
if(auto isIn = domains.Test(fd.DomainIn()); isIn != domains.Test(fd.DomainOut())) if(auto isIn = domains.Test(fd.DomainIn()); isIn != domains.Test(fd.DomainOut()))
@ -146,7 +147,7 @@ namespace netgen
new_fd.SetBCProperty(new_si); new_fd.SetBCProperty(new_si);
mesh.AddFaceDescriptor(new_fd); mesh.AddFaceDescriptor(new_fd);
si_map[i] = new_si; si_map[i] = new_si;
mesh.SetBCName(new_si-1, "mapped_" + fd.GetBCName()); mesh.SetBCName(new_si-1, "mapped_" + name);
} }
} }
} }