petsc-master 2019-09-22
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 SNESNewtonTRGetPreCheck
KSPMonitorSNESLGResidualNormDestroy SNESLineSearchMonitorSolutionUpdate SNESNewtonTRSetPostCheck
PetscConvEstGetConvRate SNESLineSearchReason SNESNewtonTRSetPreCheck
PetscConvEstGetSolver SNESLineSearchSetComputeNorms SNESPATCH
PetscConvEstSetSolver SNESLineSearchSetDamping SNESPythonSetType
SNESASPIN SNESLineSearchSetDefaultMonitor SNESQNSetRestartType
SNESCOMPOSITE SNESLineSearchSetFromOptions SNESQNSetScaleType
SNESComputeJacobianDefault SNESLineSearchSetOrder SNESReasonViewFromOptions
SNESComputeJacobianDefaultColor SNESLineSearchSetPostCheck SNESReset
SNESConvergedDefault SNESLineSearchSetPreCheck SNESSetApplicationContext
SNESConvergenceTestFunction SNESLineSearchSetTolerances SNESSetComputeApplicationContext
SNESFunction SNESLineSearchSetType SNESSetComputeInitialGuess
SNESGetApplicationContext SNESLineSearchView SNESSetConvergedReason
SNESGetConvergedReason SNESLoad SNESSetConvergenceHistory
SNESGetConvergenceHistory SNESMSType SNESSetDM
SNESGetDM SNESMonitorCancel SNESSetDivergenceTolerance
SNESGetDivergenceTolerance SNESMonitorDefault SNESSetErrorIfNotConverged
SNESGetErrorIfNotConverged SNESMonitorDefaultField SNESSetForceIteration
SNESGetForceIteration SNESMonitorFields SNESSetGridSequence
SNESGetGridSequence SNESMonitorRange SNESSetLagJacobian
SNESGetIterationNumber SNESMonitorRatio SNESSetLagPreconditioner
SNESGetLagJacobian SNESMonitorRatioSetUp SNESSetMaxLinearSolveFailures
SNESGetLagPreconditioner SNESMonitorResidual SNESSetMaxNonlinearStepFailures
SNESGetLinearSolveFailures SNESMonitorScaling SNESSetNGS
SNESGetLinearSolveIterations SNESMonitorSet SNESSetNPCSide
SNESGetMaxLinearSolveFailures SNESMonitorSolution SNESSetObjective
SNESGetMaxNonlinearStepFailures SNESMonitorSolutionUpdate SNESSetPicard
SNESGetNPCSide SNESNASMGetDamping SNESSetTolerances
SNESGetNonlinearStepFailures SNESNASMGetNumber SNESSetTrustRegionTolerance
SNESGetNumberFunctionEvals SNESNASMGetSNES SNESSetType
SNESGetRhs SNESNASMGetSubdomains SNESSetUseMatrixFree
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