2
<title>SLES</title><body bgcolor="FFFFFF">
5
<LI><A HREF="../../../src/sles/examples/tutorials/ex1.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
7
Solves a tridiagonal linear system with SLES.<BR></menu>
8
<LI><A HREF="../../../src/sles/examples/tutorials/ex12.c.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
10
Solves a linear system in parallel with SLES.<BR>Input parameters include:<BR>
11
-m <mesh_x> : number of mesh points in x-direction<BR>
12
-n <mesh_n> : number of mesh points in y-direction<BR>
14
<LI><A HREF="../../../src/sles/examples/tutorials/ex1f.F.html"><CONCEPT>solving a system of linear equations</CONCEPT></A>
18
Description: Solves a tridiagonal linear system with SLES.<BR>
21
<LI><A HREF="../../../src/sles/examples/tutorials/ex2.c.html"><CONCEPT>basic parallel example;</CONCEPT></A>
23
Solves a linear system in parallel with SLES.<BR>Input parameters include:<BR>
24
-random_exact_sol : use a random exact solution vector<BR>
25
-view_exact_sol : write exact solution vector to stdout<BR>
26
-m <mesh_x> : number of mesh points in x-direction<BR>
27
-n <mesh_n> : number of mesh points in y-direction<BR>
29
<LI><A HREF="../../../src/sles/examples/tutorials/ex23.c.html"><CONCEPT>basic parallel example;</CONCEPT></A>
31
Solves a tridiagonal linear system.<BR></menu>
32
<LI><A HREF="../../../src/sles/examples/tutorials/ex12.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
34
Solves a linear system in parallel with SLES.<BR>Input parameters include:<BR>
35
-m <mesh_x> : number of mesh points in x-direction<BR>
36
-n <mesh_n> : number of mesh points in y-direction<BR>
38
<LI><A HREF="../../../src/sles/examples/tutorials/ex13.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
40
Solves a variable Poisson problem with SLES.<BR></menu>
41
<LI><A HREF="../../../src/sles/examples/tutorials/ex13f90.F.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
47
<LI><A HREF="../../../src/sles/examples/tutorials/ex16.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
49
Solves a sequence of linear systems with different right-hand-side vectors.<BR>Input parameters include:<BR>
50
-ntimes <ntimes> : number of linear systems to solve<BR>
51
-view_exact_sol : write exact solution vector to stdout<BR>
52
-m <mesh_x> : number of mesh points in x-direction<BR>
53
-n <mesh_n> : number of mesh points in y-direction<BR>
55
<LI><A HREF="../../../src/sles/examples/tutorials/ex2.c.html"><CONCEPT>Laplacian, 2d</CONCEPT></A>
57
Solves a linear system in parallel with SLES.<BR>Input parameters include:<BR>
58
-random_exact_sol : use a random exact solution vector<BR>
59
-view_exact_sol : write exact solution vector to stdout<BR>
60
-m <mesh_x> : number of mesh points in x-direction<BR>
61
-n <mesh_n> : number of mesh points in y-direction<BR>
63
<LI><A HREF="../../../src/sles/examples/tutorials/ex15.c.html"><CONCEPT>basic parallel example</CONCEPT></A>
65
Solves a linear system in parallel with SLES. Also<BR>illustrates setting a user-defined shell preconditioner and using the<BR>
66
macro __FUNCT__ to define routine names for use in error handling.<BR>
67
Input parameters include:<BR>
68
-user_defined_pc : Activate a user-defined preconditioner<BR>
70
<LI><A HREF="../../../src/sles/examples/tutorials/ex15f.F.html"><CONCEPT>basic parallel example</CONCEPT></A>
74
Solves a linear system in parallel with SLES. Also indicates<BR>
75
use of a user-provided preconditioner. Input parameters include:<BR>
76
-user_defined_pc : Activate a user-defined preconditioner<BR>
78
Program usage: mpirun ex15f [-help] [all PETSc options]<BR>
81
<LI><A HREF="../../../src/sles/examples/tutorials/ex21f.F.html"><CONCEPT>basic parallel example</CONCEPT></A>
85
Solves a linear system in parallel with SLES. Also indicates<BR>
86
use of a user-provided preconditioner. Input parameters include:<BR>
88
Program usage: mpirun ex21f [-help] [all PETSc options]<BR>
91
<LI><A HREF="../../../src/sles/examples/tutorials/ex2f.F.html"><CONCEPT>basic parallel example</CONCEPT></A>
95
Description: Solves a linear system in parallel with SLES (Fortran code).<BR>
96
Also shows how to set a user-defined monitoring routine.<BR>
98
Program usage: mpirun -np <procs> ex2f [-help] [all PETSc options]<BR>
101
<LI><A HREF="../../../src/sles/examples/tutorials/ex3.c.html"><CONCEPT>basic parallel example</CONCEPT></A>
103
Solves a linear system in parallel with SLES. The matrix<BR>uses simple bilinear elements on the unit square. To test the parallel<BR>
104
matrix assembly, the matrix is intentionally laid out across processors<BR>
105
differently from the way it is assembled. Input arguments are:<BR>
106
-m <size> : problem size<BR>
108
<LI><A HREF="../../../src/sles/examples/tutorials/ex4.c.html"><CONCEPT>different matrices for linear system and preconditioner;</CONCEPT></A>
110
Uses a different preconditioner matrix and linear system matrix in the SLES solvers.<BR>Note that different storage formats<BR>
111
can be used for the different matrices.<BR>
113
<LI><A HREF="../../../src/sles/examples/tutorials/ex6f.F.html"><CONCEPT>different matrices for linear system and preconditioner;</CONCEPT></A>
117
Description: This example demonstrates repeated linear solves as<BR>
118
well as the use of different preconditioner and linear system<BR>
119
matrices. This example also illustrates how to save PETSc objects<BR>
120
in common blocks.<BR>
123
<LI><A HREF="../../../src/sles/examples/tutorials/ex16.c.html"><CONCEPT>repeatedly solving linear systems;</CONCEPT></A>
125
Solves a sequence of linear systems with different right-hand-side vectors.<BR>Input parameters include:<BR>
126
-ntimes <ntimes> : number of linear systems to solve<BR>
127
-view_exact_sol : write exact solution vector to stdout<BR>
128
-m <mesh_x> : number of mesh points in x-direction<BR>
129
-n <mesh_n> : number of mesh points in y-direction<BR>
131
<LI><A HREF="../../../src/sles/examples/tutorials/ex5.c.html"><CONCEPT>repeatedly solving linear systems;</CONCEPT></A>
133
Solves two linear systems in parallel with SLES. The code<BR>illustrates repeated solution of linear systems with the same preconditioner<BR>
134
method but different matrices (having the same nonzero structure). The code<BR>
135
also uses multiple profiling stages. Input arguments are<BR>
136
-m <size> : problem size<BR>
137
-mat_nonsym : use nonsymmetric matrix (default is symmetric)<BR>
139
<LI><A HREF="../../../src/sles/examples/tutorials/ex6f.F.html"><CONCEPT>repeatedly solving linear systems;</CONCEPT></A>
143
Description: This example demonstrates repeated linear solves as<BR>
144
well as the use of different preconditioner and linear system<BR>
145
matrices. This example also illustrates how to save PETSc objects<BR>
146
in common blocks.<BR>
149
<LI><A HREF="../../../src/sles/examples/tutorials/ex9.c.html"><CONCEPT>repeatedly solving linear systems;</CONCEPT></A>
151
The solution of 2 different linear systems with different linear solvers.<BR>Also, this example illustrates the repeated<BR>
152
solution of linear systems, while reusing matrix, vector, and solver data<BR>
153
structures throughout the process. Note the various stages of event logging.<BR>
155
<LI><A HREF="../../../src/sles/examples/tutorials/ex7.c.html"><CONCEPT>customizing the block Jacobi preconditioner</CONCEPT></A>
157
Block Jacobi preconditioner for solving a linear system in parallel with SLES.<BR>The code indicates the<BR>
158
procedures for setting the particular block sizes and for using different<BR>
159
linear solvers on the individual blocks.<BR>
161
<LI><A HREF="../../../src/sles/examples/tutorials/ex8.c.html"><CONCEPT>Additive Schwarz Method (ASM) with user-defined subdomains</CONCEPT></A>
163
Illustrates use of the preconditioner ASM.<BR>The Additive Schwarz Method for solving a linear system in parallel with SLES. The<BR>
164
code indicates the procedure for setting user-defined subdomains. Input<BR>
165
parameters include:<BR>
166
-user_set_subdomain_solvers: User explicitly sets subdomain solvers<BR>
167
-user_set_subdomains: Activate user-defined subdomains<BR>
169
<LI><A HREF="../../../src/sles/examples/tutorials/ex10.c.html"><CONCEPT>solving a linear system</CONCEPT></A>
171
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>
172
another (larger) system and solves it as well. This example illustrates<BR>
173
preloading of instructions with the smaller system so that more accurate<BR>
174
performance monitoring can be done with the larger one (that actually<BR>
175
is the system of interest). See the 'Performance Hints' chapter of the<BR>
176
users manual for a discussion of preloading. Input parameters include<BR>
177
-f0 <input_file> : first file to load (small system)<BR>
178
-f1 <input_file> : second file to load (larger system)<BR>
179
-trans : solve transpose system instead<BR>
181
<LI><A HREF="../../../src/sles/examples/tutorials/ex11.c.html"><CONCEPT>solving a Helmholtz equation</CONCEPT></A>
183
Solves a linear system in parallel with SLES.<BR></menu>
184
<LI><A HREF="../../../src/sles/examples/tutorials/ex11f.F.html"><CONCEPT>solving a Helmholtz equation</CONCEPT></A>
188
Description: Solves a complex linear system in parallel with SLES (Fortran code).<BR>
191
<LI><A HREF="../../../src/sles/examples/tutorials/ex13.c.html"><CONCEPT>basic sequential example</CONCEPT></A>
193
Solves a variable Poisson problem with SLES.<BR></menu>
194
<LI><A HREF="../../../src/sles/examples/tutorials/ex13f90.F.html"><CONCEPT>basic sequential example</CONCEPT></A>
200
<LI><A HREF="../../../src/sles/examples/tutorials/ex2f.F.html"><CONCEPT>setting a user-defined monitoring routine</CONCEPT></A>
204
Description: Solves a linear system in parallel with SLES (Fortran code).<BR>
205
Also shows how to set a user-defined monitoring routine.<BR>
207
Program usage: mpirun -np <procs> ex2f [-help] [all PETSc options]<BR>
210
<LI><A HREF="../../../src/sles/examples/tutorials/ex14f.F.html"><CONCEPT>writing a user-defined nonlinear solver</CONCEPT></A>
214
Solves a nonlinear system in parallel with a user-defined<BR>
215
Newton method that uses SLES to solve the linearized Newton sytems. This solver<BR>
216
is a very simplistic inexact Newton method. The intent of this code is to<BR>
217
demonstrate the repeated solution of linear sytems with the same nonzero pattern.<BR>
219
This is NOT the recommended approach for solving nonlinear problems with PETSc!<BR>
220
We urge users to employ the SNES component for solving nonlinear problems whenever<BR>
221
possible, as it offers many advantages over coding nonlinear solvers independently.<BR>
223
We solve the Bratu (SFI - solid fuel ignition) problem in a 2D rectangular<BR>
224
domain, using distributed arrays (DAs) to partition the parallel grid.<BR>