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

Table of Contents