From b7ba945460e50dc06958d72e661ea850e8c39ee5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 15 Feb 2024 15:47:34 -0700 Subject: [PATCH] Only enable a function if a template type is right. --- include/deal.II/lac/trilinos_tpetra_sparse_matrix.h | 6 ++++-- .../lac/trilinos_tpetra_sparse_matrix.templates.h | 9 +++++---- source/lac/trilinos_tpetra_sparse_matrix.cc | 7 +++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h index 48de7bd615..60b6bcbf27 100644 --- a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h @@ -319,7 +319,8 @@ namespace LinearAlgebra * processors in order to avoid a dead lock. */ template - void + std::enable_if_t< + !std::is_same_v>> reinit(const IndexSet ¶llel_partitioning, const SparsityPatternType &sparsity_pattern, const MPI_Comm communicator = MPI_COMM_WORLD, @@ -338,7 +339,8 @@ namespace LinearAlgebra * processors in order to avoid a dead lock. */ template - void + std::enable_if_t< + !std::is_same_v>> reinit(const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const SparsityPatternType &sparsity_pattern, 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 de1d09db50..b703deaf66 100644 --- a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h +++ b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h @@ -430,7 +430,8 @@ namespace LinearAlgebra template template - inline void + inline std::enable_if_t< + !std::is_same_v>> SparseMatrix::reinit( const IndexSet ¶llel_partitioning, const SparsityPatternType &sparsity_pattern, @@ -448,10 +449,10 @@ namespace LinearAlgebra template template - void + std::enable_if_t< + !std::is_same_v>> SparseMatrix::reinit( - const IndexSet &row_parallel_partitioning, - + const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const SparsityPatternType &sparsity_pattern, const MPI_Comm communicator, diff --git a/source/lac/trilinos_tpetra_sparse_matrix.cc b/source/lac/trilinos_tpetra_sparse_matrix.cc index 63f970f3ed..36945b1843 100644 --- a/source/lac/trilinos_tpetra_sparse_matrix.cc +++ b/source/lac/trilinos_tpetra_sparse_matrix.cc @@ -29,6 +29,13 @@ namespace LinearAlgebra { template class SparseMatrix; + template void + SparseMatrix::reinit( + const IndexSet ¶llel_partitioning, + const dealii::DynamicSparsityPattern &sparsity_pattern, + const MPI_Comm communicator, + const bool exchange_data); + template void SparseMatrix::reinit( const IndexSet &row_parallel_partitioning, -- 2.39.5