petsc-3.6.0 2015-06-09
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 SNESLineSearchComputeNorms SNESNASMSetType
KSPMonitorSNESLGResidualNormCreate SNESLineSearchDestroy SNESNCGSetType
KSPMonitorSNESLGResidualNormDestroy SNESLineSearchGetMonitor SNESNEWTONTR
SNESASPIN SNESLineSearchGetOrder SNESNGMRESSetRestartType
SNESCOMPOSITE SNESLineSearchGetPostCheck SNESNGMRESSetSelectType
SNESComputeJacobianDefault SNESLineSearchGetPreCheck SNESNGSFunction
SNESComputeJacobianDefaultColor SNESLineSearchGetReason SNESNGSGetSweeps
SNESConvergedDefault SNESLineSearchGetTolerances SNESNGSGetTolerances
SNESConvergenceTestFunction SNESLineSearchReason SNESNGSSetSweeps
SNESFASGetType SNESLineSearchSetComputeNorms SNESNGSSetTolerances
SNESFASSetLevels SNESLineSearchSetDamping SNESPythonSetType
SNESFASSetType SNESLineSearchSetFromOptions SNESQNSetRestartType
SNESFunction SNESLineSearchSetMonitor SNESQNSetScaleType
SNESGetApplicationContext SNESLineSearchSetOrder SNESReasonViewFromOptions
SNESGetConvergedReason SNESLineSearchSetPostCheck SNESReset
SNESGetConvergenceHistory SNESLineSearchSetPreCheck SNESSetApplicationContext
SNESGetDM SNESLineSearchSetTolerances SNESSetComputeApplicationContext
SNESGetErrorIfNotConverged SNESLineSearchSetType SNESSetComputeInitialGuess
SNESGetGridSequence SNESLineSearchView SNESSetConvergenceHistory
SNESGetIterationNumber SNESLoad SNESSetDM
SNESGetLagJacobian SNESMSType SNESSetErrorIfNotConverged
SNESGetLagPreconditioner SNESMonitorCancel SNESSetGridSequence
SNESGetLinearSolveFailures SNESMonitorDefault SNESSetLagJacobian
SNESGetLinearSolveIterations SNESMonitorDefaultField SNESSetLagPreconditioner
SNESGetMaxLinearSolveFailures SNESMonitorFields SNESSetMaxLinearSolveFailures
SNESGetMaxNonlinearStepFailures SNESMonitorRange SNESSetMaxNonlinearStepFailures
SNESGetNPCSide SNESMonitorRatio SNESSetNGS
SNESGetNonlinearStepFailures SNESMonitorResidual SNESSetNPCSide
SNESGetNumberFunctionEvals SNESMonitorSet SNESSetObjective
SNESGetRhs SNESMonitorSetRatio SNESSetPicard
SNESGetSolution SNESMonitorSolution SNESSetTolerances
SNESGetTolerances SNESMonitorSolutionUpdate SNESSetTrustRegionTolerance
SNESGetType SNESNASMGetDamping SNESSetType
SNESJacobianFunction SNESNASMGetSubdomains SNESTEST
SNESLineSearchApply SNESNASMGetType SNESUpdateCheckJacobian
SNESLineSearchBTGetAlpha SNESNASMSetDamping
SNESLineSearchBTSetAlpha 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
DMPlexRestoreCellFields SNESFASCycleGetRScale SNESMonitorSAWsCreate
DMPlexRestoreFaceFields SNESFASCycleGetRestriction SNESMonitorSAWsDestroy
DMPlexRestoreFaceGeometry SNESFASRestrict SNESNASMGetSubdomainVecs
DMPlexSNESComputeJacobianFEM SNESFinalizePackage SNESNASMSetComputeFinalJacobian
DMPlexSNESComputeResidualFEM SNESGetNPC SNESSetCountersReset
DMPlexSNESGetGeometryFEM SNESGetNPCFunction SNESSetFunctionType
DMPlexSNESGetGeometryFVM SNESHasNPC SNESSetInitialFunction
DMPlexSNESGetGradientDM SNESInitializePackage SNESSetIterationNumber
DMSNESCopy SNESLineSearchCreate SNESSetKSP
MatMFFDComputeJacobian SNESLineSearchGetNorms SNESSetLagJacobianPersists
SNESAddOptionsChecker SNESLineSearchGetSNES SNESSetLagPreconditionerPersists
SNESApplyNPC SNESLineSearchGetVIFunctions SNESSetLineSearch
SNESCompositeAddSNES SNESLineSearchPostCheck SNESSetNPC
SNESCompositeGetNumber SNESLineSearchPreCheck SNESSetNormSchedule
SNESCompositeGetSNES SNESLineSearchReset SNESSetUpMatrices
SNESCompositeSetDamping SNESLineSearchSetFunction SNESSetWorkVecs
SNESCompositeSetType SNESLineSearchSetReason
No deprecated routines

Table of Contents