From: Daniel Arndt Date: Tue, 20 Feb 2024 14:30:40 +0000 (-0500) Subject: Fix compiling clear_rows with newer Trilinos versions X-Git-Tag: relicensing~14^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=614f9c50f1ea0974fdb94bf4a810db403ef0601a;p=dealii.git Fix compiling clear_rows with newer Trilinos versions --- diff --git a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h index fae4292018..3195d7c1c3 100644 --- a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h +++ b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h @@ -1040,15 +1040,22 @@ namespace LinearAlgebra { size_t nnz = matrix->getNumEntriesInLocalRow(local_row); col_indices_vector.resize(nnz); - Teuchos::ArrayView col_indices(col_indices_vector); values_vector.resize(nnz); +# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0) + typename MatrixType::nonconst_local_inds_host_view_type + col_indices(col_indices_vector.data(), nnz); + typename MatrixType::nonconst_values_host_view_type values( + values_vector.data(), nnz); +# else + Teuchos::ArrayView col_indices(col_indices_vector); Teuchos::ArrayView values(values_vector); - +# endif matrix->getLocalRowCopy(local_row, col_indices, values, nnz); - const size_t diag_index = - std::find(col_indices.begin(), col_indices.end(), local_row) - - col_indices.begin(); + const size_t diag_index = std::find(col_indices_vector.begin(), + col_indices_vector.end(), + local_row) - + col_indices_vector.begin(); for (size_t j = 0; j < nnz; ++j) if (diag_index != j || new_diag_value == 0)