From f5a0161b050e3e892e7bd2d68479390dc7ba893d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 30 Dec 2022 15:08:17 -0700 Subject: [PATCH] Push a variable into inner scopes. --- source/base/data_out_base.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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()); -- 2.39.5