SNESSetType

Sets the method for the nonlinear solver.

Synopsis

int SNESSetType(SNES snes,SNESType method)
Collective on SNES

Input Parameters

snes - the SNES context
method - a known method

Options Database Key

-snes_type <method> -Sets the method; use -help for a list of available methods (for instance, ls or tr)

Notes

See "petsc/include/snes.h" for available methods (for instance)
SNES_EQ_LS -Newton's method with line search (systems of nonlinear equations)
SNES_EQ_TR -Newton's method with trust region (systems of nonlinear equations)
SNES_UM_TR -Newton's method with trust region (unconstrained minimization)
SNES_UM_LS -Newton's method with line search (unconstrained minimization)

Normally, it is best to use the SNESSetFromOptions() command and thenset the SNES solver type from the options database rather than by usingthis routine. Using the options database provides the user withmaximum flexibility in evaluating the many nonlinear solvers. The SNESSetType() routine is provided for those situations where itis necessary to set the nonlinear solver independently of the commandline or options database. This might be the case, for example, whenthe choice of solver changes during the execution of the program, and the user's application is taking responsibility for choosing theappropriate method. In other words, this routine is for the advanced user.

Keywords

SNES, set, method

Location: src/snes/interface/snes.c
SNES Index
Table of Contents