:orphan:
# PCSPAISetBlockSize
set the block size for the `PCSPAI` preconditioner 
## Synopsis
```
#include "petscpc.h" 
PetscErrorCode PCSPAISetBlockSize(PC pc, PetscInt block_size1)
```

## Input Parameters

- ***pc -*** the preconditioner
- ***n -*** block size (default 1)



## Notes
A block
size of 1 treats A as a matrix of scalar elements. A
block size of s > 1 treats A as a matrix of sxs
blocks. A block size of 0 treats A as a matrix with
variable sized blocks, which are determined by
searching for dense square diagonal blocks in A.
This can be very effective for finite-element
matrices.

SPAI will convert A to block form, use a block
version of the preconditioner algorithm, and then
convert the result back to scalar form.

In many cases the a block-size parameter other than 1
can lead to very significant improvement in
performance.




## See Also
 `PCSPAI`, `PCSetType()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/spai/ispai.c.html#PCSPAISetBlockSize">src/ksp/pc/impls/spai/ispai.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/spai/ispai.c.html#PCSPAISetBlockSize_SPAI">PCSPAISetBlockSize_SPAI in src/ksp/pc/impls/spai/ispai.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/impls/spai/ispai.c)


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