# SNESDestroy
Destroys the nonlinear solver context that was created with `SNESCreate()`. 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESDestroy(SNES *snes)
```
Collective


## Input Parameter

- ***snes -*** the `SNES` context





## See Also
 `SNES`, `SNESCreate()`, `SNESSolve()`

## Level
beginner

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex1.c.html">src/snes/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex12.c.html">src/snes/tutorials/ex12.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex13.c.html">src/snes/tutorials/ex13.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex14.c.html">src/snes/tutorials/ex14.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex15.c.html">src/snes/tutorials/ex15.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex16.c.html">src/snes/tutorials/ex16.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex17.c.html">src/snes/tutorials/ex17.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex18.c.html">src/snes/tutorials/ex18.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex19.c.html">src/snes/tutorials/ex19.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex1f.F90.html">src/snes/tutorials/ex1f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex2.c.html">src/snes/tutorials/ex2.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/composite/snescomposite.c.html#SNESDestroy_Composite">SNESDestroy_Composite in src/snes/impls/composite/snescomposite.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/fas/fas.c.html#SNESDestroy_FAS">SNESDestroy_FAS in src/snes/impls/fas/fas.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/gs/snesgs.c.html#SNESDestroy_NGS">SNESDestroy_NGS in src/snes/impls/gs/snesgs.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/ksponly/ksponly.c.html#SNESDestroy_KSPONLY">SNESDestroy_KSPONLY in src/snes/impls/ksponly/ksponly.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/ls/ls.c.html#SNESDestroy_NEWTONLS">SNESDestroy_NEWTONLS in src/snes/impls/ls/ls.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/ms/ms.c.html#SNESDestroy_MS">SNESDestroy_MS in src/snes/impls/ms/ms.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/multiblock/multiblock.c.html#SNESDestroy_Multiblock">SNESDestroy_Multiblock in src/snes/impls/multiblock/multiblock.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/nasm/aspin.c.html#SNESDestroy_ASPIN">SNESDestroy_ASPIN in src/snes/impls/nasm/aspin.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/nasm/nasm.c.html#SNESDestroy_NASM">SNESDestroy_NASM in src/snes/impls/nasm/nasm.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/ncg/snesncg.c.html#SNESDestroy_NCG">SNESDestroy_NCG in src/snes/impls/ncg/snesncg.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/ngmres/snesngmres.c.html#SNESDestroy_NGMRES">SNESDestroy_NGMRES in src/snes/impls/ngmres/snesngmres.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/ntrdc/ntrdc.c.html#SNESDestroy_NEWTONTRDC">SNESDestroy_NEWTONTRDC in src/snes/impls/ntrdc/ntrdc.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/patch/snespatch.c.html#SNESDestroy_Patch">SNESDestroy_Patch in src/snes/impls/patch/snespatch.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/qn/qn.c.html#SNESDestroy_QN">SNESDestroy_QN in src/snes/impls/qn/qn.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/richardson/snesrichardson.c.html#SNESDestroy_NRichardson">SNESDestroy_NRichardson in src/snes/impls/richardson/snesrichardson.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/shell/snesshell.c.html#SNESDestroy_Shell">SNESDestroy_Shell in src/snes/impls/shell/snesshell.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/tr/tr.c.html#SNESDestroy_NEWTONTR">SNESDestroy_NEWTONTR in src/snes/impls/tr/tr.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/vi/vi.c.html#SNESDestroy_VI">SNESDestroy_VI in src/snes/impls/vi/vi.c</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)  
