petsc-master 2020-08-25
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 SNESReasonView
DMAdaptorDestroy SNESANDERSON SNESResetFromOptions
DMAdaptorSetFromOptions SNESConvergedReason SNESSetFromOptions
DMAdaptorSetUp SNESCreate SNESSetFunction
DMAdaptorView SNESDestroy SNESSetJacobian
DMDASNESSetFunctionLocal SNESFASType SNESSetSolution
DMDASNESSetJacobianLocal SNESGetKSP SNESSolve
DMDASNESSetObjectiveLocal SNESGetLineSearch SNESType
DMDASNESSetPicardLocal SNESKSPONLY SNESVINEWTONRSLS
DMInterpolationCreate SNESKSPTRANSPOSEONLY SNESVINEWTONSSLS
DMInterpolationDestroy SNESLineSearch SNESView
DMInterpolationEvaluate SNESLineSearchType SNES_CONERGED_ITERATING
DMSNESGetFunctionLocal SNESMS SNES_CONVERGED_FNORM_ABS
DMSNESGetJacobianLocal SNESMSGetType SNES_CONVERGED_FNORM_RELATIVE
DMSNESSetFunctionLocal SNESMSSetType SNES_CONVERGED_SNORM_RELATIVE
DMSNESSetJacobianLocal SNESNCG SNES_DIVERGED_DTOL
PetscConvEstCreate SNESNEWTONLS SNES_DIVERGED_FNORM_NAN
PetscConvEstDestroy SNESNGMRES SNES_DIVERGED_FUNCTION_COUNT
PetscConvEstSetFromOptions SNESNRICHARDSON SNES_DIVERGED_LINE_SEARCH
PetscConvEstSetUp SNESQN SNES_DIVERGED_LOCAL_MIN
PetscConvEstView SNESQNSetType SNES_DIVERGED_MAX_IT
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 SNESLineSearchGetType SNESNewtonTRGetPreCheck
KSPMonitorSNES SNESLineSearchMonitorCancel SNESNewtonTRSetPostCheck
KSPMonitorSNESLGResidualNormCreate SNESLineSearchMonitorSet SNESNewtonTRSetPreCheck
KSPMonitorSNESLGResidualNormDestroy SNESLineSearchMonitorSolutionUpdate SNESPATCH
PetscConvEstGetConvRate SNESLineSearchReason SNESPythonSetType
PetscConvEstGetSolver SNESLineSearchSetComputeNorms SNESQNSetRestartType
PetscConvEstMonitorDefault SNESLineSearchSetDamping SNESQNSetScaleType
PetscConvEstSetSolver SNESLineSearchSetDefaultMonitor SNESReasonViewFromOptions
SNESASPIN SNESLineSearchSetFromOptions SNESReset
SNESCOMPOSITE SNESLineSearchSetOrder SNESSetApplicationContext
SNESComputeJacobianDefault SNESLineSearchSetPostCheck SNESSetComputeApplicationContext
SNESComputeJacobianDefaultColor SNESLineSearchSetPreCheck SNESSetComputeInitialGuess
SNESConvergedDefault SNESLineSearchSetTolerances SNESSetConvergedReason
SNESConvergenceTestFunction SNESLineSearchSetType SNESSetConvergenceHistory
SNESFunction SNESLineSearchView SNESSetDM
SNESGetApplicationContext SNESLoad SNESSetDivergenceTolerance
SNESGetConvergedReason SNESMSType SNESSetErrorIfNotConverged
SNESGetConvergenceHistory SNESMonitorCancel SNESSetForceIteration
SNESGetDM SNESMonitorDefault SNESSetGridSequence
SNESGetDivergenceTolerance SNESMonitorDefaultField SNESSetLagJacobian
SNESGetErrorIfNotConverged SNESMonitorFields SNESSetLagPreconditioner
SNESGetForceIteration SNESMonitorRange SNESSetMaxLinearSolveFailures
SNESGetGridSequence SNESMonitorRatio SNESSetMaxNonlinearStepFailures
SNESGetIterationNumber SNESMonitorRatioSetUp SNESSetNGS
SNESGetLagJacobian SNESMonitorResidual SNESSetNPCSide
SNESGetLagPreconditioner SNESMonitorScaling SNESSetObjective
SNESGetLinearSolveFailures SNESMonitorSet SNESSetPicard
SNESGetLinearSolveIterations SNESMonitorSolution SNESSetTolerances
SNESGetMaxLinearSolveFailures SNESMonitorSolutionUpdate SNESSetTrustRegionTolerance
SNESGetMaxNonlinearStepFailures SNESNASMGetDamping SNESSetType
SNESGetNPCSide SNESNASMGetNumber SNESSetUseMatrixFree
SNESGetNonlinearStepFailures SNESNASMGetSNES SNESViewFromOptions
SNESGetNumberFunctionEvals SNESNASMGetSubdomains
SNESGetRhs SNESNASMGetType
Advanced - Setting more advanced options and customization
DMSNESGetFunction SNESGetSolutionUpdate SNESMatrixFreeCreate2
DMSNESGetJacobian SNESKSPGetParametersEW SNESMonitorFunction
DMSNESGetNGS SNESKSPGetUseEW SNESMonitorSAWs
DMSNESGetObjective SNESKSPSetParametersEW SNESNASM
DMSNESGetPicard SNESKSPSetUseEW SNESNGS
DMSNESSetFunction SNESLINESEARCHBASIC SNESNormSchedule
DMSNESSetJacobian SNESLINESEARCHBT SNESObjectiveComputeFunctionDefaultFD
DMSNESSetNGS SNESLINESEARCHCP SNESObjectiveFunction
DMSNESSetObjective SNESLINESEARCHL2 SNESRegister
DMSNESSetPicard SNESLINESEARCHNCGLINEAR SNESRegisterAll
MatCreateSNESMF SNESLINESEARCHNLEQERR SNESSHELL
MatSNESMFGetReuseBase SNESLINESEARCHSHELL SNESSetAlwaysComputesFinalResidual
MatSNESMFGetSNES SNESLineSearchAppendOptionsPrefix SNESSetCheckJacobianDomainError
MatSNESMFSetReuseBase SNESLineSearchGetDamping SNESSetConvergenceTest
SNESAppendOptionsPrefix SNESLineSearchGetLambda SNESSetFunctionDomainError
SNESComputeObjective SNESLineSearchGetOptionsPrefix SNESSetJacobianDomainError
SNESConvergedSkip SNESLineSearchGetVecs SNESSetOptionsPrefix
SNESDefaultMatrixFreeSetParameters2 SNESLineSearchPreCheckPicard SNESSetUp
SNESFunctionType SNESLineSearchRegister SNESSetUpdate
SNESGetAlwaysComputesFinalResidual SNESLineSearchRegisterAll SNESShellGetContext
SNESGetCheckJacobianDomainError SNESLineSearchSetLambda SNESShellSetContext
SNESGetFunction SNESLineSearchSetNorms SNESShellSetSolve
SNESGetFunctionDomainError SNESLineSearchSetUp SNESVISetComputeVariableBounds
SNESGetFunctionType SNESLineSearchSetVecs SNESVISetVariableBounds
SNESGetJacobian SNESLineSearchShellGetUserFunc SNES_NORM_ALWAYS
SNESGetJacobianDomainError SNESLineSearchShellSetUserFunc SNES_NORM_FINAL_ONLY
SNESGetNGS SNESMSGetDamping SNES_NORM_INITIAL_FINAL_ONLY
SNESGetNormSchedule SNESMSRegister SNES_NORM_INITIAL_ONLY
SNESGetObjective SNESMSRegisterAll SNES_NORM_NONE
SNESGetOptionsPrefix SNESMSRegisterDestroy
SNESGetPicard SNESMSSetDamping
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 SNESNASMGetSubdomainVecs
DMPlexSetSNESLocalFEM SNESHasNPC SNESNASMSetComputeFinalJacobian
DMSNESCheckDiscretization SNESInitializePackage SNESNewtonTRPostCheck
DMSNESCheckFromOptions SNESLineSearchCreate SNESNewtonTRPreCheck
DMSNESCheckJacobian SNESLineSearchDestroy SNESSetCountersReset
DMSNESCheckResidual SNESLineSearchGetNorms SNESSetFunctionNorm
DMSNESCopy SNESLineSearchGetSNES SNESSetFunctionType
MatMFFDComputeJacobian SNESLineSearchGetVIFunctions SNESSetInitialFunction
PetscConvEstRateView SNESLineSearchMonitor SNESSetIterationNumber
SNESAddOptionsChecker SNESLineSearchMonitorSetFromOptions SNESSetKSP
SNESApplyNPC SNESLineSearchPostCheck SNESSetLagJacobianPersists
SNESCompositeAddSNES SNESLineSearchPreCheck SNESSetLagPreconditionerPersists
SNESCompositeGetNumber SNESLineSearchReset SNESSetLineSearch
SNESCompositeGetSNES SNESLineSearchSetFunction SNESSetNPC
SNESCompositeSetDamping SNESLineSearchSetReason SNESSetNormSchedule
SNESCompositeSetType SNESLineSearchSetSNES SNESSetUpMatrices
SNESComputeFunction SNESLineSearchSetVIFunctions SNESSetWorkVecs
SNESComputeJacobian SNESLineSearchSetWorkVecs
No deprecated routines

Table of Contents