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_LINE_SEARCH SNESSetFromOptions
SNES_CONVERGED_FNORM_ABS SNES_DIVERGED_LOCAL_MIN SNESSetFunction
SNES_CONVERGED_FNORM_RELATIVE SNES_DIVERGED_MAX_IT SNESSetJacobian
SNES_CONVERGED_PNORM_RELATIVE SNESGetKSP SNESSolve
SNESConvergedReason SNES SNESSORQN
SNESCreate SNESKSPONLY SNESType
SNESDestroy SNESLS SNESView
SNES_DIVERGED_FNORM_NAN SNESNGMRES SNESVI
SNES_DIVERGED_FUNCTION_COUNT SNESPICARD
Intermediate - Setting options for algorithms and data structures
SNESDAComputeJacobianWithAdic SNESGetNonlinearStepFailures SNESPythonSetType
SNESDefaultComputeJacobianColor SNESGetNumberFunctionEvals SNESReset
SNESDefaultComputeJacobian 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 SNESRegister
SNESAppendOptionsPrefix SNESLineSearchNo SNESSetConvergenceTest
SNESDefaultMatrixFreeSetParameters2 SNESLineSearchNoNorms SNESSetFunctionDomainError
SNESGetFunction SNESLineSearchQuadratic SNESSetOptionsPrefix
SNESGetJacobian SNESLineSearchSet SNESSetUpdate
SNESGetOptionsPrefix SNESLineSearchSetPostCheck SNESSetUp
SNESGetSolutionUpdate SNESLineSearchSetPreCheck SNESSkipConverged
SNESKSPGetParametersEW SNESMatrixFreeCreate2 SNESVISetComputeVariableBounds
SNESKSPGetUseEW SNESRegisterAll SNESVISetVariableBounds
SNESKSPSetParametersEW SNESRegisterDestroy
SNESKSPSetUseEW SNESRegisterDynamic
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