petsc-3.8.4 2018-03-24
Report Typos and Errors


Sets the matrix block row and column sizes.


#include "petscmat.h" 
PetscErrorCode MatSetBlockSizes(Mat mat,PetscInt rbs,PetscInt cbs)
Logically Collective on Mat

Input Parameters

mat - the matrix
rbs - row block size
cbs -column block size


Block row formats are MATSEQBAIJ, MATMPIBAIJ, MATSEQSBAIJ, MATMPISBAIJ. These formats ALWAYS have square block storage in the matrix. If you pass a different block size for the columns than the rows, the row block size determines the square block storage. This must be called before MatSetUp() or MatXXXSetPreallocation() (or will default to 1) and the block size cannot be changed later

For MATMPIAIJ and MATSEQAIJ matrix formats, this function can be called at a later stage, provided that the specified block sizes are compatible with the matrix local sizes.

The row and column block size determine the blocksize of the "row" and "column" vectors returned by MatCreateVecs().

See Also

MatCreateSeqBAIJ(), MatCreateBAIJ(), MatGetBlockSize(), MatSetBlockSize(), MatGetBlockSizes()

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages