From: Wolfgang Bangerth Date: Fri, 15 Dec 2023 08:03:50 +0000 (-0700) Subject: Use a C++17 feature to make code more readable. X-Git-Tag: relicensing~243^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16354%2Fhead;p=dealii.git Use a C++17 feature to make code more readable. --- diff --git a/include/deal.II/lac/sparse_matrix_tools.h b/include/deal.II/lac/sparse_matrix_tools.h index c4832c3107..a789e03b31 100644 --- a/include/deal.II/lac/sparse_matrix_tools.h +++ b/include/deal.II/lac/sparse_matrix_tools.h @@ -238,11 +238,10 @@ namespace SparseMatrixTools { std::vector dummy(locally_active_dofs.n_elements()); - const auto local_size = get_local_size(system_matrix); - const auto prefix_sum = compute_prefix_sum(local_size, comm); - IndexSet locally_owned_dofs(std::get<1>(prefix_sum)); - locally_owned_dofs.add_range(std::get<0>(prefix_sum), - std::get<0>(prefix_sum) + local_size); + const auto local_size = get_local_size(system_matrix); + const auto [prefix_sum, total_sum] = compute_prefix_sum(local_size, comm); + IndexSet locally_owned_dofs(total_sum); + locally_owned_dofs.add_range(prefix_sum, prefix_sum + local_size); Utilities::MPI::internal::ComputeIndexOwner::ConsensusAlgorithmsPayload process(locally_owned_dofs, locally_active_dofs, comm, dummy, true);