From 7bb231fb3c0dcadfa77fb732ca867f4b52bc9a3c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 31 Dec 2023 18:39:17 -0700 Subject: [PATCH] Fix another place. --- source/lac/trilinos_sparse_matrix.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/lac/trilinos_sparse_matrix.cc b/source/lac/trilinos_sparse_matrix.cc index 0a9ce64272..b9c74f49b4 100644 --- a/source/lac/trilinos_sparse_matrix.cc +++ b/source/lac/trilinos_sparse_matrix.cc @@ -660,7 +660,6 @@ namespace TrilinosWrappers return !relevant_map.SameAs(row_space_map); }(); - const unsigned int n_rows = relevant_rows.n_elements(); std::vector ghost_rows; std::vector n_entries_per_row(row_space_map.NumMyElements()); std::vector n_entries_per_ghost_row; @@ -717,10 +716,8 @@ namespace TrilinosWrappers // now insert the indices, select between the right matrix std::vector 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(global_row))) graph->InsertGlobalIndices(global_row, row_length, row_indices.data()); -- 2.39.5