# PCShellSetSetUp
Sets routine to use to "setup" the preconditioner whenever the matrix operator is changed. 
## Synopsis
```
#include "petscpc.h" 
PetscErrorCode PCShellSetSetUp(PC pc, PetscErrorCode (*setup)(PC))
```
Logically Collective on pc


## Input Parameters

- ***pc -*** the preconditioner context
- ***setup -*** the application-provided setup routine



## Calling sequence of setup
```none
   PetscErrorCode setup (PC pc)
```



- ***pc -*** the preconditioner, get the application context with PCShellGetContext()



## Note
the function MUST return an error code of 0 on success and nonzero on failure.




## See Also
 `PCSHELL`, `PCShellSetApplyRichardson()`, `PCShellSetApply()`, `PCShellSetContext()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/shell/shellpc.c.html#PCShellSetSetUp">src/ksp/pc/impls/shell/shellpc.c</A>

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/shell/shellpc.c.html#PCShellSetSetUp_Shell(PC pc, PetscErrorCode (*setup)">PCShellSetSetUp_Shell(PC pc, PetscErrorCode (*setup) in src/ksp/pc/impls/shell/shellpc.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/impls/shell/shellpc.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)  
