BlockSparseMatrix() = default;
/**
- * Create a BlockSparseMatrix with a PETSc Mat
+ * Create a BlockSparseMatrix with a PETSc Mat that describes the entire
+ * block matrix.
+ * It infers the number of blocks from the Mat if it is of type MATNEST,
+ * otherwise the block operator will only have a single block.
+ * Internally, we always store a MATNEST matrix.
*/
explicit BlockSparseMatrix(const Mat &);
* are doing.
*
* The PETSc Mat object returned here describes the *entire* matrix,
- * not just one of its blocks. Internally, this is done by creating
- * a "nested" matrix using Petsc's MatCreateNest object whose individual
+ * not just one of its blocks. Internally, this is done using
+ * a "nested" matrix using PETSc's MATNEST object whose individual
* blocks are the blocks of this matrix.
*/
Mat &
/**
* 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
+ * a "nested" matrix using PETSc's MATNEST object whose individual
* blocks are the blocks of this matrix.
*/
Mat petsc_nest_matrix = nullptr;
/**
* Create a BlockVector with a PETSc Vec
+ * It infers the number of blocks from the Vec if it is of type VECNEST,
+ * otherwise the block vector will only have a single block.
+ * Internally, we always store a VECNEST vector.
*/
explicit BlockVector(Vec v);
-
/**
* Destructor. Clears memory
*/
/**
* Initialize a Matrix from a PETSc Mat object. Note that we do not copy
- * the matrix.
+ * the matrix. The Mat object is referenced by the newly created instance
+ * of the class using PetscObjectReference. This is in line with the PETSc
+ * approach to object ownership, which mimicks std::shared_ptr.
*/
explicit SparseMatrix(const Mat &);
/**
* Initialize a SparseMatrix from a PETSc Mat object. Note that we do not
- * copy the matrix.
+ * copy the matrix. The Mat object is referenced by the newly created
+ * instance of the class using PetscObjectReference. This is in line with
+ * the PETSc approach to object ownership, which mimicks std::shared_ptr.
*/
explicit SparseMatrix(const Mat &);