From: Wolfgang Bangerth Date: Thu, 17 Aug 2023 11:54:03 +0000 (-0600) Subject: Clear maps, rather than reset pointers. X-Git-Tag: relicensing~583^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15877%2Fhead;p=dealii.git Clear maps, rather than reset pointers. --- diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 4b0c65fa41..83218e3631 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -16086,11 +16086,19 @@ void Triangulation::clear_despite_subscriptions() // In 1d, also reset vertex-to-(boundary|manifold) maps to empty maps if (dim == 1) { - vertex_to_boundary_id_map_1d = - std::make_unique>(); - vertex_to_manifold_id_map_1d = - std::make_unique>(); + Assert(vertex_to_boundary_id_map_1d != nullptr, ExcInternalError()); + vertex_to_boundary_id_map_1d->clear(); + + Assert(vertex_to_manifold_id_map_1d != nullptr, ExcInternalError()); + vertex_to_manifold_id_map_1d->clear(); } + else + { + // For dim>1, these maps should simply not exist. + Assert(vertex_to_boundary_id_map_1d == nullptr, ExcInternalError()); + Assert(vertex_to_manifold_id_map_1d == nullptr, ExcInternalError()); + } + number_cache = internal::TriangulationImplementation::NumberCache(); }