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

Table of Contents