# MatCreateBlockMat
Creates a new matrix in which each block contains a uniform-size sequential `Mat` object 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatCreateBlockMat(MPI_Comm comm, PetscInt m, PetscInt n, PetscInt bs, PetscInt nz, PetscInt *nnz, Mat *A)
```
Collective


## Input Parameters

- ***comm -*** MPI communicator
- ***m -*** number of rows
- ***n  -*** number of columns
- ***bs -*** size of each submatrix
- ***nz  -*** expected maximum number of nonzero blocks in row (use `PETSC_DEFAULT` if not known)
- ***nnz -*** expected number of nonzers per block row if known (use NULL otherwise)



## Output Parameter

- ***A -*** the matrix





## Notes
Matrices of this type are nominally-sparse matrices in which each "entry" is a `Mat` object.  Each `Mat` must
have the same size and be sequential.  The local and global sizes must be compatible with this decomposition.

For matrices containing parallel submatrices and variable block sizes, see `MATNEST`.


## Developer Note
I don't like the name, it is not `MATNESTMAT`


## See Also
 `MATBLOCKMAT`, `MatCreateNest()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/blockmat/seq/blockmat.c.html#MatCreateBlockMat">src/mat/impls/blockmat/seq/blockmat.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/blockmat/seq/blockmat.c)


[Index of all Mat routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
