Nonlinear solvers - SNES: Examples

The Scalable Nonlinear Equations Solvers (SNES) component provides an easy-to-use interface to Newton-based methods for solving systems of nonlinear equations. SNES users can set various algorithmic options at runtime via the options database (e.g., specifying a trust region method via -snes_type tr ). SNES internally employs SLES for the solution of its linear systems. SNES users can also set SLES options directly in application codes by first extracting the SLES context from the SNES context via SNESGetSLES() and then directly calling various SLES (and KSP and PC) routines (e.g., PCSetType() ).

Beginner - Basic usage
SNES SNESProblemType SNESSetJacobian
SNESConvergedReason SNESSetFromOptions SNESSetMinimizationFunction
SNESCreate SNESSetFunction SNESSolve
SNESDestroy SNESSetGradient SNESType
SNESGetSLES SNESSetHessian SNESView
Intermediate - Setting options for algorithms and data structures
SNESClearMonitor SNESGetConvergedReason SNESSetConvergenceHistory
SNESConverged_EQ_LS SNESGetConvergenceHistory SNESSetLineSearchParams
SNESConverged_EQ_TR SNESGetFunctionNorm SNESSetMinimizationFunctionTolerance
SNESConverged_UM_LS SNESGetGradientNorm SNESSetMonitor
SNESConverged_UM_TR SNESGetIterationNumber SNESSetTolerances
SNESDefaultComputeHessian SNESGetLineSearchParams SNESSetTrustRegionTolerance
SNESDefaultComputeHessianColor SNESGetNumberLinearIterations SNESSetType
SNESDefaultComputeJacobian SNESGetNumberUnsuccessfulSteps SNESVecViewMonitor
SNESDefaultComputeJacobianColor SNESGetTolerances SNESVecViewUpdateMonitor
SNESDefaultMonitor SNESGetType
SNESGetApplicationContext SNESSetApplicationContext
Advanced - Setting more advanced options and customization
DMMGSetInitialGuess SNESGetJacobian SNESRegisterDestroy
DMMGSetSNES SNESGetMinimizationFunction SNESRegisterDynamic
DMMGSetSNESLocal SNESGetOptionsPrefix SNESSetConvergenceTest
DMMGSetSNESLocalWithAD SNESGetSolution SNESSetLineSearch
SNESAppendOptionsPrefix SNESGetSolutionUpdate SNESSetLineSearchCheck
SNESCubicLineSearch SNESNoLineSearch SNESSetOptionsPrefix
SNESGetFunction SNESNoLineSearchNoNorms SNESSetUp
SNESGetGradient SNESQuadraticLineSearch SNES_KSP_SetConvergenceTestEW
SNESGetHessian SNESRegisterAll SNES_KSP_SetParametersEW
Developer - Interfaces intended primarily for library developers, not for typical applications programmers
SNESComputeFunction SNESComputeHessian SNESComputeMinimizationFunction
SNESComputeGradient SNESComputeJacobian

Table of Contents