KSPSolve

Solves linear system; usually not called directly, rather it is called by a call to SLESSolve().

Synopsis

#include "petscksp.h" 
int KSPSolve(KSP ksp,int *its) 
Collective on KSP

Input Parameter

ksp -iterative context obtained from KSPCreate()

Output Parameter

its -number of iterations required

Options Database Keys

-ksp_compute_eigenvalues - compute preconditioned operators eigenvalues
-ksp_plot_eigenvalues - plot the computed eigenvalues in an X-window
-ksp_compute_eigenvalues_explicitly - compute the eigenvalues by forming the dense operator and useing LAPACK
-ksp_plot_eigenvalues_explicitly - plot the explicitly computing eigenvalues

Notes

On return, the parameter "its" contains either the iteration number at which convergence was successfully reached or failure was detected.

Call KSPGetConvergedReason() to determine if the solver converged or failed and why.

If using a direct method (e.g., via the KSP solver KSPPREONLY and a preconditioner such as PCLU/PCILU), then its=1. See KSPSetTolerances() and KSPDefaultConverged() for more details.

Understanding Convergence

The routines KSPSetMonitor(), KSPComputeEigenvalues(), and KSPComputeEigenvaluesExplicitly() provide information on additional options to monitor convergence and print eigenvalue information.

Keywords

KSP, solve, linear system

See Also

KSPCreate(), KSPSetUp(), KSPDestroy(), KSPSetTolerances(), KSPDefaultConverged(),
SLESSolve(), KSPSolveTranspose(), SLESGetKSP()

Level:developer
Location:
src/sles/ksp/interface/itfunc.c
Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages