petsc-3.6.1 2015-08-06
Preconditioners - PC: 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 preconditioning
options at runtime via the options database (e.g.,
-pc_type jacobi
).
KSP users can also set PC options directly in application
codes by first extracting the PC context from the KSP context via
KSPGetPC()
and then directly calling the PC routines listed below (e.g.,
PCSetType()
).
PC components can be used directly to create and
destroy solvers; this is not needed for users but
is for library developers.
ex1.c: Tests the creation of a PC context
ex2.c: Tests PC and KSP on a tridiagonal matrix
ex3.c: Demonstrates the use of fast Richardson for SOR
ex4.c: Demonstrates the use of fast Richardson for SOR
ex5.c: Tests the multigrid code
ex6.c: Creates a matrix using 9 pt stencil, and uses it to test MatIncreaseOverlap (needed for aditive schwarts preconditioner
ex7.c: Tests MatILUFactorSymbolic() on matrix with missing diagonal
makefile