petsc-master 2018-10-16
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
DMAdaptorCreate SNESANDERSON SNESSetFromOptions
DMAdaptorDestroy SNESConvergedReason SNESSetFunction
DMAdaptorSetFromOptions SNESCreate SNESSetJacobian
DMAdaptorSetUp SNESDestroy SNESSetSolution
DMAdaptorView SNESFASType SNESSolve
DMDASNESSetFunctionLocal SNESGetKSP SNESType
DMDASNESSetJacobianLocal SNESGetLineSearch SNESVINEWTONRSLS
DMDASNESSetObjectiveLocal SNESKSPONLY SNESVINEWTONSSLS
DMDASNESSetPicardLocal SNESLineSearch SNESView
DMInterpolationCreate SNESLineSearchType SNES_CONERGED_ITERATING
DMInterpolationDestroy SNESMS SNES_CONVERGED_FNORM_ABS
DMInterpolationEvaluate SNESMSSetType SNES_CONVERGED_FNORM_RELATIVE
DMSNESSetFunctionLocal SNESNCG SNES_CONVERGED_SNORM_RELATIVE
DMSNESSetJacobianLocal SNESNEWTONLS SNES_DIVERGED_DTOL
PetscConvEstCreate SNESNGMRES SNES_DIVERGED_FNORM_NAN
PetscConvEstDestroy SNESNRICHARDSON SNES_DIVERGED_FUNCTION_COUNT
PetscConvEstSetFromOptions SNESQN SNES_DIVERGED_LINE_SEARCH
PetscConvEstSetUp SNESQNSetType SNES_DIVERGED_LOCAL_MIN
PetscConvEstView SNESReasonView SNES_DIVERGED_MAX_IT
SNES SNESResetFromOptions
Intermediate - Setting options for algorithms and data structures
DMAdaptorAdapt SNESGetRhs SNESNASMGetSNES
DMAdaptorGetSequenceLength SNESGetSolution SNESNASMGetSubdomains
DMAdaptorGetSolver SNESGetTolerances SNESNASMGetType
DMAdaptorSetSequenceLength SNESGetType SNESNASMSetDamping
DMAdaptorSetSolver SNESGetUseMatrixFree SNESNASMSetSubdomains
DMInterpolationAddPoints SNESJacobianFunction SNESNASMSetType
DMInterpolationGetCoordinates SNESLineSearchApply SNESNASMSetWeight
DMInterpolationGetDim SNESLineSearchBTGetAlpha SNESNCGSetType
DMInterpolationGetDof SNESLineSearchBTSetAlpha SNESNEWTONTR
DMInterpolationGetVector SNESLineSearchComputeNorms SNESNGMRESSetRestartFmRise
DMInterpolationRestoreVector SNESLineSearchGetDefaultMonitor SNESNGMRESSetRestartType
DMInterpolationSetDim SNESLineSearchGetOrder SNESNGMRESSetSelectType
DMInterpolationSetDof SNESLineSearchGetPostCheck SNESNGSFunction
DMInterpolationSetUp SNESLineSearchGetPreCheck SNESNGSGetSweeps
DMSNESSetBoundaryLocal SNESLineSearchGetReason SNESNGSGetTolerances
KSPMonitorSNES SNESLineSearchGetTolerances SNESNGSSetSweeps
KSPMonitorSNESLGResidualNormCreate SNESLineSearchMonitorCancel SNESNGSSetTolerances
KSPMonitorSNESLGResidualNormDestroy SNESLineSearchMonitorSet SNESPythonSetType
PetscConvEstGetConvRate SNESLineSearchMonitorSolutionUpdate SNESQNSetRestartType
PetscConvEstGetSolver SNESLineSearchReason SNESQNSetScaleType
PetscConvEstSetSolver SNESLineSearchSetComputeNorms SNESReasonViewFromOptions
SNESASPIN SNESLineSearchSetDamping SNESReset
SNESCOMPOSITE SNESLineSearchSetDefaultMonitor SNESSetApplicationContext
SNESComputeJacobianDefault SNESLineSearchSetFromOptions SNESSetComputeApplicationContext
SNESComputeJacobianDefaultColor SNESLineSearchSetOrder SNESSetComputeInitialGuess
SNESConvergedDefault SNESLineSearchSetPostCheck SNESSetConvergedReason
SNESConvergenceTestFunction SNESLineSearchSetPreCheck SNESSetConvergenceHistory
SNESFunction SNESLineSearchSetTolerances SNESSetDM
SNESGetApplicationContext SNESLineSearchSetType SNESSetDivergenceTolerance
SNESGetConvergedReason SNESLineSearchView SNESSetErrorIfNotConverged
SNESGetConvergenceHistory SNESLoad SNESSetForceIteration
SNESGetDM SNESMSType SNESSetGridSequence
SNESGetDivergenceTolerance SNESMonitorCancel SNESSetLagJacobian
SNESGetErrorIfNotConverged SNESMonitorDefault SNESSetLagPreconditioner
SNESGetForceIteration SNESMonitorDefaultField SNESSetMaxLinearSolveFailures
SNESGetGridSequence SNESMonitorFields SNESSetMaxNonlinearStepFailures
SNESGetIterationNumber SNESMonitorRange SNESSetNGS
SNESGetLagJacobian SNESMonitorRatio SNESSetNPCSide
SNESGetLagPreconditioner SNESMonitorRatioSetUp SNESSetObjective
SNESGetLinearSolveFailures SNESMonitorResidual SNESSetPicard
SNESGetLinearSolveIterations SNESMonitorScaling SNESSetTolerances
SNESGetMaxLinearSolveFailures SNESMonitorSet SNESSetTrustRegionTolerance
SNESGetMaxNonlinearStepFailures SNESMonitorSolution SNESSetType
SNESGetNPCSide SNESMonitorSolutionUpdate SNESSetUseMatrixFree
SNESGetNonlinearStepFailures SNESNASMGetDamping
SNESGetNumberFunctionEvals SNESNASMGetNumber
Advanced - Setting more advanced options and customization
DMSNESGetFunction SNESGetPicard SNESMSRegisterDestroy
DMSNESGetJacobian SNESGetSolutionUpdate SNESMatrixFreeCreate2
DMSNESGetNGS SNESKSPGetParametersEW SNESMonitorFunction
DMSNESGetObjective SNESKSPGetUseEW SNESMonitorSAWs
DMSNESGetPicard SNESKSPSetParametersEW SNESNASM
DMSNESSetFunction SNESKSPSetUseEW SNESNGS
DMSNESSetJacobian SNESLINESEARCHBASIC SNESNormSchedule
DMSNESSetNGS SNESLINESEARCHBT SNESObjectiveComputeFunctionDefaultFD
DMSNESSetObjective SNESLINESEARCHCP SNESObjectiveFunction
DMSNESSetPicard SNESLINESEARCHL2 SNESRegister
MatCreateSNESMF SNESLINESEARCHNLEQERR SNESRegisterAll
MatSNESMFGetReuseBase SNESLINESEARCHSHELL SNESSHELL
MatSNESMFGetSNES SNESLineSearchAppendOptionsPrefix SNESSetAlwaysComputesFinalResidual
MatSNESMFSetReuseBase SNESLineSearchGetDamping SNESSetConvergenceTest
SNESAppendOptionsPrefix SNESLineSearchGetLambda SNESSetFunctionDomainError
SNESComputeObjective SNESLineSearchGetOptionsPrefix SNESSetOptionsPrefix
SNESConvergedSkip SNESLineSearchGetVecs SNESSetUp
SNESDefaultMatrixFreeSetParameters2 SNESLineSearchPreCheckPicard SNESSetUpdate
SNESFunctionType SNESLineSearchRegister SNESShellGetContext
SNESGetAlwaysComputesFinalResidual SNESLineSearchRegisterAll SNESShellSetContext
SNESGetFunction SNESLineSearchSetLambda SNESShellSetSolve
SNESGetFunctionDomainError SNESLineSearchSetNorms SNESVISetComputeVariableBounds
SNESGetFunctionType SNESLineSearchSetUp SNESVISetVariableBounds
SNESGetJacobian SNESLineSearchSetVecs SNES_NORM_ALWAYS
SNESGetNGS SNESLineSearchShellGetUserFunc SNES_NORM_FINAL_ONLY
SNESGetNormSchedule SNESLineSearchShellSetUserFunc SNES_NORM_INITIAL_FINAL_ONLY
SNESGetObjective SNESMSRegister SNES_NORM_INITIAL_ONLY
SNESGetOptionsPrefix SNESMSRegisterAll SNES_NORM_NONE
Developer - Interfaces intended primarily for library developers, not for typical applications programmers
DMCopyDMSNES SNESCompositeGetSNES SNESLineSearchSetSNES
DMGetDMSNES SNESCompositeSetDamping SNESLineSearchSetVIFunctions
DMGetDMSNESWrite SNESCompositeSetType SNESLineSearchSetWorkVecs
DMPlexComputeJacobianAction SNESComputeFunction SNESMSFinalizePackage
DMPlexGetCellFields SNESComputeJacobian SNESMSInitializePackage
DMPlexGetFaceFields SNESComputeNGS SNESMonitor
DMPlexGetFaceGeometry SNESFinalizePackage SNESMonitorSAWsCreate
DMPlexRestoreCellFields SNESGetFunctionNorm SNESMonitorSAWsDestroy
DMPlexRestoreFaceFields SNESGetNPC SNESMonitorSetFromOptions
DMPlexRestoreFaceGeometry SNESGetNPCFunction SNESNASMGetSubdomainVecs
DMPlexSNESComputeBoundaryFEM SNESHasNPC SNESNASMSetComputeFinalJacobian
DMPlexSNESComputeJacobianFEM SNESInitializePackage SNESSetCountersReset
DMPlexSNESComputeResidualFEM SNESLineSearchCreate SNESSetFunctionNorm
DMPlexSNESGetGeometryFVM SNESLineSearchDestroy SNESSetFunctionType
DMPlexSNESGetGradientDM SNESLineSearchGetNorms SNESSetInitialFunction
DMPlexSetSNESLocalFEM SNESLineSearchGetSNES SNESSetIterationNumber
DMSNESCheckFromOptions SNESLineSearchGetVIFunctions SNESSetKSP
DMSNESCopy SNESLineSearchMonitor SNESSetLagJacobianPersists
MatMFFDComputeJacobian SNESLineSearchMonitorSetFromOptions SNESSetLagPreconditionerPersists
PetscConvEstRateView SNESLineSearchPostCheck SNESSetLineSearch
SNESAddOptionsChecker SNESLineSearchPreCheck SNESSetNPC
SNESApplyNPC SNESLineSearchReset SNESSetNormSchedule
SNESCompositeAddSNES SNESLineSearchSetFunction SNESSetUpMatrices
SNESCompositeGetNumber SNESLineSearchSetReason SNESSetWorkVecs
No deprecated routines

Table of Contents