petsc-master 2017-01-23
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 SNESLineSearchGetDefaultMonitor SNESNASMSetType
KSPMonitorSNES SNESLineSearchGetOrder SNESNCGSetType
KSPMonitorSNESLGResidualNormCreate SNESLineSearchGetPostCheck SNESNEWTONTR
KSPMonitorSNESLGResidualNormDestroy SNESLineSearchGetPreCheck SNESNGMRESSetRestartFmRise
SNESASPIN SNESLineSearchGetReason SNESNGMRESSetRestartType
SNESCOMPOSITE SNESLineSearchGetTolerances SNESNGMRESSetSelectType
SNESComputeJacobianDefault SNESLineSearchMonitorCancel SNESNGSFunction
SNESComputeJacobianDefaultColor SNESLineSearchMonitorSet SNESNGSGetSweeps
SNESConvergedDefault SNESLineSearchMonitorSolutionUpdate SNESNGSGetTolerances
SNESConvergenceTestFunction SNESLineSearchReason SNESNGSSetSweeps
SNESFunction SNESLineSearchSetComputeNorms SNESNGSSetTolerances
SNESGetApplicationContext SNESLineSearchSetDamping SNESPythonSetType
SNESGetConvergedReason SNESLineSearchSetDefaultMonitor SNESQNSetRestartType
SNESGetConvergenceHistory SNESLineSearchSetFromOptions SNESQNSetScaleType
SNESGetDM SNESLineSearchSetOrder SNESReasonViewFromOptions
SNESGetDivergenceTolerance SNESLineSearchSetPostCheck SNESReset
SNESGetErrorIfNotConverged SNESLineSearchSetPreCheck SNESSetApplicationContext
SNESGetGridSequence SNESLineSearchSetTolerances SNESSetComputeApplicationContext
SNESGetIterationNumber SNESLineSearchSetType SNESSetComputeInitialGuess
SNESGetLagJacobian SNESLineSearchView SNESSetConvergedReason
SNESGetLagPreconditioner SNESLoad SNESSetConvergenceHistory
SNESGetLinearSolveFailures SNESMSType SNESSetDM
SNESGetLinearSolveIterations SNESMonitorCancel SNESSetDivergenceTolerance
SNESGetMaxLinearSolveFailures SNESMonitorDefault SNESSetErrorIfNotConverged
SNESGetMaxNonlinearStepFailures SNESMonitorDefaultField SNESSetGridSequence
SNESGetNPCSide SNESMonitorFields SNESSetLagJacobian
SNESGetNonlinearStepFailures SNESMonitorRange SNESSetLagPreconditioner
SNESGetNumberFunctionEvals SNESMonitorRatio SNESSetMaxLinearSolveFailures
SNESGetRhs SNESMonitorRatioSetUp SNESSetMaxNonlinearStepFailures
SNESGetSolution SNESMonitorResidual SNESSetNGS
SNESGetTolerances SNESMonitorSet SNESSetNPCSide
SNESGetType SNESMonitorSolution SNESSetObjective
SNESJacobianFunction SNESMonitorSolutionUpdate SNESSetPicard
SNESLineSearchApply SNESNASMGetDamping SNESSetTolerances
SNESLineSearchBTGetAlpha SNESNASMGetSubdomains SNESSetTrustRegionTolerance
SNESLineSearchBTSetAlpha SNESNASMGetType SNESSetType
SNESLineSearchComputeNorms SNESNASMSetDamping SNESTEST
SNESLineSearchDestroy SNESNASMSetSubdomains SNESUpdateCheckJacobian
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