petsc-master 2016-02-13
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
KSPMonitorSNES SNESLineSearchDestroy SNESNASMSetSubdomains
KSPMonitorSNESLGResidualNormCreate SNESLineSearchGetDefaultMonitor SNESNASMSetType
KSPMonitorSNESLGResidualNormDestroy SNESLineSearchGetOrder SNESNCGSetType
SNESASPIN SNESLineSearchGetPostCheck SNESNEWTONTR
SNESCOMPOSITE SNESLineSearchGetPreCheck SNESNGMRESSetRestartFmRise
SNESComputeJacobianDefault SNESLineSearchGetReason SNESNGMRESSetRestartType
SNESComputeJacobianDefaultColor SNESLineSearchGetTolerances SNESNGMRESSetSelectType
SNESConvergedDefault SNESLineSearchMonitorCancel SNESNGSFunction
SNESConvergenceTestFunction SNESLineSearchMonitorSet SNESNGSGetSweeps
SNESFASGetType SNESLineSearchMonitorSolutionUpdate SNESNGSGetTolerances
SNESFASSetLevels SNESLineSearchReason SNESNGSSetSweeps
SNESFASSetType SNESLineSearchSetComputeNorms SNESNGSSetTolerances
SNESFunction SNESLineSearchSetDamping SNESPythonSetType
SNESGetApplicationContext SNESLineSearchSetDefaultMonitor SNESQNSetRestartType
SNESGetConvergedReason SNESLineSearchSetFromOptions SNESQNSetScaleType
SNESGetConvergenceHistory SNESLineSearchSetOrder SNESReasonViewFromOptions
SNESGetDM SNESLineSearchSetPostCheck SNESReset
SNESGetErrorIfNotConverged SNESLineSearchSetPreCheck SNESSetApplicationContext
SNESGetGridSequence SNESLineSearchSetTolerances SNESSetComputeApplicationContext
SNESGetIterationNumber SNESLineSearchSetType SNESSetComputeInitialGuess
SNESGetLagJacobian SNESLineSearchView SNESSetConvergedReason
SNESGetLagPreconditioner SNESLoad SNESSetConvergenceHistory
SNESGetLinearSolveFailures SNESMSType SNESSetDM
SNESGetLinearSolveIterations SNESMonitorCancel SNESSetErrorIfNotConverged
SNESGetMaxLinearSolveFailures SNESMonitorDefault SNESSetGridSequence
SNESGetMaxNonlinearStepFailures SNESMonitorDefaultField SNESSetLagJacobian
SNESGetNPCSide SNESMonitorFields SNESSetLagPreconditioner
SNESGetNonlinearStepFailures SNESMonitorRange SNESSetMaxLinearSolveFailures
SNESGetNumberFunctionEvals SNESMonitorRatio SNESSetMaxNonlinearStepFailures
SNESGetRhs SNESMonitorRatioSetUp SNESSetNGS
SNESGetSolution SNESMonitorResidual SNESSetNPCSide
SNESGetTolerances SNESMonitorSet SNESSetObjective
SNESGetType SNESMonitorSolution SNESSetPicard
SNESJacobianFunction SNESMonitorSolutionUpdate SNESSetTolerances
SNESLineSearchApply SNESNASMGetDamping SNESSetTrustRegionTolerance
SNESLineSearchBTGetAlpha SNESNASMGetSubdomains SNESSetType
SNESLineSearchBTSetAlpha SNESNASMGetType SNESTEST
SNESLineSearchComputeNorms SNESNASMSetDamping SNESUpdateCheckJacobian
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 SNESComputeJacobian SNESLineSearchSetSNES
DMGetDMSNES SNESComputeNGS SNESLineSearchSetVIFunctions
DMGetDMSNESWrite SNESFASCreateCoarseVec SNESLineSearchSetWorkVecs
DMPlexGetCellFields SNESFASCycleGetInjection SNESMSFinalizePackage
DMPlexGetFaceFields SNESFASCycleGetInterpolation SNESMSInitializePackage
DMPlexGetFaceGeometry SNESFASCycleGetRScale SNESMonitor
DMPlexReconstructGradientsFVM SNESFASCycleGetRestriction SNESMonitorSAWsCreate
DMPlexRestoreCellFields SNESFASRestrict SNESMonitorSAWsDestroy
DMPlexRestoreFaceFields SNESFinalizePackage SNESMonitorSetFromOptions
DMPlexRestoreFaceGeometry SNESGetFunctionNorm SNESNASMGetSubdomainVecs
DMPlexSNESComputeJacobianFEM SNESGetNPC SNESNASMSetComputeFinalJacobian
DMPlexSNESComputeResidualFEM SNESGetNPCFunction SNESSetCountersReset
DMPlexSNESGetGeometryFEM SNESHasNPC SNESSetFunctionNorm
DMPlexSNESGetGeometryFVM SNESInitializePackage SNESSetFunctionType
DMPlexSNESGetGradientDM SNESLineSearchCreate SNESSetInitialFunction
DMSNESCopy SNESLineSearchGetNorms SNESSetIterationNumber
MatMFFDComputeJacobian SNESLineSearchGetSNES SNESSetKSP
SNESAddOptionsChecker SNESLineSearchGetVIFunctions SNESSetLagJacobianPersists
SNESApplyNPC SNESLineSearchMonitor SNESSetLagPreconditionerPersists
SNESCompositeAddSNES SNESLineSearchMonitorSetFromOptions SNESSetLineSearch
SNESCompositeGetNumber SNESLineSearchPostCheck SNESSetNPC
SNESCompositeGetSNES SNESLineSearchPreCheck SNESSetNormSchedule
SNESCompositeSetDamping SNESLineSearchReset SNESSetUpMatrices
SNESCompositeSetType SNESLineSearchSetFunction SNESSetWorkVecs
SNESComputeFunction SNESLineSearchSetReason
No deprecated routines

Table of Contents