petsc-main 2021-04-20
Report Typos and Errors

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 KSPGetOperators KSPPIPECR
KSLSQRPMonitorResidual KSPGetOperatorsSet KSPPIPEFCG
KSPBCGSLSetEll KSPGetPCSide KSPPIPEFCGGetMmax
KSPBCGSLSetPol KSPGetResidualNorm KSPPIPEFCGGetTruncationType
KSPBCGSLSetUsePseudoinverse KSPGetReusePreconditioner KSPPIPEFCGSetMmax
KSPBCGSLSetXRes KSPGetTolerances KSPPIPEFCGSetTruncationType
KSPCGSetType KSPGetTotalIterations KSPPIPEFGMRES
KSPCGUseSingleReduction KSPGetType KSPPIPEFGMRESSetShift
KSPChebyshevEstEigGetKSP KSPGuessFormGuess KSPPIPEGCR
KSPChebyshevEstEigSet KSPGuessGetType KSPPIPEGCRGetMmax
KSPChebyshevEstEigSetUseNoisy KSPGuessSetFromOptions KSPPIPEGCRGetTruncationType
KSPChebyshevSetEigenvalues KSPGuessSetType KSPPIPEGCRGetUnrollW
KSPConvergedDefault KSPGuessSetUp KSPPIPEGCRSetMmax
KSPConvergedDefaultCreate KSPGuessUpdate KSPPIPEGCRSetModifyPC
KSPConvergedDefaultDestroy KSPGuessView KSPPIPEGCRSetTruncationType
KSPConvergedDefaultSetConvergedMaxits KSPHPDDM KSPPIPEGCRSetUnrollW
KSPConvergedDefaultSetUIRNorm KSPHPDDMGetDeflationSpace KSPPIPEPRCG
KSPConvergedDefaultSetUMIRNorm KSPHPDDMGetType KSPPythonSetType
KSPConvergedRateView KSPHPDDMSetDeflationSpace KSPRichardsonSetScale
KSPConvergedReasonViewCancel KSPHPDDMSetType KSPRichardsonSetSelfScale
KSPConvergedReasonViewFromOptions KSPHPDDMType KSPSetApplicationContext
KSPConvergedReasonViewSet KSPLSQRConvergedDefault KSPSetDM
KSPFCDTruncationType KSPLSQRGetNorms KSPSetDMActive
KSPFCGGetMmax KSPLSQRGetStandardErrorVec KSPSetDiagonalScale
KSPFCGGetTruncationType KSPLSQRMonitorResidualDrawLG KSPSetDiagonalScaleFix
KSPFCGSetMmax KSPLSQRMonitorResidualDrawLGCreate KSPSetErrorIfNotConverged
KSPFCGSetTruncationType KSPLSQRSetComputeStandardErrorVec KSPSetPCSide
KSPFGMRESModifyPCKSP KSPLSQRSetExactMatNorm KSPSetReusePreconditioner
KSPFGMRESModifyPCNoChange KSPLoad KSPSetSkipPCSetFromOptions
KSPFGMRESSetModifyPC KSPMatSolve KSPSetTolerances
KSPGCRGetRestart KSPMonitorCancel KSPSetType
KSPGCRSetModifyPC KSPMonitorError KSPViewFromOptions
KSPGCRSetRestart KSPMonitorErrorDraw MatCreateLMVMBFGS
KSPGMRESClassicalGramSchmidtOrthogonalization KSPMonitorErrorDrawLG MatCreateLMVMBadBroyden
KSPGMRESGetCGSRefinementType KSPMonitorErrorDrawLGCreate MatCreateLMVMBroyden
KSPGMRESGetOrthogonalization KSPMonitorResidual MatCreateLMVMDFP
KSPGMRESGetRestart KSPMonitorResidualDraw MatCreateLMVMDiagBroyden
KSPGMRESModifiedGramSchmidtOrthogonalization KSPMonitorResidualDrawLG MatCreateLMVMSR1
KSPGMRESMonitorKrylov KSPMonitorResidualDrawLGCreate MatCreateLMVMSymBadBroyden
KSPGMRESSetBreakdownTolerance KSPMonitorResidualRange MatCreateLMVMSymBroyden
KSPGMRESSetCGSRefinementType KSPMonitorSingularValue MatCreateSchurComplement
KSPGMRESSetHapTol KSPMonitorSingularValueCreate MatLMVMAllocate
KSPGMRESSetOrthogonalization KSPMonitorSolution MatLMVMGetRejectCount
KSPGMRESSetPreAllocateVectors KSPMonitorSolutionDraw MatLMVMGetUpdateCount
KSPGMRESSetRestart KSPMonitorSolutionDrawLG MatLMVMIsAllocated
KSPGROPPCG KSPMonitorSolutionDrawLGCreate MatLMVMReset
KSPGetApplicationContext KSPMonitorTrueResidual MatLMVMResetShift
KSPGetConvergedReason KSPMonitorTrueResidualDraw MatLMVMSymBroydenSetDelta
KSPGetDM KSPMonitorTrueResidualDrawLG MatLMVMSymBroydenSetScaleType
KSPGetDiagonalScale KSPMonitorTrueResidualDrawLGCreate MatLMVMUpdate
KSPGetDiagonalScaleFix KSPMonitorTrueResidualMax MatSchurComplementAinvType
KSPGetErrorIfNotConverged KSPPIPEBCGS MatSchurComplementGetKSP
KSPGetInitialGuessNonzero KSPPIPECG MatSchurComplementGetSubMatrices
KSPGetIterationNumber KSPPIPECG2 MatSchurComplementSetSubMatrices
KSPGetMonitorContext 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