Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion libsrc/meshing/meshclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7323,7 +7323,7 @@ namespace netgen
{
// Copy the mesh into a new one, then delete unwanted elements
// Unused points are deleted by the Compress() function at the end
auto mesh_ptr = make_unique<Mesh>();
auto mesh_ptr = make_shared<Mesh>();
auto & mesh = *mesh_ptr;
mesh = (*this);

Expand Down Expand Up @@ -7401,6 +7401,14 @@ namespace netgen
if(!keep_point[pel.pnum])
mesh.pointelements.DeleteElement(npointelements-i-1);
}

// Copy identifications to submesh. Redundant identifications are removed in Compress()
auto & ident_to = mesh.GetIdentifications();
const auto & ident_from = this->GetIdentifications();
for(const auto pair : ident_from.GetPairs())
{
ident_to.Add(pair.I1(), pair.I2(), ident_from.GetName(pair.I3()), ident_from.GetType(pair.I3()));
}

mesh.Compress();
return mesh_ptr;
Expand Down