## KSP

- <CONCEPT>solving a system of linear equations</CONCEPT> Solves a tridiagonal linear system with KSP.
- <CONCEPT>solving a system of linear equations</CONCEPT> Solves a linear system in parallel with KSP.
  Input parameters include:
  -m <mesh_x> : number of mesh points in x-direction
  -n <mesh_n> : number of mesh points in y-direction
- <CONCEPT>solving a system of linear equations</CONCEPT>
  Description: Solves a tridiagonal linear system with KSP.
- <CONCEPT>solving a system of linear equations</CONCEPT> Solves 2D inhomogeneous Laplacian using multigrid.
- <CONCEPT>solving a system of linear equations</CONCEPT> Solves 2D inhomogeneous Laplacian using multigrid.
- <CONCEPT>solving a system of linear equations</CONCEPT> Solves 2D inhomogeneous Laplacian using multigrid.
- <CONCEPT>solving a system of linear equations</CONCEPT> Solves 3D Laplacian using multigrid.
- <CONCEPT>basic parallel example;</CONCEPT> Solves a linear system in parallel with KSP.
  Input parameters include:
  -random_exact_sol : use a random exact solution vector
  -view_exact_sol : write exact solution vector to stdout
  -m <mesh_x> : number of mesh points in x-direction
  -n <mesh_n> : number of mesh points in y-direction
- <CONCEPT>basic parallel example;</CONCEPT> Solves a tridiagonal linear system.
- <CONCEPT>Laplacian, 2d</CONCEPT> Solves a linear system in parallel with KSP.
  Input parameters include:
  -m <mesh_x> : number of mesh points in x-direction
  -n <mesh_n> : number of mesh points in y-direction
- <CONCEPT>Laplacian, 2d</CONCEPT> Solves a variable Poisson problem with KSP.
- <CONCEPT>Laplacian, 2d</CONCEPT>
- <CONCEPT>Laplacian, 2d</CONCEPT> Solves a sequence of linear systems with different right-hand-side vectors.
  Input parameters include:
  -ntimes <ntimes> : number of linear systems to solve
  -view_exact_sol : write exact solution vector to stdout
  -m <mesh_x> : number of mesh points in x-direction
  -n <mesh_n> : number of mesh points in y-direction
- <CONCEPT>Laplacian, 2d</CONCEPT> Solves a linear system in parallel with KSP.
  Input parameters include:
  -random_exact_sol : use a random exact solution vector
  -view_exact_sol : write exact solution vector to stdout
  -m <mesh_x> : number of mesh points in x-direction
  -n <mesh_n> : number of mesh points in y-direction
- <CONCEPT>Laplacian, 2d</CONCEPT> Solves 2D inhomogeneous Laplacian using multigrid.
- <CONCEPT>Laplacian, 2d</CONCEPT> Solves 2D inhomogeneous Laplacian using multigrid.
- <CONCEPT>Laplacian, 2d</CONCEPT> Solves 2D inhomogeneous Laplacian using multigrid.
- <CONCEPT>basic parallel example</CONCEPT> Solves a linear system in parallel with KSP. Also
  illustrates setting a user-defined shell preconditioner and using the
  macro __FUNCT__ to define routine names for use in error handling.
  Input parameters include:
  -user_defined_pc : Activate a user-defined preconditioner
- <CONCEPT>basic parallel example</CONCEPT>
  Solves a linear system in parallel with KSP. Also indicates
  use of a user-provided preconditioner. Input parameters include:
  -user_defined_pc : Activate a user-defined preconditioner
  Program usage: mpiexec ex15f [-help] [all PETSc options]
- <CONCEPT>basic parallel example</CONCEPT>
  Solves a linear system in parallel with KSP. Also indicates
  use of a user-provided preconditioner. Input parameters include:
  Program usage: mpiexec ex21f [-help] [all PETSc options]
- <CONCEPT>basic parallel example</CONCEPT>
  Description: Solves a linear system in parallel with KSP (Fortran code).
  Also shows how to set a user-defined monitoring routine.
  Program usage: mpiexec -np <procs> ex2f [-help] [all PETSc options]
- <CONCEPT>basic parallel example</CONCEPT> Solves a linear system in parallel with KSP. The matrix
  uses simple bilinear elements on the unit square. To test the parallel
  matrix assembly, the matrix is intentionally laid out across processors
  differently from the way it is assembled. Input arguments are:
  -m <size> : problem size
- <CONCEPT>different matrices for linear system and preconditioner;</CONCEPT> Uses a different preconditioner matrix and linear system matrix in the KSP solvers.
  Note that different storage formats
  can be used for the different matrices.
- <CONCEPT>different matrices for linear system and preconditioner;</CONCEPT>
  Description: This example demonstrates repeated linear solves as
  well as the use of different preconditioner and linear system
  matrices. This example also illustrates how to save PETSc objects
  in common blocks.
- <CONCEPT>repeatedly solving linear systems;</CONCEPT> Solves a sequence of linear systems with different right-hand-side vectors.
  Input parameters include:
  -ntimes <ntimes> : number of linear systems to solve
  -view_exact_sol : write exact solution vector to stdout
  -m <mesh_x> : number of mesh points in x-direction
  -n <mesh_n> : number of mesh points in y-direction
- <CONCEPT>repeatedly solving linear systems;</CONCEPT> Solves two linear systems in parallel with KSP. The code
  illustrates repeated solution of linear systems with the same preconditioner
  method but different matrices (having the same nonzero structure). The code
  also uses multiple profiling stages. Input arguments are
  -m <size> : problem size
  -mat_nonsym : use nonsymmetric matrix (default is symmetric)
- <CONCEPT>repeatedly solving linear systems;</CONCEPT>
  Description: This example demonstrates repeated linear solves as
  well as the use of different preconditioner and linear system
  matrices. This example also illustrates how to save PETSc objects
  in common blocks.
- <CONCEPT>repeatedly solving linear systems;</CONCEPT> The solution of 2 different linear systems with different linear solvers.
  Also, this example illustrates the repeated
  solution of linear systems, while reusing matrix, vector, and solver data
  structures throughout the process. Note the various stages of event logging.
- <CONCEPT>customizing the block Jacobi preconditioner</CONCEPT> Block Jacobi preconditioner for solving a linear system in parallel with KSP.
  The code indicates the
  procedures for setting the particular block sizes and for using different
  linear solvers on the individual blocks.
- <CONCEPT>Additive Schwarz Method (ASM) with user-defined subdomains</CONCEPT> Illustrates use of the preconditioner ASM.
  The Additive Schwarz Method for solving a linear system in parallel with KSP. The
  code indicates the procedure for setting user-defined subdomains. Input
  parameters include:
  -user_set_subdomain_solvers: User explicitly sets subdomain solvers
  -user_set_subdomains: Activate user-defined subdomains
- <CONCEPT>solving a linear system</CONCEPT> Reads a PETSc matrix and vector from a file and solves a linear system.
  This version first preloads and solves a small system, then loads
  another (larger) system and solves it as well. This example illustrates
  preloading of instructions with the smaller system so that more accurate
  performance monitoring can be done with the larger one (that actually
  is the system of interest). See the 'Performance Hints' chapter of the
  users manual for a discussion of preloading. Input parameters include
  -f0 <input_file> : first file to load (small system)
  -f1 <input_file> : second file to load (larger system)
  -trans : solve transpose system instead
- <CONCEPT>solving a linear system</CONCEPT> Reads a PETSc matrix and vector from a file and solves the normal equations.
- <CONCEPT>solving a Helmholtz equation</CONCEPT> Solves a linear system in parallel with KSP.
- <CONCEPT>solving a Helmholtz equation</CONCEPT>
  Description: Solves a complex linear system in parallel with KSP (Fortran code).
- <CONCEPT>basic sequential example</CONCEPT> Solves a variable Poisson problem with KSP.
- <CONCEPT>basic sequential example</CONCEPT>
- <CONCEPT>Laplacian, 3d</CONCEPT> Solves 3D Laplacian using multigrid.
- <CONCEPT>setting a user-defined monitoring routine</CONCEPT>
  Description: Solves a linear system in parallel with KSP (Fortran code).
  Also shows how to set a user-defined monitoring routine.
  Program usage: mpiexec -np <procs> ex2f [-help] [all PETSc options]
- <CONCEPT>writing a user-defined nonlinear solver</CONCEPT>
  Solves a nonlinear system in parallel with a user-defined
  Newton method that uses KSP to solve the linearized Newton sytems. This solver
  is a very simplistic inexact Newton method. The intent of this code is to
  demonstrate the repeated solution of linear sytems with the same nonzero pattern.
  This is NOT the recommended approach for solving nonlinear problems with PETSc!
  We urge users to employ the SNES component for solving nonlinear problems whenever
  possible, as it offers many advantages over coding nonlinear solvers independently.
  We solve the Bratu (SFI - solid fuel ignition) problem in a 2D rectangular
  domain, using distributed arrays (DAs) to partition the parallel grid.