]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix another place. 16398/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 1 Jan 2024 01:39:17 +0000 (18:39 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 1 Jan 2024 01:39:17 +0000 (18:39 -0700)
source/lac/trilinos_sparse_matrix.cc

index 0a9ce64272a203a623bb9a51e766f63cd9447c00..b9c74f49b47d33b511366f712ee8a6c66d75979a 100644 (file)
@@ -660,7 +660,6 @@ namespace TrilinosWrappers
         return !relevant_map.SameAs(row_space_map);
       }();
 
-      const unsigned int n_rows = relevant_rows.n_elements();
       std::vector<TrilinosWrappers::types::int_type> ghost_rows;
       std::vector<int> n_entries_per_row(row_space_map.NumMyElements());
       std::vector<int> n_entries_per_ghost_row;
@@ -717,10 +716,8 @@ namespace TrilinosWrappers
       // now insert the indices, select between the right matrix
       std::vector<TrilinosWrappers::types::int_type> row_indices;
 
-      for (unsigned int i = 0; i < n_rows; ++i)
+      for (const auto global_row : relevant_rows)
         {
-          const TrilinosWrappers::types::int_type global_row =
-            relevant_rows.nth_index_in_set(i);
           const int row_length = sparsity_pattern.row_length(global_row);
           if (row_length == 0)
             continue;
@@ -729,7 +726,8 @@ namespace TrilinosWrappers
           for (int col = 0; col < row_length; ++col)
             row_indices[col] = sparsity_pattern.column_number(global_row, col);
 
-          if (row_space_map.MyGID(global_row))
+          if (row_space_map.MyGID(
+                static_cast<TrilinosWrappers::types::int_type>(global_row)))
             graph->InsertGlobalIndices(global_row,
                                        row_length,
                                        row_indices.data());

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.