]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Err on the safe side. 18153/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 20 Feb 2025 19:00:20 +0000 (12:00 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 20 Feb 2025 19:00:20 +0000 (12:00 -0700)
source/grid/tria.cc

index 8e2738e5cd63888745986d3b7ed699e3bfdbdac1..cb23ea896f45bb05a8ecd36309601a2605c4f144 100644 (file)
@@ -13728,6 +13728,11 @@ template <int dim, int spacedim>
 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
 void Triangulation<dim, spacedim>::load(const std::string &file_basename)
 {
+  // It's probably prudent to first get rid of any all content of the
+  // triangulation, rather than hope that the deserialization below
+  // overwrites everything:
+  clear();
+
   // Load triangulation information.
   {
     std::ifstream ifs_tria(file_basename + "_triangulation.data");

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.