]> https://gitweb.dealii.org/ - dealii.git/commitdiff
PETScWrappers: add a couple of missing reinits
authorStefano Zampini <stefano.zampini@gmail.com>
Mon, 28 Nov 2022 21:10:36 +0000 (00:10 +0300)
committerStefano Zampini <stefano.zampini@gmail.com>
Sun, 22 Jan 2023 11:03:03 +0000 (14:03 +0300)
include/deal.II/lac/petsc_sparse_matrix.h
source/lac/petsc_parallel_sparse_matrix.cc

index f4022536fe9e4d25a6db25b75e6a453d5f1784c4..8fb027453087f55b62bb90226431fda7a1d351a7 100644 (file)
@@ -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 <typename SparsityPatternType>
+      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
index 3e2f121a5e165fe66e96372d7c9e119df36003a5..38756d1dd742ad35eda9dd30629c18ee9a4cde16 100644 (file)
@@ -149,6 +149,15 @@ namespace PETScWrappers
 
 
 
+    template <typename SparsityPatternType>
+    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 <typename SparsityPatternType>
     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 &,

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.