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

Table of Contents