:orphan:
# MatGetBlockSize
Returns the matrix block size. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatGetBlockSize(Mat mat, PetscInt *bs)
```
Not Collective


## Input Parameter

- ***mat -*** the matrix



## Output Parameter

- ***bs -*** block size





## Notes
Block row formats are `MATBAIJ` and `MATSBAIJ` ALWAYS have square block storage in the matrix.

If the block size has not been set yet this routine returns 1.


## See Also
 [](ch_matrices), `Mat`, `MATBAIJ`, `MATSBAIJ`, `MatCreateSeqBAIJ()`, `MatCreateBAIJ()`, `MatGetBlockSizes()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/interface/matrix.c.html#MatGetBlockSize">src/mat/interface/matrix.c</A>


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


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