/docs/manualpages/concepts/ksp.html
HTML | 291 lines | 291 code | 0 blank | 0 comment | 0 complexity | 4cf5931eba1ed16d858335ffc53ea705 MD5 | raw file
- <html>
- <title>KSP</title><body bgcolor="FFFFFF">
- <div id="version" align=right><b>petsc-3.3-p3 2012-08-29</b></div>
- <h2>KSP</h2>
- <menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex1.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
- <menu>
- Solves a tridiagonal linear system with KSP.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex12.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
- <menu>
- Solves a linear system in parallel with KSP.<BR>Input parameters include:<BR>
- -m <mesh_x> : number of mesh points in x-direction<BR>
- -n <mesh_n> : number of mesh points in y-direction<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex1f.F.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
- <menu>
- <BR>
- Description: Solves a tridiagonal linear system with KSP.<BR>
- <BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex29.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
- <menu>
- Solves 2D inhomogeneous Laplacian using multigrid.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex31.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
- <menu>
- Solves 2D compressible Euler using multigrid.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex32.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
- <menu>
- Solves 2D inhomogeneous Laplacian using multigrid.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex34.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
- <menu>
- Solves 3D Laplacian using multigrid.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex54f.F.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
- <menu>
- <BR>
- Description: Solve Ax=b. A comes from an anisotropic 2D thermal problem with Q1 FEM on domain (-1,1)^2.<BR>
- Material conductivity given by tensor:<BR>
- <BR>
- D = | 1 0 |<BR>
- | 0 epsilon |<BR>
- <BR>
- rotated by angle 'theta' (-theta <90> in degrees) with anisotropic parameter 'epsilon' (-epsilon <0.0>).<BR>
- Blob right hand side centered at C (-blob_center C(1),C(2) <0,0>)<BR>
- Dirichlet BCs on y=-1 face.<BR>
- <BR>
- -out_matlab will generate binary files for A,x,b and a ex54f.m file that reads them and plots them in matlab.<BR>
- <BR>
- User can change anisotropic shape with function ex54_psi(). Negative theta will switch to a circular anisotropy.<BR>
- <BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex58.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
- <menu>
- Solves a tridiagonal linear system with KSP.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex2.c.html"><CONCEPT>basic parallel example;</CONCEPT></A>
- <menu>
- Solves a linear system in parallel with KSP.<BR>Input parameters include:<BR>
- -random_exact_sol : use a random exact solution vector<BR>
- -view_exact_sol : write exact solution vector to stdout<BR>
- -m <mesh_x> : number of mesh points in x-direction<BR>
- -n <mesh_n> : number of mesh points in y-direction<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex23.c.html"><CONCEPT>basic parallel example;</CONCEPT></A>
- <menu>
- Solves a tridiagonal linear system.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex46.c.html"><CONCEPT>basic parallel example;</CONCEPT></A>
- <menu>
- Solves a linear system in parallel with KSP and DM.<BR>Compare this to ex2 which solves the same problem without a DM.<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex12.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
- <menu>
- Solves a linear system in parallel with KSP.<BR>Input parameters include:<BR>
- -m <mesh_x> : number of mesh points in x-direction<BR>
- -n <mesh_n> : number of mesh points in y-direction<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex13.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
- <menu>
- Solves a variable Poisson problem with KSP.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex13f90.F.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
- <menu>
- <BR>
- <BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex16.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
- <menu>
- Solves a sequence of linear systems with different right-hand-side vectors.<BR>Input parameters include:<BR>
- -ntimes <ntimes> : number of linear systems to solve<BR>
- -view_exact_sol : write exact solution vector to stdout<BR>
- -m <mesh_x> : number of mesh points in x-direction<BR>
- -n <mesh_n> : number of mesh points in y-direction<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex2.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
- <menu>
- Solves a linear system in parallel with KSP.<BR>Input parameters include:<BR>
- -random_exact_sol : use a random exact solution vector<BR>
- -view_exact_sol : write exact solution vector to stdout<BR>
- -m <mesh_x> : number of mesh points in x-direction<BR>
- -n <mesh_n> : number of mesh points in y-direction<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex29.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
- <menu>
- Solves 2D inhomogeneous Laplacian using multigrid.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex32.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
- <menu>
- Solves 2D inhomogeneous Laplacian using multigrid.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex46.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
- <menu>
- Solves a linear system in parallel with KSP and DM.<BR>Compare this to ex2 which solves the same problem without a DM.<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex15.c.html"><CONCEPT>basic parallel example</CONCEPT></A>
- <menu>
- Solves a linear system in parallel with KSP. Also<BR>illustrates setting a user-defined shell preconditioner and using the<BR>
- macro __FUNCT__ to define routine names for use in error handling.<BR>
- Input parameters include:<BR>
- -user_defined_pc : Activate a user-defined preconditioner<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex15f.F.html"><CONCEPT>basic parallel example</CONCEPT></A>
- <menu>
- <BR>
- Solves a linear system in parallel with KSP. Also indicates<BR>
- use of a user-provided preconditioner. Input parameters include:<BR>
- -user_defined_pc : Activate a user-defined preconditioner<BR>
- <BR>
- Program usage: mpiexec ex15f [-help] [all PETSc options]<BR>
- <BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex21f.F.html"><CONCEPT>basic parallel example</CONCEPT></A>
- <menu>
- <BR>
- Solves a linear system in parallel with KSP. Also indicates<BR>
- use of a user-provided preconditioner. Input parameters include:<BR>
- <BR>
- Program usage: mpiexec ex21f [-help] [all PETSc options]<BR>
- <BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex2f.F.html"><CONCEPT>basic parallel example</CONCEPT></A>
- <menu>
- <BR>
- Description: Solves a linear system in parallel with KSP (Fortran code).<BR>
- Also shows how to set a user-defined monitoring routine.<BR>
- <BR>
- Program usage: mpiexec -n <procs> ex2f [-help] [all PETSc options]<BR>
- <BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex3.c.html"><CONCEPT>basic parallel example</CONCEPT></A>
- <menu>
- Solves a linear system in parallel with KSP. The matrix<BR>uses simple bilinear elements on the unit square. To test the parallel<BR>
- matrix assembly, the matrix is intentionally laid out across processors<BR>
- differently from the way it is assembled. Input arguments are:<BR>
- -m <size> : problem size<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex16.c.html"><CONCEPT>repeatedly solving linear systems;</CONCEPT></A>
- <menu>
- Solves a sequence of linear systems with different right-hand-side vectors.<BR>Input parameters include:<BR>
- -ntimes <ntimes> : number of linear systems to solve<BR>
- -view_exact_sol : write exact solution vector to stdout<BR>
- -m <mesh_x> : number of mesh points in x-direction<BR>
- -n <mesh_n> : number of mesh points in y-direction<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex5.c.html"><CONCEPT>repeatedly solving linear systems;</CONCEPT></A>
- <menu>
- Solves two linear systems in parallel with KSP. The code<BR>illustrates repeated solution of linear systems with the same preconditioner<BR>
- method but different matrices (having the same nonzero structure). The code<BR>
- also uses multiple profiling stages. Input arguments are<BR>
- -m <size> : problem size<BR>
- -mat_nonsym : use nonsymmetric matrix (default is symmetric)<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex6f.F.html"><CONCEPT>repeatedly solving linear systems;</CONCEPT></A>
- <menu>
- <BR>
- Description: This example demonstrates repeated linear solves as<BR>
- well as the use of different preconditioner and linear system<BR>
- matrices. This example also illustrates how to save PETSc objects<BR>
- in common blocks.<BR>
- <BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex9.c.html"><CONCEPT>repeatedly solving linear systems;</CONCEPT></A>
- <menu>
- The solution of 2 different linear systems with different linear solvers.<BR>Also, this example illustrates the repeated<BR>
- solution of linear systems, while reusing matrix, vector, and solver data<BR>
- structures throughout the process. Note the various stages of event logging.<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex7.c.html"><CONCEPT>customizing the block Jacobi preconditioner</CONCEPT></A>
- <menu>
- Block Jacobi preconditioner for solving a linear system in parallel with KSP.<BR>The code indicates the<BR>
- procedures for setting the particular block sizes and for using different<BR>
- linear solvers on the individual blocks.<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex8.c.html"><CONCEPT>Additive Schwarz Method (ASM) with user-defined subdomains</CONCEPT></A>
- <menu>
- Illustrates use of the preconditioner ASM.<BR>The Additive Schwarz Method for solving a linear system in parallel with KSP. The<BR>
- code indicates the procedure for setting user-defined subdomains. Input<BR>
- parameters include:<BR>
- -user_set_subdomain_solvers: User explicitly sets subdomain solvers<BR>
- -user_set_subdomains: Activate user-defined subdomains<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex8g.c.html"><CONCEPT>Additive Schwarz Method (GASM) with user-defined subdomains</CONCEPT></A>
- <menu>
- Illustrates use of the preconditioner GASM.<BR>The Additive Schwarz Method for solving a linear system in parallel with KSP. The<BR>
- code indicates the procedure for setting user-defined subdomains. Input<BR>
- parameters include:<BR>
- -M: Number of mesh points in the x direction<BR>
- -N: Number of mesh points in the y direction<BR>
- -user_set_subdomain_solvers: User explicitly sets subdomain solvers<BR>
- -user_set_subdomains: Use the user-provided subdomain partitioning routine<BR>
- With -user_set_subdomains on, the following options are meaningful:<BR>
- -Mdomains: Number of subdomains in the x direction <BR>
- -Ndomains: Number of subdomains in the y direction <BR>
- -overlap: Size of domain overlap in terms of the number of mesh lines in x and y<BR>
- General useful options:<BR>
- -pc_gasm_print_subdomains: Print the index sets defining the subdomains<BR>
- <BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex10.c.html"><CONCEPT>solving a linear system</CONCEPT></A>
- <menu>
- Reads a PETSc matrix and vector from a file and solves a linear system.<BR>This version first preloads and solves a small system, then loads <BR>
- another (larger) system and solves it as well. This example illustrates<BR>
- preloading of instructions with the smaller system so that more accurate<BR>
- performance monitoring can be done with the larger one (that actually<BR>
- is the system of interest). See the 'Performance Hints' chapter of the<BR>
- users manual for a discussion of preloading. Input parameters include<BR>
- -f0 <input_file> : first file to load (small system)<BR>
- -f1 <input_file> : second file to load (larger system)<BR>
- -trans : solve transpose system instead<BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex27.c.html"><CONCEPT>solving a linear system</CONCEPT></A>
- <menu>
- Reads a PETSc matrix and vector from a file and solves the normal equations.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex41.c.html"><CONCEPT>solving a linear system</CONCEPT></A>
- <menu>
- Reads a PETSc matrix and vector from a socket connection, solves a linear system and sends the result back.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex11.c.html"><CONCEPT>solving a Helmholtz equation</CONCEPT></A>
- <menu>
- Solves a linear system in parallel with KSP.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex11f.F.html"><CONCEPT>solving a Helmholtz equation</CONCEPT></A>
- <menu>
- <BR>
- Description: Solves a complex linear system in parallel with KSP (Fortran code).<BR>
- <BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex13.c.html"><CONCEPT>basic sequential example</CONCEPT></A>
- <menu>
- Solves a variable Poisson problem with KSP.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex13f90.F.html"><CONCEPT>basic sequential example</CONCEPT></A>
- <menu>
- <BR>
- <BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex31.c.html"><CONCEPT>semi-implicit</CONCEPT></A>
- <menu>
- Solves 2D compressible Euler using multigrid.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex34.c.html"><CONCEPT>Laplacian, 3d</CONCEPT></A>
- <menu>
- Solves 3D Laplacian using multigrid.<BR></menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex2f.F.html"><CONCEPT>setting a user-defined monitoring routine</CONCEPT></A>
- <menu>
- <BR>
- Description: Solves a linear system in parallel with KSP (Fortran code).<BR>
- Also shows how to set a user-defined monitoring routine.<BR>
- <BR>
- Program usage: mpiexec -n <procs> ex2f [-help] [all PETSc options]<BR>
- <BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex6f.F.html"><CONCEPT>different matrices for linear system and preconditioner;</CONCEPT></A>
- <menu>
- <BR>
- Description: This example demonstrates repeated linear solves as<BR>
- well as the use of different preconditioner and linear system<BR>
- matrices. This example also illustrates how to save PETSc objects<BR>
- in common blocks.<BR>
- <BR>
- </menu>
- <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex14f.F.html"><CONCEPT>writing a user-defined nonlinear solver</CONCEPT></A>
- <menu>
- <BR>
- <BR>
- Solves a nonlinear system in parallel with a user-defined<BR>
- Newton method that uses KSP to solve the linearized Newton sytems. This solver<BR>
- is a very simplistic inexact Newton method. The intent of this code is to<BR>
- demonstrate the repeated solution of linear sytems with the same nonzero pattern.<BR>
- <BR>
- This is NOT the recommended approach for solving nonlinear problems with PETSc!<BR>
- We urge users to employ the SNES component for solving nonlinear problems whenever<BR>
- possible, as it offers many advantages over coding nonlinear solvers independently.<BR>
- <BR>
- We solve the Bratu (SFI - solid fuel ignition) problem in a 2D rectangular<BR>
- domain, using distributed arrays (DMDAs) to partition the parallel grid.<BR>
- <BR>
- </menu>
- </menu>
- </body>
- </html>