]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Reserve internal container with correct size. 13527/head
authorMarc Fehling <mafehling.git@gmail.com>
Thu, 10 Mar 2022 05:04:26 +0000 (22:04 -0700)
committerMarc Fehling <mafehling.git@gmail.com>
Thu, 10 Mar 2022 05:04:26 +0000 (22:04 -0700)
source/distributed/tria.cc

index 39f76f1e9f1026fb6ccca90791c4c59cc3a294c2..257c0ccac2ab388e8af21cbbea77d9742adcde39 100644 (file)
@@ -4041,13 +4041,10 @@ namespace parallel
                static_cast<unsigned int>(parallel_forest->local_num_quadrants),
              ExcInternalError());
 
-      // Allocate the space for the weights. In fact we do not know yet, how
-      // many cells we own after the refinement (only p4est knows that
-      // at this point). We simply reserve n_active_cells space and if many
-      // more cells are refined than coarsened than additional reallocation
-      // will be done inside get_cell_weights_recursively.
+      // Allocate the space for the weights. We reserve an integer for each
+      // locally owned quadrant on the already refined p4est object.
       std::vector<unsigned int> weights;
-      weights.reserve(this->n_active_cells());
+      weights.reserve(this->local_cell_relations.size());
 
       // Iterate over p4est and Triangulation relations
       // to find refined/coarsened/kept

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.