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.

ex1.c: Solves a tridiagonal linear system with KSP
ex2.c: Solves a linear system in parallel with KSP
ex3.c: Solves a linear system in parallel with KSP
ex4.c: Uses a different preconditioner matrix and linear system matrix in the KSP solvers
ex5.c: Solves two linear systems in parallel with KSP
ex7.c: Block Jacobi preconditioner for solving a linear system in parallel with KSP
ex8.c: Illustrates use of the preconditioner ASM
ex9.c: The solution of 2 different linear systems with different linear solvers
ex10.c: Reads a PETSc matrix and vector from a file and solves a linear system
ex11.c: Solves a linear system in parallel with KSP
ex12.c: Solves a linear system in parallel with KSP
ex13.c: Solves a variable Poisson problem with KSP
ex15.c: Solves a linear system in parallel with KSP
ex16.c: Solves a sequence of linear systems with different right-hand-side vectors
ex22.c: Solves 3D Laplacian using multigrid
ex23.c: Solves a tridiagonal linear system
ex25.c: Solves 1D variable coefficient Laplacian using multigrid
ex27.c: Reads a PETSc matrix and vector from a file and solves the normal equations
ex28.c: Solves 1D wave equation using multigrid
ex29.c: Solves 2D inhomogeneous Laplacian using multigrid
ex32.c: Solves 2D inhomogeneous Laplacian using multigrid
ex33.c: Solves 2D inhomogeneous Laplacian using multigrid
ex34.c: Solves 3D Laplacian using multigrid
makefile