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_PNORM_RELATIVE
SNESConvergedReason SNESSetJacobian SNES_DIVERGED_FNORM_NAN
SNESCreate SNESSolve SNES_DIVERGED_FUNCTION_COUNT
SNESDestroy SNESType SNES_DIVERGED_LOCAL_MIN
SNESGetKSP SNESView SNES_DIVERGED_LS_FAILURE
SNESLS SNES_CONERGED_ITERATING SNES_DIVERGED_MAX_IT
SNESPICARD SNES_CONVERGED_FNORM_ABS
SNESSetFromOptions SNES_CONVERGED_FNORM_RELATIVE
Intermediate - Setting options for algorithms and data structures
SNESDefaultComputeJacobian SNESGetNonlinearStepFailures SNESMonitorSetRatio
SNESDefaultComputeJacobianColor SNESGetNumberFunctionEvals SNESMonitorSolution
SNESDefaultConverged SNESGetRhs SNESMonitorSolutionUpdate
SNESDefaultUpdate SNESGetSolution SNESSetApplicationContext
SNESGetApplicationContext SNESGetTolerances SNESSetConvergenceHistory
SNESGetConvergedReason SNESGetType SNESSetMaxLinearSolveFailures
SNESGetConvergenceHistory SNESLineSearchGetParams SNESSetMaxNonlinearStepFailures
SNESGetFunctionNorm SNESLineSearchSetParams SNESSetTolerances
SNESGetIterationNumber SNESMonitorCancel SNESSetTrustRegionTolerance
SNESGetLinearSolveFailures SNESMonitorDefault SNESSetType
SNESGetLinearSolveIterations SNESMonitorRatio SNESSetUpdate
SNESGetMaxLinearSolveFailures SNESMonitorResidual SNESTEST
SNESGetMaxNonlinearStepFailures SNESMonitorSet SNESTR
Advanced - Setting more advanced options and customization
SNESAppendOptionsPrefix SNESKSPSetUseEW SNESRegister
SNESDefaultMatrixFreeSetParameters2 SNESLineSearchCubic SNESRegisterAll
SNESGetFunction SNESLineSearchNo SNESRegisterDestroy
SNESGetJacobian SNESLineSearchNoNorms SNESRegisterDynamic
SNESGetOptionsPrefix SNESLineSearchQuadratic SNESSetConvergenceTest
SNESGetSolutionUpdate SNESLineSearchSet SNESSetFunctionDomainError
SNESKSPGetParametersEW SNESLineSearchSetPostCheck SNESSetOptionsPrefix
SNESKSPGetUseEW SNESLineSearchSetPreCheck SNESSetUp
SNESKSPSetParametersEW SNESMatrixFreeCreate2 SNESSkipConverged
Developer - Interfaces intended primarily for library developers, not for typical applications programmers
SNESAddOptionsChecker SNESComputeJacobian SNESSetKSP
SNESComputeFunction SNESInitializePackage
No deprecated routines

Table of Contents