petsc-3.12.5 2020-03-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 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
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 SNESNASMSetDamping
DMAdaptorGetSequenceLength SNESGetTolerances SNESNASMSetSubdomains
DMAdaptorGetSolver SNESGetType SNESNASMSetType
DMAdaptorSetSequenceLength SNESGetUseMatrixFree SNESNASMSetWeight
DMAdaptorSetSolver SNESJacobianFunction SNESNCGSetType
DMInterpolationAddPoints SNESLineSearchApply SNESNEWTONTR
DMInterpolationGetCoordinates SNESLineSearchBTGetAlpha SNESNGMRESSetRestartFmRise
DMInterpolationGetDim SNESLineSearchBTSetAlpha SNESNGMRESSetRestartType
DMInterpolationGetDof SNESLineSearchComputeNorms SNESNGMRESSetSelectType
DMInterpolationGetVector SNESLineSearchGetDefaultMonitor SNESNGSFunction
DMInterpolationRestoreVector SNESLineSearchGetOrder SNESNGSGetSweeps
DMInterpolationSetDim SNESLineSearchGetPostCheck SNESNGSGetTolerances
DMInterpolationSetDof SNESLineSearchGetPreCheck SNESNGSSetSweeps
DMInterpolationSetUp SNESLineSearchGetReason SNESNGSSetTolerances
DMSNESGetBoundaryLocal SNESLineSearchGetTolerances SNESNewtonTRGetPostCheck
DMSNESSetBoundaryLocal SNESLineSearchMonitorCancel SNESNewtonTRGetPreCheck
KSPMonitorSNES SNESLineSearchMonitorSet SNESNewtonTRSetPostCheck
KSPMonitorSNESLGResidualNormCreate SNESLineSearchMonitorSolutionUpdate SNESNewtonTRSetPreCheck
KSPMonitorSNESLGResidualNormDestroy SNESLineSearchReason SNESPATCH
PetscConvEstGetConvRate SNESLineSearchSetComputeNorms SNESPythonSetType
PetscConvEstGetSolver SNESLineSearchSetDamping SNESQNSetRestartType
PetscConvEstSetSolver SNESLineSearchSetDefaultMonitor SNESQNSetScaleType
SNESASPIN SNESLineSearchSetFromOptions SNESReasonViewFromOptions
SNESCOMPOSITE SNESLineSearchSetOrder SNESReset
SNESComputeJacobianDefault SNESLineSearchSetPostCheck SNESSetApplicationContext
SNESComputeJacobianDefaultColor SNESLineSearchSetPreCheck SNESSetComputeApplicationContext
SNESConvergedDefault SNESLineSearchSetTolerances SNESSetComputeInitialGuess
SNESConvergenceTestFunction SNESLineSearchSetType SNESSetConvergedReason
SNESFunction SNESLineSearchView SNESSetConvergenceHistory
SNESGetApplicationContext SNESLoad SNESSetDM
SNESGetConvergedReason SNESMSType SNESSetDivergenceTolerance
SNESGetConvergenceHistory SNESMonitorCancel SNESSetErrorIfNotConverged
SNESGetDM SNESMonitorDefault SNESSetForceIteration
SNESGetDivergenceTolerance SNESMonitorDefaultField SNESSetGridSequence
SNESGetErrorIfNotConverged SNESMonitorFields SNESSetLagJacobian
SNESGetForceIteration SNESMonitorRange SNESSetLagPreconditioner
SNESGetGridSequence SNESMonitorRatio SNESSetMaxLinearSolveFailures
SNESGetIterationNumber SNESMonitorRatioSetUp SNESSetMaxNonlinearStepFailures
SNESGetLagJacobian SNESMonitorResidual SNESSetNGS
SNESGetLagPreconditioner SNESMonitorScaling SNESSetNPCSide
SNESGetLinearSolveFailures SNESMonitorSet SNESSetObjective
SNESGetLinearSolveIterations SNESMonitorSolution SNESSetPicard
SNESGetMaxLinearSolveFailures SNESMonitorSolutionUpdate SNESSetTolerances
SNESGetMaxNonlinearStepFailures SNESNASMGetDamping SNESSetTrustRegionTolerance
SNESGetNPCSide SNESNASMGetNumber SNESSetType
SNESGetNonlinearStepFailures SNESNASMGetSNES SNESSetUseMatrixFree
SNESGetNumberFunctionEvals SNESNASMGetSubdomains
SNESGetRhs SNESNASMGetType
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