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 KSP for the solution of its linear systems. SNES users can also set KSP options directly in application codes by first extracting the KSP context from the SNES context via SNESGetKSP() and then directly calling various KSP (and KSP and PC) routines (e.g., PCSetType() ).

Beginner - Basic usage
SNES SNESSetFunction SNES_CONVERGED_FNORM_RELATIVE
SNESConvergedReason SNESSetJacobian SNES_CONVERGED_PNORM_RELATIVE
SNESCreate SNESSolve SNES_DIVERGED_FNORM_NAN
SNESDestroy SNESType SNES_DIVERGED_FUNCTION_COUNT
SNESGetKSP SNESView SNES_DIVERGED_LOCAL_MIN
SNESLS SNES_CONERGED_ITERATING SNES_DIVERGED_LS_FAILURE
SNESSetFromOptions SNES_CONVERGED_FNORM_ABS SNES_DIVERGED_MAX_IT
Intermediate - Setting options for algorithms and data structures
SNESClearMonitor SNESGetNumberLinearIterations SNESSetRatioMonitor
SNESConverged_LS SNESGetNumberUnsuccessfulSteps SNESSetRhs
SNESConverged_TR SNESGetRhs SNESSetSolution
SNESDefaultComputeJacobian SNESGetSolution SNESSetTolerances
SNESDefaultComputeJacobianColor SNESGetTolerances SNESSetTrustRegionTolerance
SNESDefaultMonitor SNESGetType SNESSetType
SNESDefaultUpdate SNESLineSearchGetParams SNESSetUpdate
SNESGetApplicationContext SNESLineSearchSetParams SNESTR
SNESGetConvergedReason SNESRatioMonitor SNESVecViewMonitor
SNESGetConvergenceHistory SNESSetApplicationContext SNESVecViewResidualMonitor
SNESGetFunctionNorm SNESSetConvergenceHistory SNESVecViewUpdateMonitor
SNESGetIterationNumber SNESSetMaximumUnsuccessfulSteps
SNESGetMaximumUnsuccessfulSteps SNESSetMonitor
Advanced - Setting more advanced options and customization
SNESAppendOptionsPrefix SNESLineSearchNoNorms SNESRegisterDestroy
SNESDefaultMatrixFreeSetParameters2 SNESLineSearchQuadratic SNESRegisterDynamic
SNESGetFunction SNESLineSearchSet SNESSetConvergenceTest
SNESGetJacobian SNESLineSearchSetPostCheck SNESSetOptionsPrefix
SNESGetOptionsPrefix SNESLineSearchSetPreCheck SNESSetUp
SNESGetSolutionUpdate SNESMatrixFreeCreate2 SNES_KSP_SetConvergenceTestEW
SNESLineSearchCubic SNESRegister SNES_KSP_SetParametersEW
SNESLineSearchNo SNESRegisterAll
Developer - Interfaces intended primarily for library developers, not for typical applications programmers
MatSNESMFRegisterDynamic SNESComputeFunction SNESInitializePackage
SNESAddOptionsChecker SNESComputeJacobian

Table of Contents