From: Wolfgang Bangerth Date: Fri, 30 Dec 2022 22:08:17 +0000 (-0700) Subject: Push a variable into inner scopes. X-Git-Tag: v9.5.0-rc1~690^2~7 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5a0161b050e3e892e7bd2d68479390dc7ba893d;p=dealii.git Push a variable into inner scopes. --- diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 5f14c6285b..650959b266 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -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 connectivity; for (const auto &patch : patches) { if (patch.reference_cell != ReferenceCells::get_hypercube()) { - connectivity.resize(patch.data.n_cols()); + // Array to hold all the node numbers of a cell + std::vector 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(n)); + // Array to hold all the node numbers of a cell + std::vector connectivity( + Utilities::fixed_power(n)); switch (dim) { @@ -5997,7 +5998,7 @@ namespace DataOutBase } } } - else + else // do not as higher-order cells { Assert(dim <= 3, ExcNotImplemented());