]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Merge pull request #14602 from luca-heltai/petsc-petscmat-to-dealiimat
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 25 Jan 2023 22:53:53 +0000 (15:53 -0700)
committerGitHub <noreply@github.com>
Wed, 25 Jan 2023 22:53:53 +0000 (15:53 -0700)
PETScWrappers:BlockSparseMatrix: constructor from PETSc Mat

1  2 
include/deal.II/lac/petsc_block_sparse_matrix.h
include/deal.II/lac/petsc_matrix_base.h
include/deal.II/lac/petsc_sparse_matrix.h
source/lac/petsc_matrix_base.cc
source/lac/petsc_parallel_block_sparse_matrix.cc
source/lac/petsc_parallel_sparse_matrix.cc
source/lac/petsc_sparse_matrix.cc

index eb52c6207222b6c12d0fe7f376ebcc3e5e664c72,15db6f4f317f95a9644710b537d2f4a8581c06e8..5fdf6d417387244d9768aa23c314c2dda90538b1
@@@ -294,13 -294,18 +299,24 @@@ namespace PETScWrapper
        Mat &
        petsc_matrix();
  
+       /**
+        * This method assigns the PETSc Mat to the instance of the class.
+        *
+        * Note that the matrix is not copied: instead, the instance of this class
+        * is initialized to use the given matrix. This is useful if you want to
+        * interpret a PETSc Mat object as a deal.II BlockMatrix, and you already
+        * have a BlockMatrix object that you want to use for this purpose.
+        */
+       void
+       assign_petsc_matrix(Mat A);
      private:
 +      /**
 +       * A PETSc Mat object that describes the entire block matrix.
 +       * Internally, this is done by creating
 +       * a "nested" matrix using Petsc's MatCreateNest object whose individual
 +       * blocks are the blocks of this matrix.
 +       */
        Mat petsc_nest_matrix = nullptr;
      };
  
Simple merge
Simple merge

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.