Skip to main content
`Ctrl`+`K`

# SNES

Abstract PETSc object that manages nonlinear solves

## Synopsis

    typedef struct _p_SNES *SNES;

## Notes

The most commonly used `SNESType` is `SNESNEWTONLS` which uses Newton’s method with a line search. For all the Newton based `SNES` nonlinear solvers, `KSP`, the PETSc abstract linear solver object, is used to (approximately) solve the required linear systems.

See `SNESType` for a list of all the nonlinear solver algorithms provided by PETSc.

Some of the `SNES` solvers support nonlinear preconditioners, which themselves are also `SNES` objects managed with `SNESGetNPC()`

## See Also

Summary of Nonlinear Solvers Available In PETSc, SNES: Nonlinear Solvers, `SNESCreate()`, `SNESSolve()`, `SNESSetType()`, `SNESType`, `TS`, `KSP`, `PC`, `SNESDestroy()`

## Level

beginner

## Location

include/petscsnestypes.h

## Examples

src/snes/tutorials/ex14.c
src/snes/tutorials/ex21.c
src/snes/tutorials/ex59.c
src/snes/tutorials/ex9.c
src/ksp/ksp/tutorials/ex14f.F90
src/snes/tutorials/ex11.c
src/snes/tutorials/ex4.c
src/snes/tutorials/ex1.c
src/snes/tutorials/ex12.c
src/snes/tutorials/ex64.c

## Implementations

_p_SNES in include/petsc/private/snesimpl.h
SNES_NEWTONAL in src/snes/impls/al/alimpl.h
SNES_Composite in src/snes/impls/composite/snescomposite.c
SNES_FAS in src/snes/impls/fas/fasimpls.h
SNES_NGS in src/snes/impls/gs/gsimpl.h
SNES_KSPONLY in src/snes/impls/ksponly/ksponly.c
SNES_NEWTONLS in src/snes/impls/ls/lsimpl.h
SNES_MS in src/snes/impls/ms/ms.c
SNES_Multiblock in src/snes/impls/multiblock/multiblock.c
SNES_NASM in src/snes/impls/nasm/nasm.c
SNES_NCG in src/snes/impls/ncg/snesncgimpl.h
SNES_NGMRES in src/snes/impls/ngmres/snesngmres.h
SNES_NEWTONTRDC in src/snes/impls/ntrdc/ntrdcimpl.h
SNES_Patch in src/snes/impls/patch/snespatch.c
SNES_QN in src/snes/impls/qn/qn.c
SNES_NRichardson in src/snes/impls/richardson/snesrichardsonimpl.h
SNES_Shell in src/snes/impls/shell/snesshell.c
SNES_NEWTONTR in src/snes/impls/tr/trimpl.h
SNES_VINEWTONRSLS in src/snes/impls/vi/rs/virsimpl.h
SNES_VINEWTONSSLS in src/snes/impls/vi/ss/vissimpl.h

Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages