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

Table of Contents