From d91bfe93f289f522c83994b39c4543d7c6d7c40e Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 17 Aug 2023 05:54:03 -0600 Subject: [PATCH] Clear maps, rather than reset pointers. --- source/grid/tria.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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(); } -- 2.39.5