MatCreateNest#
Creates a new MATNEST matrix containing several nested submatrices, each stored separately
Synopsis#
#include "petscmat.h"
PetscErrorCode MatCreateNest(MPI_Comm comm, PetscInt nr, const IS is_row[], PetscInt nc, const IS is_col[], const Mat a[], Mat *B) PeNSS
Collective
Input Parameters#
comm - Communicator for the new
MATNESTnr - number of nested row blocks
is_row - index sets for each nested row block, or
NULLto make contiguousnc - number of nested column blocks
is_col - index sets for each nested column block, or
NULLto make contiguousa - array of \(nr \times nc\) submatrices, empty submatrices can be passed using
NULL
Output Parameter#
B - new matrix
Note#
In both C and Fortran, a must be a one-dimensional array representing a two-dimensional row-major order array holding references to the matrices.
For instance, to represent the matrix
\(\begin{bmatrix} A_{11} & A_{12} \\ A_{21} & A_{22}\end{bmatrix}\)
one should use Mat a[4]={A11,A12,A21,A22}.
Fortran Note#
Pass PETSC_NULL_MAT in the corresponding entry of a for an empty block
See Also#
Matrices, Mat, MATNEST, MatCreate(), VecCreateNest(), DMCreateMatrix(), MatNestSetSubMat(),
MatNestGetSubMat(), MatNestGetLocalISs(), MatNestGetSize(),
MatNestGetISs(), MatNestSetSubMats(), MatNestGetSubMats()
Level#
advanced
Location#
Examples#
src/mat/tests/ex210.c
src/mat/tests/ex125.c
src/mat/tests/ex159.c
src/mat/tests/ex202.c
src/mat/tests/ex212.c
src/mat/tests/ex23.c
src/mat/tests/ex264.c
src/mat/tests/ex269f.F90
src/mat/tests/ex275.c
src/mat/tests/ex70.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages