From 33ea874c266669e202dbaa54eada357123e92b2a Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 15 Dec 2023 01:03:50 -0700 Subject: [PATCH] Use a C++17 feature to make code more readable. --- include/deal.II/lac/sparse_matrix_tools.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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); -- 2.39.5