PageRenderTime 28ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/docs/manualpages/concepts/ksp.html

https://bitbucket.org/alexei-matveev/petsc-debian-pkg
HTML | 291 lines | 291 code | 0 blank | 0 comment | 0 complexity | 4cf5931eba1ed16d858335ffc53ea705 MD5 | raw file
  1. <html>
  2. <title>KSP</title><body bgcolor="FFFFFF">
  3. <div id="version" align=right><b>petsc-3.3-p3 2012-08-29</b></div>
  4. <h2>KSP</h2>
  5. <menu>
  6. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex1.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
  7. <menu>
  8. Solves a tridiagonal linear system with KSP.<BR></menu>
  9. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex12.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
  10. <menu>
  11. Solves a linear system in parallel with KSP.<BR>Input parameters include:<BR>
  12. -m &lt;mesh_x&gt; : number of mesh points in x-direction<BR>
  13. -n &lt;mesh_n&gt; : number of mesh points in y-direction<BR>
  14. </menu>
  15. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex1f.F.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
  16. <menu>
  17. <BR>
  18. Description: Solves a tridiagonal linear system with KSP.<BR>
  19. <BR>
  20. </menu>
  21. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex29.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
  22. <menu>
  23. Solves 2D inhomogeneous Laplacian using multigrid.<BR></menu>
  24. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex31.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
  25. <menu>
  26. Solves 2D compressible Euler using multigrid.<BR></menu>
  27. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex32.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
  28. <menu>
  29. Solves 2D inhomogeneous Laplacian using multigrid.<BR></menu>
  30. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex34.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
  31. <menu>
  32. Solves 3D Laplacian using multigrid.<BR></menu>
  33. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex54f.F.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
  34. <menu>
  35. <BR>
  36. Description: Solve Ax=b. A comes from an anisotropic 2D thermal problem with Q1 FEM on domain (-1,1)^2.<BR>
  37. Material conductivity given by tensor:<BR>
  38. <BR>
  39. D = | 1 0 |<BR>
  40. | 0 epsilon |<BR>
  41. <BR>
  42. rotated by angle 'theta' (-theta &lt;90&gt; in degrees) with anisotropic parameter 'epsilon' (-epsilon &lt;0.0&gt;).<BR>
  43. Blob right hand side centered at C (-blob_center C(1),C(2) &lt;0,0&gt;)<BR>
  44. Dirichlet BCs on y=-1 face.<BR>
  45. <BR>
  46. -out_matlab will generate binary files for A,x,b and a ex54f.m file that reads them and plots them in matlab.<BR>
  47. <BR>
  48. User can change anisotropic shape with function ex54_psi(). Negative theta will switch to a circular anisotropy.<BR>
  49. <BR>
  50. </menu>
  51. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex58.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
  52. <menu>
  53. Solves a tridiagonal linear system with KSP.<BR></menu>
  54. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex2.c.html"><CONCEPT>basic parallel example;</CONCEPT></A>
  55. <menu>
  56. Solves a linear system in parallel with KSP.<BR>Input parameters include:<BR>
  57. -random_exact_sol : use a random exact solution vector<BR>
  58. -view_exact_sol : write exact solution vector to stdout<BR>
  59. -m &lt;mesh_x&gt; : number of mesh points in x-direction<BR>
  60. -n &lt;mesh_n&gt; : number of mesh points in y-direction<BR>
  61. </menu>
  62. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex23.c.html"><CONCEPT>basic parallel example;</CONCEPT></A>
  63. <menu>
  64. Solves a tridiagonal linear system.<BR></menu>
  65. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex46.c.html"><CONCEPT>basic parallel example;</CONCEPT></A>
  66. <menu>
  67. Solves a linear system in parallel with KSP and DM.<BR>Compare this to ex2 which solves the same problem without a DM.<BR>
  68. </menu>
  69. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex12.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
  70. <menu>
  71. Solves a linear system in parallel with KSP.<BR>Input parameters include:<BR>
  72. -m &lt;mesh_x&gt; : number of mesh points in x-direction<BR>
  73. -n &lt;mesh_n&gt; : number of mesh points in y-direction<BR>
  74. </menu>
  75. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex13.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
  76. <menu>
  77. Solves a variable Poisson problem with KSP.<BR></menu>
  78. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex13f90.F.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
  79. <menu>
  80. <BR>
  81. <BR>
  82. </menu>
  83. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex16.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
  84. <menu>
  85. Solves a sequence of linear systems with different right-hand-side vectors.<BR>Input parameters include:<BR>
  86. -ntimes &lt;ntimes&gt; : number of linear systems to solve<BR>
  87. -view_exact_sol : write exact solution vector to stdout<BR>
  88. -m &lt;mesh_x&gt; : number of mesh points in x-direction<BR>
  89. -n &lt;mesh_n&gt; : number of mesh points in y-direction<BR>
  90. </menu>
  91. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex2.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
  92. <menu>
  93. Solves a linear system in parallel with KSP.<BR>Input parameters include:<BR>
  94. -random_exact_sol : use a random exact solution vector<BR>
  95. -view_exact_sol : write exact solution vector to stdout<BR>
  96. -m &lt;mesh_x&gt; : number of mesh points in x-direction<BR>
  97. -n &lt;mesh_n&gt; : number of mesh points in y-direction<BR>
  98. </menu>
  99. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex29.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
  100. <menu>
  101. Solves 2D inhomogeneous Laplacian using multigrid.<BR></menu>
  102. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex32.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
  103. <menu>
  104. Solves 2D inhomogeneous Laplacian using multigrid.<BR></menu>
  105. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex46.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
  106. <menu>
  107. Solves a linear system in parallel with KSP and DM.<BR>Compare this to ex2 which solves the same problem without a DM.<BR>
  108. </menu>
  109. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex15.c.html"><CONCEPT>basic parallel example</CONCEPT></A>
  110. <menu>
  111. Solves a linear system in parallel with KSP. Also<BR>illustrates setting a user-defined shell preconditioner and using the<BR>
  112. macro __FUNCT__ to define routine names for use in error handling.<BR>
  113. Input parameters include:<BR>
  114. -user_defined_pc : Activate a user-defined preconditioner<BR>
  115. </menu>
  116. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex15f.F.html"><CONCEPT>basic parallel example</CONCEPT></A>
  117. <menu>
  118. <BR>
  119. Solves a linear system in parallel with KSP. Also indicates<BR>
  120. use of a user-provided preconditioner. Input parameters include:<BR>
  121. -user_defined_pc : Activate a user-defined preconditioner<BR>
  122. <BR>
  123. Program usage: mpiexec ex15f [-help] [all PETSc options]<BR>
  124. <BR>
  125. </menu>
  126. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex21f.F.html"><CONCEPT>basic parallel example</CONCEPT></A>
  127. <menu>
  128. <BR>
  129. Solves a linear system in parallel with KSP. Also indicates<BR>
  130. use of a user-provided preconditioner. Input parameters include:<BR>
  131. <BR>
  132. Program usage: mpiexec ex21f [-help] [all PETSc options]<BR>
  133. <BR>
  134. </menu>
  135. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex2f.F.html"><CONCEPT>basic parallel example</CONCEPT></A>
  136. <menu>
  137. <BR>
  138. Description: Solves a linear system in parallel with KSP (Fortran code).<BR>
  139. Also shows how to set a user-defined monitoring routine.<BR>
  140. <BR>
  141. Program usage: mpiexec -n &lt;procs&gt; ex2f [-help] [all PETSc options]<BR>
  142. <BR>
  143. </menu>
  144. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex3.c.html"><CONCEPT>basic parallel example</CONCEPT></A>
  145. <menu>
  146. Solves a linear system in parallel with KSP. The matrix<BR>uses simple bilinear elements on the unit square. To test the parallel<BR>
  147. matrix assembly, the matrix is intentionally laid out across processors<BR>
  148. differently from the way it is assembled. Input arguments are:<BR>
  149. -m &lt;size&gt; : problem size<BR>
  150. </menu>
  151. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex16.c.html"><CONCEPT>repeatedly solving linear systems;</CONCEPT></A>
  152. <menu>
  153. Solves a sequence of linear systems with different right-hand-side vectors.<BR>Input parameters include:<BR>
  154. -ntimes &lt;ntimes&gt; : number of linear systems to solve<BR>
  155. -view_exact_sol : write exact solution vector to stdout<BR>
  156. -m &lt;mesh_x&gt; : number of mesh points in x-direction<BR>
  157. -n &lt;mesh_n&gt; : number of mesh points in y-direction<BR>
  158. </menu>
  159. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex5.c.html"><CONCEPT>repeatedly solving linear systems;</CONCEPT></A>
  160. <menu>
  161. Solves two linear systems in parallel with KSP. The code<BR>illustrates repeated solution of linear systems with the same preconditioner<BR>
  162. method but different matrices (having the same nonzero structure). The code<BR>
  163. also uses multiple profiling stages. Input arguments are<BR>
  164. -m &lt;size&gt; : problem size<BR>
  165. -mat_nonsym : use nonsymmetric matrix (default is symmetric)<BR>
  166. </menu>
  167. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex6f.F.html"><CONCEPT>repeatedly solving linear systems;</CONCEPT></A>
  168. <menu>
  169. <BR>
  170. Description: This example demonstrates repeated linear solves as<BR>
  171. well as the use of different preconditioner and linear system<BR>
  172. matrices. This example also illustrates how to save PETSc objects<BR>
  173. in common blocks.<BR>
  174. <BR>
  175. </menu>
  176. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex9.c.html"><CONCEPT>repeatedly solving linear systems;</CONCEPT></A>
  177. <menu>
  178. The solution of 2 different linear systems with different linear solvers.<BR>Also, this example illustrates the repeated<BR>
  179. solution of linear systems, while reusing matrix, vector, and solver data<BR>
  180. structures throughout the process. Note the various stages of event logging.<BR>
  181. </menu>
  182. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex7.c.html"><CONCEPT>customizing the block Jacobi preconditioner</CONCEPT></A>
  183. <menu>
  184. Block Jacobi preconditioner for solving a linear system in parallel with KSP.<BR>The code indicates the<BR>
  185. procedures for setting the particular block sizes and for using different<BR>
  186. linear solvers on the individual blocks.<BR>
  187. </menu>
  188. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex8.c.html"><CONCEPT>Additive Schwarz Method (ASM) with user-defined subdomains</CONCEPT></A>
  189. <menu>
  190. Illustrates use of the preconditioner ASM.<BR>The Additive Schwarz Method for solving a linear system in parallel with KSP. The<BR>
  191. code indicates the procedure for setting user-defined subdomains. Input<BR>
  192. parameters include:<BR>
  193. -user_set_subdomain_solvers: User explicitly sets subdomain solvers<BR>
  194. -user_set_subdomains: Activate user-defined subdomains<BR>
  195. </menu>
  196. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex8g.c.html"><CONCEPT>Additive Schwarz Method (GASM) with user-defined subdomains</CONCEPT></A>
  197. <menu>
  198. Illustrates use of the preconditioner GASM.<BR>The Additive Schwarz Method for solving a linear system in parallel with KSP. The<BR>
  199. code indicates the procedure for setting user-defined subdomains. Input<BR>
  200. parameters include:<BR>
  201. -M: Number of mesh points in the x direction<BR>
  202. -N: Number of mesh points in the y direction<BR>
  203. -user_set_subdomain_solvers: User explicitly sets subdomain solvers<BR>
  204. -user_set_subdomains: Use the user-provided subdomain partitioning routine<BR>
  205. With -user_set_subdomains on, the following options are meaningful:<BR>
  206. -Mdomains: Number of subdomains in the x direction <BR>
  207. -Ndomains: Number of subdomains in the y direction <BR>
  208. -overlap: Size of domain overlap in terms of the number of mesh lines in x and y<BR>
  209. General useful options:<BR>
  210. -pc_gasm_print_subdomains: Print the index sets defining the subdomains<BR>
  211. <BR>
  212. </menu>
  213. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex10.c.html"><CONCEPT>solving a linear system</CONCEPT></A>
  214. <menu>
  215. 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>
  216. another (larger) system and solves it as well. This example illustrates<BR>
  217. preloading of instructions with the smaller system so that more accurate<BR>
  218. performance monitoring can be done with the larger one (that actually<BR>
  219. is the system of interest). See the 'Performance Hints' chapter of the<BR>
  220. users manual for a discussion of preloading. Input parameters include<BR>
  221. -f0 &lt;input_file&gt; : first file to load (small system)<BR>
  222. -f1 &lt;input_file&gt; : second file to load (larger system)<BR>
  223. -trans : solve transpose system instead<BR>
  224. </menu>
  225. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex27.c.html"><CONCEPT>solving a linear system</CONCEPT></A>
  226. <menu>
  227. Reads a PETSc matrix and vector from a file and solves the normal equations.<BR></menu>
  228. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex41.c.html"><CONCEPT>solving a linear system</CONCEPT></A>
  229. <menu>
  230. Reads a PETSc matrix and vector from a socket connection, solves a linear system and sends the result back.<BR></menu>
  231. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex11.c.html"><CONCEPT>solving a Helmholtz equation</CONCEPT></A>
  232. <menu>
  233. Solves a linear system in parallel with KSP.<BR></menu>
  234. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex11f.F.html"><CONCEPT>solving a Helmholtz equation</CONCEPT></A>
  235. <menu>
  236. <BR>
  237. Description: Solves a complex linear system in parallel with KSP (Fortran code).<BR>
  238. <BR>
  239. </menu>
  240. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex13.c.html"><CONCEPT>basic sequential example</CONCEPT></A>
  241. <menu>
  242. Solves a variable Poisson problem with KSP.<BR></menu>
  243. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex13f90.F.html"><CONCEPT>basic sequential example</CONCEPT></A>
  244. <menu>
  245. <BR>
  246. <BR>
  247. </menu>
  248. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex31.c.html"><CONCEPT>semi-implicit</CONCEPT></A>
  249. <menu>
  250. Solves 2D compressible Euler using multigrid.<BR></menu>
  251. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex34.c.html"><CONCEPT>Laplacian, 3d</CONCEPT></A>
  252. <menu>
  253. Solves 3D Laplacian using multigrid.<BR></menu>
  254. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex2f.F.html"><CONCEPT>setting a user-defined monitoring routine</CONCEPT></A>
  255. <menu>
  256. <BR>
  257. Description: Solves a linear system in parallel with KSP (Fortran code).<BR>
  258. Also shows how to set a user-defined monitoring routine.<BR>
  259. <BR>
  260. Program usage: mpiexec -n &lt;procs&gt; ex2f [-help] [all PETSc options]<BR>
  261. <BR>
  262. </menu>
  263. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex6f.F.html"><CONCEPT>different matrices for linear system and preconditioner;</CONCEPT></A>
  264. <menu>
  265. <BR>
  266. Description: This example demonstrates repeated linear solves as<BR>
  267. well as the use of different preconditioner and linear system<BR>
  268. matrices. This example also illustrates how to save PETSc objects<BR>
  269. in common blocks.<BR>
  270. <BR>
  271. </menu>
  272. <LI><A HREF="../../../src/ksp/ksp/examples/tutorials/ex14f.F.html"><CONCEPT>writing a user-defined nonlinear solver</CONCEPT></A>
  273. <menu>
  274. <BR>
  275. <BR>
  276. Solves a nonlinear system in parallel with a user-defined<BR>
  277. Newton method that uses KSP to solve the linearized Newton sytems. This solver<BR>
  278. is a very simplistic inexact Newton method. The intent of this code is to<BR>
  279. demonstrate the repeated solution of linear sytems with the same nonzero pattern.<BR>
  280. <BR>
  281. This is NOT the recommended approach for solving nonlinear problems with PETSc!<BR>
  282. We urge users to employ the SNES component for solving nonlinear problems whenever<BR>
  283. possible, as it offers many advantages over coding nonlinear solvers independently.<BR>
  284. <BR>
  285. We solve the Bratu (SFI - solid fuel ignition) problem in a 2D rectangular<BR>
  286. domain, using distributed arrays (DMDAs) to partition the parallel grid.<BR>
  287. <BR>
  288. </menu>
  289. </menu>
  290. </body>
  291. </html>