PETSc version 3.15.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 KSPSetFromOptions
KSPAGMRES KSPGetConvergedReasonString KSPSetInitialGuessNonzero
KSPBCGS KSPGuess KSPSetOperators
KSPBCGSL KSPGuessCreate KSPSolve
KSPBICG KSPGuessDestroy KSPTCQMR
KSPCG KSPGuessType KSPTFQMR
KSPCGLS KSPIBCGS KSPType
KSPCGNE KSPLCD KSPView
KSPCGS KSPLGMRES KSP_CONVERGED_ATOL
KSPCGType KSPLSQR KSP_CONVERGED_ITERATING
KSPCHEBYSHEV KSPMINRES KSP_CONVERGED_ITS
KSPCR KSPMonitorSet KSP_CONVERGED_RTOL
KSPConvergedReason KSPPGMRES KSP_DIVERGED_BREAKDOWN
KSPConvergedReasonView KSPPREONLY KSP_DIVERGED_BREAKDOWN_BICG
KSPCreate KSPRICHARDSON KSP_DIVERGED_DTOL
KSPDGMRES KSPReset KSP_DIVERGED_INDEFINITE_PC
KSPDestroy KSPResetFromOptions KSP_DIVERGED_ITS
KSPFBCGS KSPResetViewers KSP_DIVERGED_NONSYMMETRIC
KSPFBCGSR KSPSYMMLQ KSP_DIVERGED_PC_FAILED
KSPFCG KSPSetComputeInitialGuess MatLMVMSetHistorySize
KSPFGMRES KSPSetComputeOperators
KSPGCR KSPSetComputeRHS
Intermediate - Setting options for algorithms and data structures
DMProjectField KSPGetOperatorsSet KSPPIPECR
KSPBCGSLSetEll KSPGetPCSide KSPPIPEFCG
KSPBCGSLSetPol KSPGetResidualNorm KSPPIPEFCGGetMmax
KSPBCGSLSetUsePseudoinverse KSPGetReusePreconditioner KSPPIPEFCGGetTruncationType
KSPBCGSLSetXRes KSPGetTolerances KSPPIPEFCGSetMmax
KSPCGSetType KSPGetTotalIterations KSPPIPEFCGSetTruncationType
KSPCGUseSingleReduction KSPGetType KSPPIPEFGMRES
KSPChebyshevEstEigGetKSP KSPGuessFormGuess KSPPIPEFGMRESSetShift
KSPChebyshevEstEigSet KSPGuessGetType KSPPIPEGCR
KSPChebyshevEstEigSetUseNoisy KSPGuessSetFromOptions KSPPIPEGCRGetMmax
KSPChebyshevSetEigenvalues KSPGuessSetType KSPPIPEGCRGetTruncationType
KSPConvergedDefault KSPGuessSetUp KSPPIPEGCRGetUnrollW
KSPConvergedDefaultCreate KSPGuessUpdate KSPPIPEGCRSetMmax
KSPConvergedDefaultDestroy KSPGuessView KSPPIPEGCRSetModifyPC
KSPConvergedDefaultSetConvergedMaxits KSPHPDDM KSPPIPEGCRSetTruncationType
KSPConvergedDefaultSetUIRNorm KSPHPDDMGetDeflationSpace KSPPIPEGCRSetUnrollW
KSPConvergedDefaultSetUMIRNorm KSPHPDDMGetType KSPPIPEPRCG
KSPConvergedRateView KSPHPDDMSetDeflationSpace KSPPythonSetType
KSPConvergedReasonViewCancel KSPHPDDMSetType KSPRichardsonSetScale
KSPConvergedReasonViewFromOptions KSPHPDDMType KSPRichardsonSetSelfScale
KSPConvergedReasonViewSet KSPLSQRConvergedDefault KSPSetApplicationContext
KSPFCDTruncationType KSPLSQRGetNorms KSPSetDM
KSPFCGGetMmax KSPLSQRGetStandardErrorVec KSPSetDMActive
KSPFCGGetTruncationType KSPLSQRMonitorResidual KSPSetDiagonalScale
KSPFCGSetMmax KSPLSQRMonitorResidualDrawLG KSPSetDiagonalScaleFix
KSPFCGSetTruncationType KSPLSQRMonitorResidualDrawLGCreate KSPSetErrorIfNotConverged
KSPFGMRESModifyPCKSP KSPLSQRSetComputeStandardErrorVec KSPSetPCSide
KSPFGMRESModifyPCNoChange KSPLSQRSetExactMatNorm KSPSetReusePreconditioner
KSPFGMRESSetModifyPC KSPLoad KSPSetSkipPCSetFromOptions
KSPGCRGetRestart KSPMatSolve KSPSetTolerances
KSPGCRSetModifyPC KSPMonitorCancel KSPSetType
KSPGCRSetRestart KSPMonitorError KSPViewFromOptions
KSPGMRESClassicalGramSchmidtOrthogonalization KSPMonitorErrorDraw MatCreateLMVMBFGS
KSPGMRESGetCGSRefinementType KSPMonitorErrorDrawLG MatCreateLMVMBadBroyden
KSPGMRESGetOrthogonalization KSPMonitorErrorDrawLGCreate MatCreateLMVMBroyden
KSPGMRESGetRestart KSPMonitorResidual MatCreateLMVMDFP
KSPGMRESModifiedGramSchmidtOrthogonalization KSPMonitorResidualDraw MatCreateLMVMDiagBroyden
KSPGMRESMonitorKrylov KSPMonitorResidualDrawLG MatCreateLMVMSR1
KSPGMRESSetBreakdownTolerance KSPMonitorResidualDrawLGCreate MatCreateLMVMSymBadBroyden
KSPGMRESSetCGSRefinementType KSPMonitorResidualRange MatCreateLMVMSymBroyden
KSPGMRESSetHapTol KSPMonitorSingularValue MatCreateSchurComplement
KSPGMRESSetOrthogonalization KSPMonitorSingularValueCreate MatLMVMAllocate
KSPGMRESSetPreAllocateVectors KSPMonitorSolution MatLMVMGetRejectCount
KSPGMRESSetRestart KSPMonitorSolutionDraw MatLMVMGetUpdateCount
KSPGROPPCG KSPMonitorSolutionDrawLG MatLMVMIsAllocated
KSPGetApplicationContext KSPMonitorSolutionDrawLGCreate MatLMVMReset
KSPGetConvergedReason KSPMonitorTrueResidual MatLMVMResetShift
KSPGetDM KSPMonitorTrueResidualDraw MatLMVMSymBroydenSetDelta
KSPGetDiagonalScale KSPMonitorTrueResidualDrawLG MatLMVMSymBroydenSetScaleType
KSPGetDiagonalScaleFix KSPMonitorTrueResidualDrawLGCreate MatLMVMUpdate
KSPGetErrorIfNotConverged KSPMonitorTrueResidualMax MatSchurComplementAinvType
KSPGetInitialGuessNonzero KSPPIPEBCGS MatSchurComplementGetKSP
KSPGetIterationNumber KSPPIPECG MatSchurComplementGetSubMatrices
KSPGetMonitorContext KSPPIPECG2 MatSchurComplementSetSubMatrices
KSPGetOperators KSPPIPECGRR MatSchurComplementUpdateSubMatrices
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