petsc-dev 2013-05-13

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 SNES_DIVERGED_FUNCTION_COUNT SNESNEWTONLS
DMDASNESSetJacobianLocal SNES_DIVERGED_LINE_SEARCH SNESNGMRES
DMDASNESSetObjectiveLocal SNES_DIVERGED_LOCAL_MIN SNESNRICHARDSON
DMDASNESSetPicardLocal SNES_DIVERGED_MAX_IT SNESQN
DMSNESSetFunctionLocal SNESFAS SNESSetFromOptions
DMSNESSetJacobianLocal SNESGetKSP SNESSetFunction
SNESAnderson SNES SNESSetJacobian
SNES_CONERGED_ITERATING SNESKSPONLY SNESSetObjective
SNES_CONVERGED_FNORM_ABS SNESLineSearchCreate SNESSolve
SNES_CONVERGED_FNORM_RELATIVE SNESLineSearch SNESType
SNESConvergedReason SNESLineSearchPreCheck SNESView
SNES_CONVERGED_SNORM_RELATIVE SNESLineSearchType SNESVINEWTONRSLS
SNESCreate SNESMS SNESVINEWTONSSLS
SNESDestroy SNESMSSetType
SNES_DIVERGED_FNORM_NAN SNESNCG
Intermediate - Setting options for algorithms and data structures
SNESASPIN SNESGSSetTolerances SNESMonitorSolutionUpdate
SNESComputeJacobianDefaultColor SNESJacobianFunction SNESMSType
SNESComputeJacobianDefault SNESLineSearchApply SNESNASMGetDamping
SNESConvergedDefault SNESLineSearchBTGetAlpha SNESNASMGetSubdomains
SNESConvergenceTestFunction SNESLineSearchBTSetAlpha SNESNASMSetDamping
SNESFASGetType SNESLineSearchComputeNorms SNESNASMSetSubdomains
SNESFASSetLevels SNESLineSearchDestroy SNESNCGSetType
SNESFASSetType SNESLineSearchGetMonitor SNESNEWTONTR
SNESFunction SNESLineSearchGetOrder SNESNGMRESSetRestartType
SNESGetApplicationContext SNESLineSearchGetPostCheck SNESNGMRESSetSelectType
SNESGetConvergedReason SNESLineSearchGetSuccess SNESPythonSetType
SNESGetConvergenceHistory SNESLineSearchGetTolerances SNESQNSetRestartType
SNESGetDM SNESLineSearchPostCheck SNESQNSetScaleType
SNESGetErrorIfNotConverged SNESLineSearchReset SNESReset
SNESGetFunctionNorm SNESLineSearchSetComputeNorms SNESSetApplicationContext
SNESGetIterationNumber SNESLineSearchSetDamping SNESSetComputeApplicationContext
SNESGetLagJacobian SNESLineSearchSetFromOptions SNESSetComputeInitialGuess
SNESGetLagPreconditioner SNESLineSearchSetMonitor SNESSetConvergenceHistory
SNESGetLinearSolveFailures SNESLineSearchSetOrder SNESSetDM
SNESGetLinearSolveIterations SNESLineSearchSetPostCheck SNESSetErrorIfNotConverged
SNESGetMaxLinearSolveFailures SNESLineSearchSetPreCheck SNESSetGridSequence
SNESGetMaxNonlinearStepFailures SNESLineSearchSetTolerances SNESSetGS
SNESGetNonlinearStepFailures SNESLineSearchSetType SNESSetLagJacobian
SNESGetNumberFunctionEvals SNESLineSearchView SNESSetLagPreconditioner
SNESGetPCSide SNESLoad SNESSetMaxLinearSolveFailures
SNESGetRhs SNESMonitorCancel SNESSetMaxNonlinearStepFailures
SNESGetSolution SNESMonitorDefault SNESSetPCSide
SNESGetTolerances SNESMonitorRange SNESSetPicard
SNESGetType SNESMonitorRatio SNESSetTolerances
SNESGSFunction SNESMonitorResidual SNESSetTrustRegionTolerance
SNESGSGetSweeps SNESMonitorSet SNESSetType
SNESGSGetTolerances SNESMonitorSetRatio SNESTEST
SNESGSSetSweeps SNESMonitorSolution SNESUpdateCheckJacobian
Advanced - Setting more advanced options and customization
DMSNESGetFunction SNESFASSetMonitor SNESLineSearchSetUp
DMSNESGetGS SNESFASSetNumberSmoothDown SNESLineSearchSetVecs
DMSNESGetJacobian SNESFASSetNumberSmoothUp SNESLineSearchShellGetUserFunc
DMSNESGetObjective SNESFASSetRestriction SNESLINESEARCHSHELL
DMSNESGetPicard SNESFASSetRScale SNESLineSearchShellSetUserFunc
DMSNESSetFunction SNESGetFunctionDomainError SNESMatrixFreeCreate2
DMSNESSetGS SNESGetFunction SNESMonitorFunction
DMSNESSetJacobian SNESGetGS SNESMSRegisterAll
DMSNESSetObjective SNESGetJacobian SNESMSRegisterDestroy
DMSNESSetPicard SNESGetNormType SNESMSRegister
MatCreateSNESMF SNESGetObjective SNESNASM
SNESAppendOptionsPrefix SNESGetOptionsPrefix SNES_NORM_FINAL_ONLY
SNESComputeObjective SNESGetPicard SNES_NORM_FUNCTION
SNESDefaultMatrixFreeSetParameters2 SNESGetSolutionUpdate SNES_NORM_INITIAL_FINAL_ONLY
SNESFASCycleGetCorrection SNESGS SNES_NORM_INITIAL_ONLY
SNESFASCycleGetSmootherDown SNESKSPGetParametersEW SNES_NORM_NONE
SNESFASCycleGetSmoother SNESKSPGetUseEW SNESNormType
SNESFASCycleGetSmootherUp SNESKSPSetParametersEW SNESObjectiveComputeFunctionDefaultFD
SNESFASCycleIsFine SNESKSPSetUseEW SNESObjectiveFunction
SNESFASCycleSetCycles SNESLineSearchAppendOptionsPrefix SNESRegisterAll
SNESFASGetCoarseSolve SNESLINESEARCHBASIC SNESRegister
SNESFASGetCycleSNES SNESLINESEARCHBT SNESSetConvergenceTest
SNESFASGetGalerkin SNESLINESEARCHCP SNESSetFunctionDomainError
SNESFASGetInjection SNESLineSearchGetDamping SNESSetOptionsPrefix
SNESFASGetInterpolation SNESLineSearchGetLambda SNESSetUpdate
SNESFASGetLevels SNESLineSearchGetOptionsPrefix SNESSetUp
SNESFASGetRestriction SNESLineSearchGetVecs SNESShellGetContext
SNESFASGetSmootherDown SNESLINESEARCHL2 SNESSHELL
SNESFASGetSmoother SNESLineSearchPostheckFunction SNESShellSetContext
SNESFASGetSmootherUp SNESLineSearchPreCheckFunction SNESShellSetSolve
SNESFASSetCycles SNESLineSearchPreCheckPicard SNESSkipConverged
SNESFASSetGalerkin SNESLineSearchRegisterAll SNESVISetComputeVariableBounds
SNESFASSetInjection SNESLineSearchRegister SNESVISetVariableBounds
SNESFASSetInterpolation SNESLineSearchSetLambda
SNESFASSetLog SNESLineSearchSetNorms
Developer - Interfaces intended primarily for library developers, not for typical applications programmers
DMCopyDMSNES SNESFASRestrict SNESMSInitializePackage
DMGetDMSNES SNESFinalizePackage SNESNASMGetSubdomainVecs
DMGetDMSNESWrite SNESGetLineSearch SNESNASMSetComputeFinalJacobian
DMSNESCopy SNESGetPC SNESSetFunctionNorm
MatMFFDComputeJacobian SNESInitializePackage SNESSetInitialFunction
SNESAddOptionsChecker SNESLineSearchGetNorms SNESSetInitialFunctionNorm
SNESComputeFunction SNESLineSearchGetSNES SNESSetIterationNumber
SNESComputeGS SNESLineSearchGetVIFunctions SNESSetKSP
SNESComputeJacobian SNESLineSearchSetSNES SNESSetLineSearch
SNESFASCreateCoarseVec SNESLineSearchSetSuccess SNESSetNormType
SNESFASCycleGetInjection SNESLineSearchSetVIFunctions SNESSetPC
SNESFASCycleGetInterpolation SNESLineSearchSetWorkVecs SNESSetUpMatrices
SNESFASCycleGetRestriction SNESMonitor SNESSetWorkVecs
SNESFASCycleGetRScale SNESMSFinalizePackage
No deprecated routines

Table of Contents