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 SNESDestroy SNESSolve
SNESConvergedReason SNESGetSLES SNESType
SNESCreate SNESSetFromOptions SNESView
SNESDefaultRhsBC SNESSetFunction
SNESDefaultSolutionBC SNESSetJacobian
Intermediate - Setting options for algorithms and data structures
DMMGSetSNESLocal SNESGetFunctionNorm SNESSetMonitor
SNESClearMonitor SNESGetIterationNumber SNESSetRatioMonitor
SNESConverged_LS SNESGetLineSearchParams SNESSetRhsBC
SNESConverged_TR SNESGetMaximumUnsuccessfulSteps SNESSetSolutionBC
SNESDAComputeJacobianWithAdic SNESGetNumberLinearIterations SNESSetTolerances
SNESDAFormFunction SNESGetNumberUnsuccessfulSteps SNESSetTrustRegionTolerance
SNESDefaultComputeJacobian SNESGetTolerances SNESSetType
SNESDefaultComputeJacobianColor SNESGetType SNESSetUpdate
SNESDefaultMonitor SNESRatioMonitor SNESVecViewMonitor
SNESDefaultUpdate SNESSetApplicationContext SNESVecViewResidualMonitor
SNESGetApplicationContext SNESSetConvergenceHistory SNESVecViewUpdateMonitor
SNESGetConvergedReason SNESSetLineSearchParams
SNESGetConvergenceHistory SNESSetMaximumUnsuccessfulSteps
Advanced - Setting more advanced options and customization
DMMGSetInitialGuess SNESGetOptionsPrefix SNESRegisterDestroy
DMMGSetSNES SNESGetSolution SNESRegisterDynamic
PCMultiLevelCubicLineSearch SNESGetSolutionUpdate SNESSetConvergenceTest
PCMultiLevelUpdateSNES SNESMatrixFreeMatCreate2 SNESSetLineSearch
SNESAppendOptionsPrefix SNESNoLineSearch SNESSetLineSearchCheck
SNESCubicLineSearch SNESNoLineSearchNoNorms SNESSetOptionsPrefix
SNESDefaultMatrixFreeSetParameters2 SNESQuadraticLineSearch SNESSetUp
SNESGetFunction SNESRegister SNES_KSP_SetConvergenceTestEW
SNESGetJacobian SNESRegisterAll SNES_KSP_SetParametersEW
Developer - Interfaces intended primarily for library developers, not for typical applications programmers
SNESAddOptionsChecker SNESComputeJacobian
SNESComputeFunction SNESInitializePackage

Table of Contents