petsc-master 2017-05-22
Report Typos and Errors

Nonlinear solvers - SNES: Examples

The Scalable Nonlinear Equations Solvers (SNES) component provides an easy-to-use interface to Newton-type, quasi-Newton, full approximation scheme (FAS) multigrid, and other 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 PC) routines (e.g., PCSetType() ).

Beginner - Basic usage
DMDASNESSetFunctionLocal SNESLineSearch SNESSolve
DMDASNESSetJacobianLocal SNESLineSearchType SNESType
DMDASNESSetObjectiveLocal SNESMS SNESVINEWTONRSLS
DMDASNESSetPicardLocal SNESMSSetType SNESVINEWTONSSLS
DMSNESSetFunctionLocal SNESNCG SNESView
DMSNESSetJacobianLocal SNESNEWTONLS SNES_CONERGED_ITERATING
SNES SNESNGMRES SNES_CONVERGED_FNORM_ABS
SNESANDERSON SNESNRICHARDSON SNES_CONVERGED_FNORM_RELATIVE
SNESConvergedReason SNESQN SNES_CONVERGED_SNORM_RELATIVE
SNESCreate SNESQNSetType SNES_DIVERGED_DTOL
SNESDestroy SNESReasonView SNES_DIVERGED_FNORM_NAN
SNESFASType SNESSetFromOptions SNES_DIVERGED_FUNCTION_COUNT
SNESGetKSP SNESSetFunction SNES_DIVERGED_LINE_SEARCH
SNESGetLineSearch SNESSetJacobian SNES_DIVERGED_LOCAL_MIN
SNESKSPONLY SNESSetSolution SNES_DIVERGED_MAX_IT
Intermediate - Setting options for algorithms and data structures
DMSNESSetBoundaryLocal SNESLineSearchGetOrder SNESNASMSetType
KSPMonitorSNES SNESLineSearchGetPostCheck SNESNCGSetType
KSPMonitorSNESLGResidualNormCreate SNESLineSearchGetPreCheck SNESNEWTONTR
KSPMonitorSNESLGResidualNormDestroy SNESLineSearchGetReason SNESNGMRESSetRestartFmRise
SNESASPIN SNESLineSearchGetTolerances SNESNGMRESSetRestartType
SNESCOMPOSITE SNESLineSearchMonitorCancel SNESNGMRESSetSelectType
SNESComputeJacobianDefault SNESLineSearchMonitorSet SNESNGSFunction
SNESComputeJacobianDefaultColor SNESLineSearchMonitorSolutionUpdate SNESNGSGetSweeps
SNESConvergedDefault SNESLineSearchReason SNESNGSGetTolerances
SNESConvergenceTestFunction SNESLineSearchSetComputeNorms SNESNGSSetSweeps
SNESFunction SNESLineSearchSetDamping SNESNGSSetTolerances
SNESGetApplicationContext SNESLineSearchSetDefaultMonitor SNESPythonSetType
SNESGetConvergedReason SNESLineSearchSetFromOptions SNESQNSetRestartType
SNESGetConvergenceHistory SNESLineSearchSetOrder SNESQNSetScaleType
SNESGetDM SNESLineSearchSetPostCheck SNESReasonViewFromOptions
SNESGetDivergenceTolerance SNESLineSearchSetPreCheck SNESReset
SNESGetErrorIfNotConverged SNESLineSearchSetTolerances SNESSetApplicationContext
SNESGetGridSequence SNESLineSearchSetType SNESSetComputeApplicationContext
SNESGetIterationNumber SNESLineSearchView SNESSetComputeInitialGuess
SNESGetLagJacobian SNESLoad SNESSetConvergedReason
SNESGetLagPreconditioner SNESMSType SNESSetConvergenceHistory
SNESGetLinearSolveFailures SNESMonitorCancel SNESSetDM
SNESGetLinearSolveIterations SNESMonitorDefault SNESSetDivergenceTolerance
SNESGetMaxLinearSolveFailures SNESMonitorDefaultField SNESSetErrorIfNotConverged
SNESGetMaxNonlinearStepFailures SNESMonitorFields SNESSetGridSequence
SNESGetNPCSide SNESMonitorRange SNESSetLagJacobian
SNESGetNonlinearStepFailures SNESMonitorRatio SNESSetLagPreconditioner
SNESGetNumberFunctionEvals SNESMonitorRatioSetUp SNESSetMaxLinearSolveFailures
SNESGetRhs SNESMonitorResidual SNESSetMaxNonlinearStepFailures
SNESGetSolution SNESMonitorSet SNESSetNGS
SNESGetTolerances SNESMonitorSolution SNESSetNPCSide
SNESGetType SNESMonitorSolutionUpdate SNESSetObjective
SNESJacobianFunction SNESNASMGetDamping SNESSetPicard
SNESLineSearchApply SNESNASMGetNumber SNESSetTolerances
SNESLineSearchBTGetAlpha SNESNASMGetSNES SNESSetTrustRegionTolerance
SNESLineSearchBTSetAlpha SNESNASMGetSubdomains SNESSetType
SNESLineSearchComputeNorms SNESNASMGetType SNESTEST
SNESLineSearchDestroy SNESNASMSetDamping SNESUpdateCheckJacobian
SNESLineSearchGetDefaultMonitor SNESNASMSetSubdomains
Advanced - Setting more advanced options and customization
DMSNESGetFunction SNESKSPGetUseEW SNESMatrixFreeCreate2
DMSNESGetJacobian SNESKSPSetParametersEW SNESMonitorFunction
DMSNESGetNGS SNESKSPSetUseEW SNESMonitorSAWs
DMSNESGetObjective SNESLINESEARCHBASIC SNESNASM
DMSNESGetPicard SNESLINESEARCHBT SNESNGS
DMSNESSetFunction SNESLINESEARCHCP SNESNormSchedule
DMSNESSetJacobian SNESLINESEARCHL2 SNESObjectiveComputeFunctionDefaultFD
DMSNESSetNGS SNESLINESEARCHNLEQERR SNESObjectiveFunction
DMSNESSetObjective SNESLINESEARCHSHELL SNESRegister
DMSNESSetPicard SNESLineSearchAppendOptionsPrefix SNESRegisterAll
MatCreateSNESMF SNESLineSearchGetDamping SNESSHELL
SNESAppendOptionsPrefix SNESLineSearchGetLambda SNESSetAlwaysComputesFinalResidual
SNESComputeObjective SNESLineSearchGetOptionsPrefix SNESSetConvergenceTest
SNESConvergedSkip SNESLineSearchGetVecs SNESSetFunctionDomainError
SNESDefaultMatrixFreeSetParameters2 SNESLineSearchPostCheckFunction SNESSetOptionsPrefix
SNESFunctionType SNESLineSearchPreCheckFunction SNESSetUp
SNESGetAlwaysComputesFinalResidual SNESLineSearchPreCheckPicard SNESSetUpdate
SNESGetFunction SNESLineSearchRegister SNESShellGetContext
SNESGetFunctionDomainError SNESLineSearchRegisterAll SNESShellSetContext
SNESGetFunctionType SNESLineSearchSetLambda SNESShellSetSolve
SNESGetJacobian SNESLineSearchSetNorms SNESVISetComputeVariableBounds
SNESGetNGS SNESLineSearchSetUp SNESVISetVariableBounds
SNESGetNormSchedule SNESLineSearchSetVecs SNES_NORM_ALWAYS
SNESGetObjective SNESLineSearchShellGetUserFunc SNES_NORM_FINAL_ONLY
SNESGetOptionsPrefix SNESLineSearchShellSetUserFunc SNES_NORM_INITIAL_FINAL_ONLY
SNESGetPicard SNESMSRegister SNES_NORM_INITIAL_ONLY
SNESGetSolutionUpdate SNESMSRegisterAll SNES_NORM_NONE
SNESKSPGetParametersEW SNESMSRegisterDestroy
Developer - Interfaces intended primarily for library developers, not for typical applications programmers
DMCopyDMSNES SNESCompositeSetDamping SNESLineSearchSetWorkVecs
DMGetDMSNES SNESCompositeSetType SNESMSFinalizePackage
DMGetDMSNESWrite SNESComputeFunction SNESMSInitializePackage
DMPlexGetCellFields SNESComputeJacobian SNESMonitor
DMPlexGetFaceFields SNESComputeNGS SNESMonitorSAWsCreate
DMPlexGetFaceGeometry SNESFinalizePackage SNESMonitorSAWsDestroy
DMPlexRestoreCellFields SNESGetFunctionNorm SNESMonitorSetFromOptions
DMPlexRestoreFaceFields SNESGetNPC SNESNASMGetSubdomainVecs
DMPlexRestoreFaceGeometry SNESGetNPCFunction SNESNASMSetComputeFinalJacobian
DMPlexSNESComputeBoundaryFEM SNESHasNPC SNESSetCountersReset
DMPlexSNESComputeJacobianActionFEM SNESInitializePackage SNESSetFunctionNorm
DMPlexSNESComputeJacobianFEM SNESLineSearchCreate SNESSetFunctionType
DMPlexSNESComputeResidualFEM SNESLineSearchGetNorms SNESSetInitialFunction
DMPlexSNESGetGeometryFEM SNESLineSearchGetSNES SNESSetIterationNumber
DMPlexSNESGetGeometryFVM SNESLineSearchGetVIFunctions SNESSetKSP
DMPlexSNESGetGradientDM SNESLineSearchMonitor SNESSetLagJacobianPersists
DMPlexSetSNESLocalFEM SNESLineSearchMonitorSetFromOptions SNESSetLagPreconditionerPersists
DMSNESCopy SNESLineSearchPostCheck SNESSetLineSearch
MatMFFDComputeJacobian SNESLineSearchPreCheck SNESSetNPC
SNESAddOptionsChecker SNESLineSearchReset SNESSetNormSchedule
SNESApplyNPC SNESLineSearchSetFunction SNESSetUpMatrices
SNESCompositeAddSNES SNESLineSearchSetReason SNESSetWorkVecs
SNESCompositeGetNumber SNESLineSearchSetSNES
SNESCompositeGetSNES SNESLineSearchSetVIFunctions
No deprecated routines

Table of Contents