petsc-master 2019-08-18
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 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
DMSNESSetBoundaryLocal SNESLineSearchGetTolerances SNESNGSSetTolerances
KSPMonitorSNES SNESLineSearchMonitorCancel SNESNewtonTRGetPostCheck
KSPMonitorSNESLGResidualNormCreate SNESLineSearchMonitorSet SNESNewtonTRSetPostCheck
KSPMonitorSNESLGResidualNormDestroy SNESLineSearchMonitorSolutionUpdate SNESPATCH
PetscConvEstGetConvRate SNESLineSearchReason SNESPythonSetType
PetscConvEstGetSolver SNESLineSearchSetComputeNorms SNESQNSetRestartType
PetscConvEstSetSolver SNESLineSearchSetDamping SNESQNSetScaleType
SNESASPIN SNESLineSearchSetDefaultMonitor SNESReasonViewFromOptions
SNESCOMPOSITE SNESLineSearchSetFromOptions SNESReset
SNESComputeJacobianDefault SNESLineSearchSetOrder SNESSetApplicationContext
SNESComputeJacobianDefaultColor SNESLineSearchSetPostCheck SNESSetComputeApplicationContext
SNESConvergedDefault SNESLineSearchSetPreCheck SNESSetComputeInitialGuess
SNESConvergenceTestFunction SNESLineSearchSetTolerances SNESSetConvergedReason
SNESFunction SNESLineSearchSetType SNESSetConvergenceHistory
SNESGetApplicationContext SNESLineSearchView SNESSetDM
SNESGetConvergedReason SNESLoad SNESSetDivergenceTolerance
SNESGetConvergenceHistory SNESMSType SNESSetErrorIfNotConverged
SNESGetDM SNESMonitorCancel SNESSetForceIteration
SNESGetDivergenceTolerance SNESMonitorDefault SNESSetGridSequence
SNESGetErrorIfNotConverged SNESMonitorDefaultField SNESSetLagJacobian
SNESGetForceIteration SNESMonitorFields SNESSetLagPreconditioner
SNESGetGridSequence SNESMonitorRange SNESSetMaxLinearSolveFailures
SNESGetIterationNumber SNESMonitorRatio SNESSetMaxNonlinearStepFailures
SNESGetLagJacobian SNESMonitorRatioSetUp SNESSetNGS
SNESGetLagPreconditioner SNESMonitorResidual SNESSetNPCSide
SNESGetLinearSolveFailures SNESMonitorScaling SNESSetObjective
SNESGetLinearSolveIterations SNESMonitorSet SNESSetPicard
SNESGetMaxLinearSolveFailures SNESMonitorSolution SNESSetTolerances
SNESGetMaxNonlinearStepFailures SNESMonitorSolutionUpdate SNESSetTrustRegionTolerance
SNESGetNPCSide SNESNASMGetDamping SNESSetType
SNESGetNonlinearStepFailures SNESNASMGetNumber SNESSetUseMatrixFree
SNESGetNumberFunctionEvals SNESNASMGetSNES
SNESGetRhs SNESNASMGetSubdomains
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 SNESComputeFunction SNESLineSearchSetVIFunctions
DMGetDMSNES SNESComputeJacobian SNESLineSearchSetWorkVecs
DMGetDMSNESWrite SNESComputeNGS SNESMSFinalizePackage
DMPlexComputeJacobianAction SNESFinalizePackage SNESMSInitializePackage
DMPlexSNESComputeBoundaryFEM SNESGetFunctionNorm SNESMonitor
DMPlexSNESComputeJacobianFEM SNESGetNPC SNESMonitorSAWsCreate
DMPlexSNESComputeResidualFEM SNESGetNPCFunction SNESMonitorSAWsDestroy
DMPlexSNESGetGeometryFVM SNESGetSolutionNorm SNESMonitorSetFromOptions
DMPlexSNESGetGradientDM SNESGetUpdateNorm SNESNASMGetSubdomainVecs
DMPlexSetSNESLocalFEM SNESHasNPC SNESNASMSetComputeFinalJacobian
DMSNESCheckDiscretization SNESInitializePackage SNESNewtonTRPostCheck
DMSNESCheckFromOptions SNESLineSearchCreate SNESSetCountersReset
DMSNESCheckJacobian SNESLineSearchDestroy SNESSetFunctionNorm
DMSNESCheckResidual SNESLineSearchGetNorms SNESSetFunctionType
DMSNESCopy SNESLineSearchGetSNES SNESSetInitialFunction
MatMFFDComputeJacobian SNESLineSearchGetVIFunctions SNESSetIterationNumber
PetscConvEstRateView SNESLineSearchMonitor SNESSetKSP
SNESAddOptionsChecker SNESLineSearchMonitorSetFromOptions SNESSetLagJacobianPersists
SNESApplyNPC SNESLineSearchPostCheck SNESSetLagPreconditionerPersists
SNESCompositeAddSNES SNESLineSearchPreCheck SNESSetLineSearch
SNESCompositeGetNumber SNESLineSearchReset SNESSetNPC
SNESCompositeGetSNES SNESLineSearchSetFunction SNESSetNormSchedule
SNESCompositeSetDamping SNESLineSearchSetReason SNESSetUpMatrices
SNESCompositeSetType SNESLineSearchSetSNES SNESSetWorkVecs
No deprecated routines

Table of Contents