]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use a C++17 feature to make code more readable. 16354/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 15 Dec 2023 08:03:50 +0000 (01:03 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 15 Dec 2023 08:04:13 +0000 (01:04 -0700)
include/deal.II/lac/sparse_matrix_tools.h

index c4832c3107b84fbe72c6779a2722701865f5effb..a789e03b317dd0332559daa539cbbe929a60d593 100644 (file)
@@ -238,11 +238,10 @@ namespace SparseMatrixTools
     {
       std::vector<unsigned int> 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);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.