# MatISSetLocalMat
Replace the local matrix stored inside a `MATIS` object. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatISSetLocalMat(Mat mat, Mat local)
```
Collective on Mat


## Input Parameters

- ***mat -*** the matrix
- ***local -*** the local matrix





## Notes
Any previous matrix within the `MATIS` has its reference count decreased by one.

This can be called if you have precomputed the local matrix and
want to provide it to the matrix object `MATIS`.


## See Also
 `MATIS`, `MatISSetLocalMatType`, `MatISGetLocalMat()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/is/matis.c.html#MatISSetLocalMat">src/mat/impls/is/matis.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex59.c.html">src/ksp/ksp/tutorials/ex59.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/is/matis.c.html#MatISSetLocalMat_IS">MatISSetLocalMat_IS in src/mat/impls/is/matis.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/is/matis.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)  
