petsc-master 2020-09-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 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 SNESQNSetType
DMAdaptorDestroy SNESANDERSON SNESResetFromOptions
DMAdaptorSetFromOptions SNESConvergedReason SNESSetFromOptions
DMAdaptorSetUp SNESConvergedReasonView SNESSetFunction
DMAdaptorView SNESCreate SNESSetJacobian
DMDASNESSetFunctionLocal SNESDestroy SNESSetSolution
DMDASNESSetJacobianLocal SNESFASType 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 SNESNCG SNES_DIVERGED_FNORM_NAN
PetscConvEstDestroy SNESNEWTONLS SNES_DIVERGED_FUNCTION_COUNT
PetscConvEstSetFromOptions SNESNGMRES SNES_DIVERGED_LINE_SEARCH
PetscConvEstSetUp SNESNRICHARDSON SNES_DIVERGED_LOCAL_MIN
PetscConvEstView SNESQN SNES_DIVERGED_MAX_IT
Intermediate - Setting options for algorithms and data structures
DMAdaptorAdapt SNESGetRhs SNESNASMGetType
DMAdaptorGetSequenceLength SNESGetSolution SNESNASMSetDamping
DMAdaptorGetSolver SNESGetTolerances SNESNASMSetSubdomains
DMAdaptorSetSequenceLength SNESGetType SNESNASMSetType
DMAdaptorSetSolver SNESGetUseMatrixFree SNESNASMSetWeight
DMInterpolationAddPoints SNESJacobianFunction SNESNCGSetType
DMInterpolationGetCoordinates SNESLineSearchApply SNESNEWTONTR
DMInterpolationGetDim SNESLineSearchBTGetAlpha SNESNGMRESSetRestartFmRise
DMInterpolationGetDof SNESLineSearchBTSetAlpha SNESNGMRESSetRestartType
DMInterpolationGetVector SNESLineSearchComputeNorms SNESNGMRESSetSelectType
DMInterpolationRestoreVector SNESLineSearchGetDefaultMonitor SNESNGSFunction
DMInterpolationSetDim SNESLineSearchGetOrder SNESNGSGetSweeps
DMInterpolationSetDof SNESLineSearchGetPostCheck SNESNGSGetTolerances
DMInterpolationSetUp SNESLineSearchGetPreCheck SNESNGSSetSweeps
DMSNESGetBoundaryLocal SNESLineSearchGetReason SNESNGSSetTolerances
DMSNESSetBoundaryLocal SNESLineSearchGetTolerances SNESNewtonTRGetPostCheck
KSPMonitorSNES SNESLineSearchGetType SNESNewtonTRGetPreCheck
KSPMonitorSNESLGResidualNormCreate SNESLineSearchMonitorCancel SNESNewtonTRSetPostCheck
KSPMonitorSNESLGResidualNormDestroy SNESLineSearchMonitorSet SNESNewtonTRSetPreCheck
PetscConvEstGetConvRate SNESLineSearchMonitorSolutionUpdate SNESPATCH
PetscConvEstGetSolver SNESLineSearchReason SNESPythonSetType
PetscConvEstMonitorDefault SNESLineSearchSetComputeNorms SNESQNSetRestartType
PetscConvEstSetSolver SNESLineSearchSetDamping SNESQNSetScaleType
SNESASPIN SNESLineSearchSetDefaultMonitor SNESReset
SNESCOMPOSITE SNESLineSearchSetFromOptions SNESSetApplicationContext
SNESComputeJacobianDefault SNESLineSearchSetOrder SNESSetComputeApplicationContext
SNESComputeJacobianDefaultColor SNESLineSearchSetPostCheck SNESSetComputeInitialGuess
SNESConvergedDefault SNESLineSearchSetPreCheck SNESSetConvergedReason
SNESConvergedReasonViewFromOptions SNESLineSearchSetTolerances SNESSetConvergenceHistory
SNESConvergenceTestFunction SNESLineSearchSetType SNESSetDM
SNESFunction SNESLineSearchView SNESSetDivergenceTolerance
SNESGetApplicationContext SNESLoad SNESSetErrorIfNotConverged
SNESGetConvergedReason SNESMSType SNESSetForceIteration
SNESGetConvergenceHistory SNESMonitorCancel SNESSetGridSequence
SNESGetDM SNESMonitorDefault SNESSetLagJacobian
SNESGetDivergenceTolerance SNESMonitorDefaultField SNESSetLagPreconditioner
SNESGetErrorIfNotConverged SNESMonitorFields SNESSetMaxLinearSolveFailures
SNESGetForceIteration SNESMonitorRange SNESSetMaxNonlinearStepFailures
SNESGetGridSequence SNESMonitorRatio SNESSetNGS
SNESGetIterationNumber SNESMonitorRatioSetUp SNESSetNPCSide
SNESGetLagJacobian SNESMonitorResidual SNESSetObjective
SNESGetLagPreconditioner SNESMonitorScaling SNESSetPicard
SNESGetLinearSolveFailures SNESMonitorSet SNESSetTolerances
SNESGetLinearSolveIterations SNESMonitorSolution SNESSetTrustRegionTolerance
SNESGetMaxLinearSolveFailures SNESMonitorSolutionUpdate SNESSetType
SNESGetMaxNonlinearStepFailures SNESNASMGetDamping SNESSetUseMatrixFree
SNESGetNPCSide SNESNASMGetNumber SNESViewFromOptions
SNESGetNonlinearStepFailures SNESNASMGetSNES
SNESGetNumberFunctionEvals SNESNASMGetSubdomains
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