# SNESGetNPC
Gets a nonlinear preconditioning solver SNES` to be used to precondition the original nonlinear solver. 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESGetNPC(SNES snes, SNES *pc)
```
Not Collective; but any changes to the obtained the npc object must be applied collectively


## Input Parameter

- ***snes -*** iterative context obtained from `SNESCreate()`



## Output Parameter

- ***npc -*** preconditioner context



## Options Database Key

- ***-npc_snes_type <type> -*** set the type of the `SNES` to use as the nonlinear preconditioner



## Notes
If a `SNES` was previously set with `SNESSetNPC()` then that value is returned, otherwise a new `SNES` object is created.

The (preconditioner) `SNES` returned automatically inherits the same nonlinear function and Jacobian supplied to the original
`SNES`




## See Also
 `SNESSetNPC()`, `SNESHasNPC()`, `SNES`, `SNESCreate()`

## Level
developer

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

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


---
[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)  
