Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use some more std::arrays. #12839

Merged
merged 1 commit into from
Oct 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions source/grid/grid_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2564,7 +2564,7 @@ namespace GridGenerator
}

// calculate deltas and validate input
std::vector<Point<spacedim>> delta(dim);
std::array<Point<spacedim>, dim> delta;
for (unsigned int i = 0; i < dim; ++i)
{
Assert(repetitions[i] >= 1, ExcInvalidRepetitions(repetitions[i]));
Expand Down Expand Up @@ -3077,8 +3077,8 @@ namespace GridGenerator

Assert(spacing.size() == dim, ExcInvalidRepetitionsDimension(dim));

std::vector<unsigned int> repetitions(dim);
double delta = std::numeric_limits<double>::max();
std::array<unsigned int, dim> repetitions;
double delta = std::numeric_limits<double>::max();
for (unsigned int i = 0; i < dim; ++i)
{
repetitions[i] = spacing[i].size();
Expand Down Expand Up @@ -3192,8 +3192,8 @@ namespace GridGenerator
// are >= 1, and calculate deltas
// convert repetitions from double
// to int by taking the ceiling.
std::vector<Point<spacedim>> delta(dim);
unsigned int repetitions[dim];
std::array<Point<spacedim>, dim> delta;
std::array<unsigned int, dim> repetitions;
for (unsigned int i = 0; i < dim; ++i)
{
Assert(holes[i] >= 1,
Expand Down