# PCModifySubMatrices
Calls an optional user-defined routine within certain preconditioners if one has been set with `PCSetModifySubMatrices()`. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode PCModifySubMatrices(PC pc, PetscInt nsub, const IS row[], const IS col[], Mat submat[], void *ctx)
```
Collective on pc


## Input Parameters

- ***pc -*** the preconditioner context
- ***nsub -*** the number of local submatrices
- ***row -*** an array of index sets that contain the global row numbers
that comprise each local submatrix
- ***col -*** an array of index sets that contain the global column numbers
that comprise each local submatrix
- ***submat -*** array of local submatrices
- ***ctx -*** optional user-defined context for private data for the
user-defined routine (may be null)



## Output Parameter

- ***submat -*** array of local submatrices (the entries of which may
have been modified)



## Notes
The user should NOT generally call this routine, as it will
automatically be called within certain preconditioners (currently
block Jacobi, additive Schwarz) if set.

The basic submatrices are extracted from the preconditioner matrix
as usual; the user can then alter these (for example, to set different
boundary conditions for each submatrix) before they are used for the
local solves.




## See Also
 `PC`, `PCSetModifySubMatrices()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/interface/precon.c.html#PCModifySubMatrices">src/ksp/pc/interface/precon.c</A>


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


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