diff --git a/libsrc/meshing/basegeom.cpp b/libsrc/meshing/basegeom.cpp index ae4130c4..c2834d42 100644 --- a/libsrc/meshing/basegeom.cpp +++ b/libsrc/meshing/basegeom.cpp @@ -199,6 +199,19 @@ namespace netgen } }; + void NetgenGeometry :: Clear() + { + vertex_map.clear(); + edge_map.clear(); + face_map.clear(); + solid_map.clear(); + + vertices.SetSize0(); + edges.SetSize0(); + faces.SetSize0(); + solids.SetSize0(); + } + void NetgenGeometry :: ProcessIdentifications() { for(auto i : Range(vertices)) diff --git a/libsrc/meshing/basegeom.hpp b/libsrc/meshing/basegeom.hpp index d7371e2b..49bf8710 100644 --- a/libsrc/meshing/basegeom.hpp +++ b/libsrc/meshing/basegeom.hpp @@ -197,6 +197,7 @@ namespace netgen const GeometryFace & GetFace(int i) const { return *faces[i]; } + void Clear(); virtual int GenerateMesh (shared_ptr & mesh, MeshingParameters & mparam); diff --git a/libsrc/occ/occgeom.cpp b/libsrc/occ/occgeom.cpp index 1b245a7f..f6d38a2b 100644 --- a/libsrc/occ/occgeom.cpp +++ b/libsrc/occ/occgeom.cpp @@ -1107,6 +1107,12 @@ namespace netgen fsingular = esingular = vsingular = false; + NetgenGeometry::Clear(); + edge_map.clear(); + vertex_map.clear(); + face_map.clear(); + solid_map.clear(); + // Add shapes for(auto i1 : Range(1, vmap.Extent()+1)) {