]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Push a variable into inner scopes.
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 30 Dec 2022 22:08:17 +0000 (15:08 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 31 Dec 2022 15:25:43 +0000 (08:25 -0700)
source/base/data_out_base.cc

index 5f14c6285b7f4755b086875b6da8a93a7fe8370d..650959b2667d4e732071512fbc94896da2b84947 100644 (file)
@@ -5865,14 +5865,13 @@ namespace DataOutBase
         {
           Assert(dim <= 3 && dim > 1, ExcNotImplemented());
           unsigned int first_vertex_of_patch = 0;
-          // Array to hold all the node numbers of a cell
-          std::vector<unsigned> connectivity;
 
           for (const auto &patch : patches)
             {
               if (patch.reference_cell != ReferenceCells::get_hypercube<dim>())
                 {
-                  connectivity.resize(patch.data.n_cols());
+                  // Array to hold all the node numbers of a cell
+                  std::vector<unsigned> connectivity(patch.data.n_cols());
 
                   for (unsigned int i = 0; i < patch.data.n_cols(); ++i)
                     connectivity[i] = i;
@@ -5898,7 +5897,9 @@ namespace DataOutBase
                   const unsigned int n_subdivisions = patch.n_subdivisions;
                   const unsigned int n              = n_subdivisions + 1;
 
-                  connectivity.resize(Utilities::fixed_power<dim>(n));
+                  // Array to hold all the node numbers of a cell
+                  std::vector<unsigned> connectivity(
+                    Utilities::fixed_power<dim>(n));
 
                   switch (dim)
                     {
@@ -5997,7 +5998,7 @@ namespace DataOutBase
                 }
             }
         }
-      else
+      else // do not as higher-order cells
         {
           Assert(dim <= 3, ExcNotImplemented());
 

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.