Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear some forgotten fields in Triangulation::clear(). #15877

Merged
merged 2 commits into from
Aug 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions source/grid/tria.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16083,6 +16083,23 @@ void Triangulation<dim, spacedim>::clear_despite_subscriptions()

manifolds.clear();

// In 1d, also reset vertex-to-(boundary|manifold) maps to empty maps
if (dim == 1)
{
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<dim>();
}

Expand Down