SNESType — PETSc 3.25.0 documentation

Skip to main content
`Ctrl`+`K`

# SNESType

String with the name of a PETSc `SNES` method. These are all the nonlinear solvers that PETSc provides.

## Synopsis

    typedef const char *SNESType;
    #define SNESNEWTONLS         "newtonls"
    #define SNESNEWTONTR         "newtontr"
    #define SNESNEWTONTRDC       "newtontrdc"
    #define SNESPYTHON           "python"
    #define SNESNRICHARDSON      "nrichardson"
    #define SNESKSPONLY          "ksponly"
    #define SNESKSPTRANSPOSEONLY "ksptransposeonly"
    #define SNESVINEWTONRSLS     "vinewtonrsls"
    #define SNESVINEWTONSSLS     "vinewtonssls"
    #define SNESNGMRES           "ngmres"
    #define SNESQN               "qn"
    #define SNESSHELL            "shell"
    #define SNESNGS              "ngs"
    #define SNESNCG              "ncg"
    #define SNESFAS              "fas"
    #define SNESMS               "ms"
    #define SNESNASM             "nasm"
    #define SNESANDERSON         "anderson"
    #define SNESASPIN            "aspin"
    #define SNESCOMPOSITE        "composite"
    #define SNESPATCH            "patch"
    #define SNESNEWTONAL         "newtonal"

## Note

Use `SNESSetType()` or the options database key `-snes_type` to set the specific nonlinear solver algorithm to use with a given `SNES` object

## See Also

Summary of Nonlinear Solvers Available In PETSc, SNES: Nonlinear Solvers, `SNESSetType()`, `SNES`, `SNESCreate()`, `SNESDestroy()`, `SNESSetFromOptions()`

## Level

beginner

## Location

include/petscsnes.h

## Examples

src/snes/tutorials/ex3.c

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