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

Table of Contents