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

Table of Contents