From: Stefano Zampini Date: Mon, 28 Nov 2022 21:10:36 +0000 (+0300) Subject: PETScWrappers: add a couple of missing reinits X-Git-Tag: v9.5.0-rc1~621^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08e1f691db71fe2f2c1ee0982b57c00293166415;p=dealii.git PETScWrappers: add a couple of missing reinits --- diff --git a/include/deal.II/lac/petsc_sparse_matrix.h b/include/deal.II/lac/petsc_sparse_matrix.h index f4022536fe..8fb0274530 100644 --- a/include/deal.II/lac/petsc_sparse_matrix.h +++ b/include/deal.II/lac/petsc_sparse_matrix.h @@ -471,6 +471,18 @@ namespace PETScWrappers const unsigned int this_process, const bool preset_nonzero_locations = true); + /** + * Create a square matrix where the size() of the IndexSet determines the + * global number of rows and columns and the entries of the IndexSet + * give the rows and columns for the calling processor. Note that only + * ascending, 1:1 IndexSets are supported. + */ + template + void + reinit(const IndexSet & local_partitioning, + const SparsityPatternType &sparsity_pattern, + const MPI_Comm & communicator); + /** * Create a matrix where the size() of the IndexSets determine the * global number of rows and columns and the entries of the IndexSet diff --git a/source/lac/petsc_parallel_sparse_matrix.cc b/source/lac/petsc_parallel_sparse_matrix.cc index 3e2f121a5e..38756d1dd7 100644 --- a/source/lac/petsc_parallel_sparse_matrix.cc +++ b/source/lac/petsc_parallel_sparse_matrix.cc @@ -149,6 +149,15 @@ namespace PETScWrappers + template + void + SparseMatrix::reinit(const IndexSet & local_rows, + const SparsityPatternType &sparsity_pattern, + const MPI_Comm & communicator) + { + do_reinit(communicator, local_rows, local_rows, sparsity_pattern); + } + template void SparseMatrix::reinit(const IndexSet & local_rows, @@ -705,12 +714,22 @@ namespace PETScWrappers const unsigned int, const bool); + template void + SparseMatrix::reinit(const IndexSet &, + const SparsityPattern &, + const MPI_Comm &); + template void SparseMatrix::reinit(const IndexSet &, const IndexSet &, const SparsityPattern &, const MPI_Comm &); + template void + SparseMatrix::reinit(const IndexSet &, + const DynamicSparsityPattern &, + const MPI_Comm &); + template void SparseMatrix::reinit(const IndexSet &, const IndexSet &,