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

Table of Contents