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 SNESGetSLES SNESSetJacobian
SNESConvergedReason SNESProblemType SNESSetMinimizationFunction
SNESCreate SNESSetFromOptions SNESSolve
SNESDefaultRhsBC SNESSetFunction SNESType
SNESDefaultSolutionBC SNESSetGradient SNESView
SNESDestroy SNESSetHessian
Intermediate - Setting options for algorithms and data structures
DMMGSetSNESLocal SNESGetConvergedReason SNESSetLineSearchParams
SNESClearMonitor SNESGetConvergenceHistory SNESSetMaximumUnsuccessfulSteps
SNESConverged_EQ_LS SNESGetFunctionNorm SNESSetMinimizationFunctionTolerance
SNESConverged_EQ_TR SNESGetGradientNorm SNESSetMonitor
SNESConverged_UM_LS SNESGetIterationNumber SNESSetRatioMonitor
SNESConverged_UM_TR SNESGetLineSearchParams SNESSetRhsBC
SNESDAComputeJacobianWithAdic SNESGetMaximumUnsuccessfulSteps SNESSetSolutionBC
SNESDAFormFunction SNESGetNumberLinearIterations SNESSetTolerances
SNESDefaultComputeHessian SNESGetNumberUnsuccessfulSteps SNESSetTrustRegionTolerance
SNESDefaultComputeHessianColor SNESGetProblemType SNESSetType
SNESDefaultComputeJacobian SNESGetTolerances SNESSetUpdate
SNESDefaultComputeJacobianColor SNESGetType SNESVecViewMonitor
SNESDefaultMonitor SNESRatioMonitor SNESVecViewUpdateMonitor
SNESDefaultUpdate SNESSetApplicationContext
SNESGetApplicationContext SNESSetConvergenceHistory
Advanced - Setting more advanced options and customization
DMMGSetInitialGuess SNESGetJacobian SNESRegisterDestroy
DMMGSetSNES SNESGetMinimizationFunction SNESRegisterDynamic
PCMultiLevelCubicLineSearch SNESGetOptionsPrefix SNESSetConvergenceTest
PCMultiLevelUpdateSNES 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
SNESAddOptionsChecker SNESComputeHessian SNESInitializePackage
SNESComputeFunction SNESComputeJacobian
SNESComputeGradient SNESComputeMinimizationFunction

Table of Contents