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

Table of Contents