# SNESSetNPC
Sets the nonlinear preconditioner to be used. 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESSetNPC(SNES snes, SNES npc)
```
Collective


## Input Parameters

- ***snes -*** iterative context obtained from `SNESCreate()`
- ***npc   -*** the preconditioner object



## Notes
Use `SNESGetNPC()` to retrieve the preconditioner context (for example,
to configure it using the API).

Only some `SNESType` can use a nonlinear preconditioner




## See Also
 `SNESNGS`, `SNESFAS`, `SNESGetNPC()`, `SNESHasNPC()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/interface/snes.c.html#SNESSetNPC">src/snes/interface/snes.c</A>


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


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