petsc-3.12.1 2019-10-22
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: This example demonstrates the use of DMNetwork interface for solving a simple electric circuit
ex2.c: This example is based on ex1
ex1_nest.c: This example is based on ex1 using MATNEST
makefile