From 474e23bd6755e4dd4b929e39fe4394c8ed36b7d5 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 16 Oct 2021 14:32:53 -0400 Subject: [PATCH] Use some more std::arrays. Incredibly, on my machine with max optimizations, valgrind complains about unknown instructions with std::vector but does not with std::array. --- source/grid/grid_generator.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index c15c2a6352..a494186787 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -2564,7 +2564,7 @@ namespace GridGenerator } // calculate deltas and validate input - std::vector> delta(dim); + std::array, dim> delta; for (unsigned int i = 0; i < dim; ++i) { Assert(repetitions[i] >= 1, ExcInvalidRepetitions(repetitions[i])); @@ -3077,8 +3077,8 @@ namespace GridGenerator Assert(spacing.size() == dim, ExcInvalidRepetitionsDimension(dim)); - std::vector repetitions(dim); - double delta = std::numeric_limits::max(); + std::array repetitions; + double delta = std::numeric_limits::max(); for (unsigned int i = 0; i < dim; ++i) { repetitions[i] = spacing[i].size(); @@ -3192,8 +3192,8 @@ namespace GridGenerator // are >= 1, and calculate deltas // convert repetitions from double // to int by taking the ceiling. - std::vector> delta(dim); - unsigned int repetitions[dim]; + std::array, dim> delta; + std::array repetitions; for (unsigned int i = 0; i < dim; ++i) { Assert(holes[i] >= 1, -- 2.39.5