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

Table of Contents