Skip to main content
`Ctrl`+`K`

# SNESSolve

Solves a nonlinear system \(F(x) = b \) associated with a `SNES` object

## Synopsis

    #include "petscsnes.h"
    PetscErrorCode SNESSolve(SNES snes, Vec b, Vec x)

Collective

## Input Parameters

- snes - the `SNES` context

- b - the constant part of the equation \(F(x) = b\), or `NULL` to use zero.

- x - the solution vector.

## Note

The user should initialize the vector, `x`, with the initial guess for the nonlinear solve prior to calling `SNESSolve()` .

## See Also

SNES: Nonlinear Solvers, `SNES`, `SNESCreate()`, `SNESDestroy()`, `SNESSetFunction()`, `SNESSetJacobian()`, `SNESSetGridSequence()`, `SNESGetSolution()`, `SNESNewtonTRSetPreCheck()`, `SNESNewtonTRGetPreCheck()`, `SNESNewtonTRSetPostCheck()`, `SNESNewtonTRGetPostCheck()`, `SNESLineSearchSetPostCheck()`, `SNESLineSearchGetPostCheck()`, `SNESLineSearchSetPreCheck()`, `SNESLineSearchGetPreCheck()`

## Level

beginner

## Location

src/snes/interface/snes.c

## Examples

src/snes/tutorials/ex21.c
src/snes/tutorials/ex3.c
src/snes/tutorials/ex2.c
src/snes/tutorials/ex28.c
src/snes/tutorials/ex25.c
src/snes/tutorials/ex19.c
src/snes/tutorials/ex22.c
src/snes/tutorials/ex1.c
src/snes/tutorials/ex18.c
src/snes/tutorials/ex15.c

## Implementations

SNESSolve_NEWTONAL() in src/snes/impls/al/al.c
SNESSolve_Composite() in src/snes/impls/composite/snescomposite.c
SNESSolve_FAS() in src/snes/impls/fas/fas.c
SNESSolve_NGS() in src/snes/impls/gs/snesgs.c
SNESSolve_KSPONLY() in src/snes/impls/ksponly/ksponly.c
SNESSolve_NEWTONLS() in src/snes/impls/ls/ls.c
SNESSolve_MS() in src/snes/impls/ms/ms.c
SNESSolve_Multiblock() in src/snes/impls/multiblock/multiblock.c
SNESSolve_NASM() in src/snes/impls/nasm/nasm.c
SNESSolve_NCG() in src/snes/impls/ncg/snesncg.c
SNESSolve_Anderson() in src/snes/impls/ngmres/anderson.c
SNESSolve_NGMRES() in src/snes/impls/ngmres/snesngmres.c
SNESSolve_NEWTONTRDC() in src/snes/impls/ntrdc/ntrdc.c
SNESSolve_Patch() in src/snes/impls/patch/snespatch.c
SNESSolve_QN() in src/snes/impls/qn/qn.c
SNESSolve_NRichardson() in src/snes/impls/richardson/snesrichardson.c
SNESSolve_Shell() in src/snes/impls/shell/snesshell.c
SNESSolve_NEWTONTR() in src/snes/impls/tr/tr.c
SNESSolve_VINEWTONRSLS() in src/snes/impls/vi/rs/virs.c
SNESSolve_VINEWTONSSLS() in src/snes/impls/vi/ss/viss.c

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