PETSc version 3.17.4

Krylov Methods - KSP: : Examples

The scalable linear equations solvers (KSP) component provides an easy-to-use interface to the combination of a Krylov subspace iterative method and a preconditioner (in the KSP and PC components, respectively) or a sequential direct solver. KSP users can set various Krylov subspace options at runtime via the options database (e.g., -ksp_type cg ). KSP users can also set KSP options directly in application by directly calling the KSP routines listed below (e.g., KSPSetType() ). KSP components can be used directly to create and destroy solvers; this is not needed for users but is intended for library developers.

Beginner - Basic usage
KSP KSPGMRES KSPSetComputeRHS
KSPAGMRES KSPGetConvergedReasonString KSPSetFromOptions
KSPBCGS KSPGuess KSPSetInitialGuessNonzero
KSPBCGSL KSPGuessCreate KSPSetOperators
KSPBICG KSPGuessDestroy KSPSolve
KSPCG KSPGuessType KSPTCQMR
KSPCGLS KSPIBCGS KSPTFQMR
KSPCGNE KSPLCD KSPType
KSPCGS KSPLGMRES KSPView
KSPCGType KSPLSQR KSP_CONVERGED_ATOL
KSPCHEBYSHEV KSPMINRES KSP_CONVERGED_ITERATING
KSPCR KSPMonitorSet KSP_CONVERGED_ITS
KSPConvergedReason KSPPGMRES KSP_CONVERGED_RTOL
KSPConvergedReasonView KSPPREONLY KSP_DIVERGED_BREAKDOWN
KSPCreate KSPQMRCGS KSP_DIVERGED_BREAKDOWN_BICG
KSPDGMRES KSPRICHARDSON KSP_DIVERGED_DTOL
KSPDestroy KSPReset KSP_DIVERGED_INDEFINITE_PC
KSPFBCGS KSPResetFromOptions KSP_DIVERGED_ITS
KSPFBCGSR KSPResetViewers KSP_DIVERGED_NONSYMMETRIC
KSPFCG KSPSYMMLQ KSP_DIVERGED_PC_FAILED
KSPFGMRES KSPSetComputeInitialGuess MatLMVMSetHistorySize
KSPGCR KSPSetComputeOperators
Intermediate - Setting options for algorithms and data structures
DMProjectField KSPGetPCSide KSPPIPECR
KSPBCGSLSetEll KSPGetResidualNorm KSPPIPEFCG
KSPBCGSLSetPol KSPGetReusePreconditioner KSPPIPEFCGGetMmax
KSPBCGSLSetUsePseudoinverse KSPGetTolerances KSPPIPEFCGGetTruncationType
KSPBCGSLSetXRes KSPGetTotalIterations KSPPIPEFCGSetMmax
KSPCGSetType KSPGetType KSPPIPEFCGSetTruncationType
KSPCGUseSingleReduction KSPGuessFormGuess KSPPIPEFGMRES
KSPChebyshevEstEigGetKSP KSPGuessGetType KSPPIPEFGMRESSetShift
KSPChebyshevEstEigSet KSPGuessSetFromOptions KSPPIPEGCR
KSPChebyshevEstEigSetUseNoisy KSPGuessSetTolerance KSPPIPEGCRGetMmax
KSPChebyshevSetEigenvalues KSPGuessSetType KSPPIPEGCRGetTruncationType
KSPConvergedDefault KSPGuessSetUp KSPPIPEGCRGetUnrollW
KSPConvergedDefaultCreate KSPGuessUpdate KSPPIPEGCRSetMmax
KSPConvergedDefaultDestroy KSPGuessView KSPPIPEGCRSetModifyPC
KSPConvergedDefaultSetConvergedMaxits KSPHPDDM KSPPIPEGCRSetTruncationType
KSPConvergedDefaultSetUIRNorm KSPHPDDMGetDeflationSpace KSPPIPEGCRSetUnrollW
KSPConvergedDefaultSetUMIRNorm KSPHPDDMGetType KSPPIPEPRCG
KSPConvergedRateView KSPHPDDMPrecision KSPPythonSetType
KSPConvergedReasonViewCancel KSPHPDDMSetDeflationSpace KSPRichardsonSetScale
KSPConvergedReasonViewFromOptions KSPHPDDMSetType KSPRichardsonSetSelfScale
KSPConvergedReasonViewSet KSPHPDDMType KSPSetApplicationContext
KSPFCDTruncationType KSPLSQRConvergedDefault KSPSetDM
KSPFCGGetMmax KSPLSQRGetNorms KSPSetDMActive
KSPFCGGetTruncationType KSPLSQRGetStandardErrorVec KSPSetDiagonalScale
KSPFCGSetMmax KSPLSQRMonitorResidual KSPSetDiagonalScaleFix
KSPFCGSetTruncationType KSPLSQRMonitorResidualDrawLG KSPSetErrorIfNotConverged
KSPFGMRESModifyPCKSP KSPLSQRMonitorResidualDrawLGCreate KSPSetPCSide
KSPFGMRESModifyPCNoChange KSPLSQRSetComputeStandardErrorVec KSPSetReusePreconditioner
KSPFGMRESSetModifyPC KSPLSQRSetExactMatNorm KSPSetSkipPCSetFromOptions
KSPGCRGetRestart KSPLoad KSPSetTolerances
KSPGCRSetModifyPC KSPMatSolve KSPSetType
KSPGCRSetRestart KSPMonitorCancel KSPViewFromOptions
KSPGMRESClassicalGramSchmidtOrthogonalization KSPMonitorError MatCreateLMVMBFGS
KSPGMRESGetCGSRefinementType KSPMonitorErrorDraw MatCreateLMVMBadBroyden
KSPGMRESGetOrthogonalization KSPMonitorErrorDrawLG MatCreateLMVMBroyden
KSPGMRESGetRestart KSPMonitorErrorDrawLGCreate MatCreateLMVMDFP
KSPGMRESModifiedGramSchmidtOrthogonalization KSPMonitorResidual MatCreateLMVMDiagBroyden
KSPGMRESMonitorKrylov KSPMonitorResidualDraw MatCreateLMVMSR1
KSPGMRESSetBreakdownTolerance KSPMonitorResidualDrawLG MatCreateLMVMSymBadBroyden
KSPGMRESSetCGSRefinementType KSPMonitorResidualDrawLGCreate MatCreateLMVMSymBroyden
KSPGMRESSetHapTol KSPMonitorResidualRange MatCreateSchurComplement
KSPGMRESSetOrthogonalization KSPMonitorSingularValue MatLMVMAllocate
KSPGMRESSetPreAllocateVectors KSPMonitorSingularValueCreate MatLMVMGetRejectCount
KSPGMRESSetRestart KSPMonitorSolution MatLMVMGetUpdateCount
KSPGROPPCG KSPMonitorSolutionDraw MatLMVMIsAllocated
KSPGetApplicationContext KSPMonitorSolutionDrawLG MatLMVMReset
KSPGetConvergedReason KSPMonitorSolutionDrawLGCreate MatLMVMResetShift
KSPGetDM KSPMonitorTrueResidual MatLMVMSymBroydenSetDelta
KSPGetDiagonalScale KSPMonitorTrueResidualDraw MatLMVMSymBroydenSetScaleType
KSPGetDiagonalScaleFix KSPMonitorTrueResidualDrawLG MatLMVMUpdate
KSPGetErrorIfNotConverged KSPMonitorTrueResidualDrawLGCreate MatSchurComplementAinvType
KSPGetInitialGuessNonzero KSPMonitorTrueResidualMax MatSchurComplementGetKSP
KSPGetIterationNumber KSPPIPEBCGS MatSchurComplementGetSubMatrices
KSPGetMonitorContext KSPPIPECG MatSchurComplementSetSubMatrices
KSPGetOperators KSPPIPECG2 MatSchurComplementUpdateSubMatrices
KSPGetOperatorsSet KSPPIPECGRR
Advanced - Setting more advanced options and customization
DMGlobalToLocalSolve KSPGetConvergenceContext KSPSetLagNorm
DMKSPGetComputeInitialGuess KSPGetConvergenceTest KSPSetMatSolveBatchSize
DMKSPGetComputeOperators KSPGetErrorHistory KSPSetNormType
DMKSPGetComputeRHS KSPGetInitialGuessKnoll KSPSetOptionsPrefix
DMKSPSetComputeInitialGuess KSPGetMatSolveBatchSize KSPSetResidualHistory
DMKSPSetComputeOperators KSPGetNormType KSPSetUpOnBlocks
DMKSPSetComputeRHS KSPGetOptionsPrefix KSPSetUseExplicitTranspose
KSPAppendOptionsPrefix KSPGetResidualHistory KSPSetUseFischerGuess
KSPBuildResidual KSPGuessFischerSetModel KSPTSIRM
KSPBuildSolution KSPMatRegisterAll KSPUnwindPreconditioner
KSPCGGetNormD KSPMonitoRegisterAll KSP_GMRES_CGS_REFINE_IFNEEDED
KSPCGGetObjFcn KSPMonitorDynamicTolerance KSP_GMRES_CGS_REFINE_NEVER
KSPCGSetRadius KSPMonitorRegister KSP_NORM_NATURAL
KSPComputeEigenvalues KSPMonitorSAWs KSP_NORM_NONE
KSPComputeEigenvaluesExplicitly KSPNormType KSP_NORM_PRECONDITIONED
KSPComputeExtremeSingularValues KSPPIPEFCGGetNprealloc KSP_NORM_UNPRECONDITIONED
KSPComputeOperator KSPPIPEFCGSetNprealloc MatCreateSchurComplementPmat
KSPComputeRitz KSPPIPEGCRGetNprealloc MatGetSchurComplement
KSPConvergedSkip KSPPIPEGCRSetNprealloc MatLMVMApplyJ0Fwd
KSPCreateVecs KSPPIPELCG MatLMVMApplyJ0Inv
KSPFCGGetNprealloc KSPQCGGetQuadratic MatLMVMClearJ0
KSPFCGSetNprealloc KSPQCGGetTrialStepNorm MatLMVMGetJ0
KSPFETIDP KSPQCGSetTrustRegionRadius MatLMVMGetJ0KSP
KSPFETIDPGetInnerBDDC KSPRegister MatLMVMGetJ0PC
KSPFETIDPGetInnerKSP KSPRegisterAll MatLMVMSetJ0
KSPFETIDPSetInnerBDDC KSPSetCheckNormIteration MatLMVMSetJ0Diag
KSPFETIDPSetPressureOperator KSPSetComputeEigenvalues MatLMVMSetJ0KSP
KSPGLTRGetLambda KSPSetComputeRitz MatLMVMSetJ0PC
KSPGLTRGetMinEig KSPSetComputeSingularValues MatLMVMSetJ0Scale
KSPGMRESCGSRefinementType KSPSetConvergenceTest MatSchurComplementComputeExplicitOperator
KSPGetAndClearConvergenceTest KSPSetErrorHistory MatSchurComplementGetAinvType
KSPGetComputeEigenvalues KSPSetGuess MatSchurComplementGetPmat
KSPGetComputeSingularValues KSPSetInitialGuessKnoll MatSchurComplementSetAinvType
Developer - Interfaces intended primarily for library developers, not for typical applications programmers
DMCopyDMKSP KSPGetRhs KSPSetPC
DMGetDMKSP KSPGetSolution KSPSetPostSolve
DMGetDMKSPWrite KSPInitialResidual KSPSetPreSolve
DMKSPCopy KSPInitializePackage KSPSetSupportedNorm
KSPCheckDot KSPMonitor KSPSetUp
KSPCheckNorm KSPMonitorSAWsCreate KSPSetWorkVecs
KSPCheckSolve KSPMonitorSAWsDestroy KSPSolveTranspose
KSPFinalizePackage KSPMonitorSetFromOptions MatSchurComplementSetKSP
KSPGLTR KSPNASH PCFinalizePackage
KSPGetGuess KSPQCG PCInitializePackage
KSPGetPC KSPSTCG
No deprecated routines

Table of Contents