|
|
|
@ -17,10 +17,9 @@ href="userhtmlse8.html#tailuserhtmlse11.html">tail</a>] [<a
|
|
|
|
|
href="userhtml.html# " >up</a>] </p></div>
|
|
|
|
|
<h3 class="sectionHead"><span class="titlemark">11 </span> <a
|
|
|
|
|
id="x17-14200011"></a>Iterative Methods</h3>
|
|
|
|
|
<!--l. 4--><p class="noindent" >In this chapter we provide routines for preconditioners and iterative methods.
|
|
|
|
|
The interfaces for Krylov subspace methods are available in the module
|
|
|
|
|
<span class="obeylines-h"><span class="verb"><span
|
|
|
|
|
class="cmtt-10">psb_krylov_mod</span></span></span>.
|
|
|
|
|
<!--l. 4--><p class="noindent" >In this chapter we provide routines for preconditioners and iterative methods. The
|
|
|
|
|
interfaces for iterative methods are available in the module <span class="obeylines-h"><span class="verb"><span
|
|
|
|
|
class="cmtt-10">psb_linsolve_mod</span></span></span>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -456,6 +455,344 @@ class="newline" />An integer value; 0 means no error has been detected.</dd></dl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="subsectionHead"><span class="titlemark">11.2 </span> <a
|
|
|
|
|
id="x17-14400011.2"></a>psb_richardson — Richardson Iteration Driver Routine</h4>
|
|
|
|
|
<!--l. 158--><p class="noindent" >This subroutine is a driver implementig a Richardson iteration
|
|
|
|
|
<div class="math-display" >
|
|
|
|
|
<img
|
|
|
|
|
src="userhtml33x.png" alt="x = M - 1(b - Ax )+ x ,
|
|
|
|
|
k+1 k k
|
|
|
|
|
" class="math-display" ></div>
|
|
|
|
|
<!--l. 159--><p class="nopar" > with the preconditioner operator <span
|
|
|
|
|
class="cmmi-10">M </span>defined in the previous section.
|
|
|
|
|
<!--l. 162--><p class="indent" > The stopping criterion can take the following values:
|
|
|
|
|
<dl class="description"><dt class="description">
|
|
|
|
|
<!--l. 164--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">1</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 164--><p class="noindent" >normwise backward error in the infinity norm; the iteration is stopped
|
|
|
|
|
when
|
|
|
|
|
<div class="math-display" >
|
|
|
|
|
<img
|
|
|
|
|
src="userhtml34x.png" alt=" -----∥ri∥------
|
|
|
|
|
err = (∥A∥∥xi∥+ ∥b∥) < eps
|
|
|
|
|
" class="math-display" ></div>
|
|
|
|
|
<!--l. 166--><p class="nopar" >
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 167--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">2</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 167--><p class="noindent" >Relative residual in the 2-norm; the iteration is stopped when
|
|
|
|
|
<div class="math-display" >
|
|
|
|
|
<img
|
|
|
|
|
src="userhtml35x.png" alt=" ∥ri∥-
|
|
|
|
|
err = ∥b∥2 < eps
|
|
|
|
|
" class="math-display" ></div>
|
|
|
|
|
<!--l. 169--><p class="nopar" >
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 170--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">3</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 170--><p class="noindent" >Relative residual reduction in the 2-norm; the iteration is stopped when
|
|
|
|
|
<div class="math-display" >
|
|
|
|
|
<img
|
|
|
|
|
src="userhtml36x.png" alt=" -∥ri∥-
|
|
|
|
|
err = ∥r0∥2 < eps
|
|
|
|
|
" class="math-display" ></div>
|
|
|
|
|
<!--l. 172--><p class="nopar" ></dd></dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--l. 174--><p class="noindent" >The behaviour is controlled by the istop argument (see later). In the above formulae, <span
|
|
|
|
|
class="cmmi-10">x</span><sub><span
|
|
|
|
|
class="cmmi-7">i</span></sub>
|
|
|
|
|
is the tentative solution and <span
|
|
|
|
|
class="cmmi-10">r</span><sub><span
|
|
|
|
|
class="cmmi-7">i</span></sub> = <span
|
|
|
|
|
class="cmmi-10">b </span><span
|
|
|
|
|
class="cmsy-10">- </span><span
|
|
|
|
|
class="cmmi-10">Ax</span><sub><span
|
|
|
|
|
class="cmmi-7">i</span></sub> the corresponding residual at the <span
|
|
|
|
|
class="cmmi-10">i</span>-th
|
|
|
|
|
iteration.
|
|
|
|
|
<!--l. 179-->
|
|
|
|
|
<pre class="lstlisting" id="listing-168"><span class="label"><a
|
|
|
|
|
id="x17-144001r1"></a></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">call</span></span><span style="color:#000000"> </span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">psb_richardson</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">(</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">a</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">,</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">prec</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">,</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">b</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">,</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">x</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">,</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">eps</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">,</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">desc_a</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">,</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">info</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">,&</span></span>
|
|
|
|
|
<span class="label"><a
|
|
|
|
|
id="x17-144002r2"></a></span><span
|
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
|
class="cmtt-10"> </span><span
|
|
|
|
|
class="cmtt-10"> </span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">&</span></span><span style="color:#000000"> </span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">itmax</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">,</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">iter</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">,</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">err</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">,</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">itrace</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">,</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">istop</span></span><span style="color:#000000"><span
|
|
|
|
|
class="cmtt-10">)</span></span></pre>
|
|
|
|
|
|
|
|
|
|
<!--l. 184--><p class="indent" >
|
|
|
|
|
<dl class="description"><dt class="description">
|
|
|
|
|
<!--l. 185--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">Type:</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 185--><p class="noindent" >Synchronous.
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 186--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">On Entry</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 186--><p class="noindent" >
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 187--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">a</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 187--><p class="noindent" >the local portion of global sparse matrix <span
|
|
|
|
|
class="cmmi-10">A</span>. <br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">local </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">required</span><br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">in</span>.<br
|
|
|
|
|
class="newline" />Specified as: a structured data of type <a
|
|
|
|
|
href="userhtmlse3.html#spdata"><span
|
|
|
|
|
class="cmtt-10">psb</span><span
|
|
|
|
|
class="cmtt-10">_Tspmat</span><span
|
|
|
|
|
class="cmtt-10">_type</span></a>.
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 193--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">prec</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 193--><p class="noindent" >The data structure containing the preconditioner.<br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">local </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">required</span><br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">in</span>.<br
|
|
|
|
|
class="newline" />Specified as: a structured data of type <a
|
|
|
|
|
href="userhtmlse3.html#precdata"><span
|
|
|
|
|
class="cmtt-10">psb</span><span
|
|
|
|
|
class="cmtt-10">_prec</span><span
|
|
|
|
|
class="cmtt-10">_type</span></a>.
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 198--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">b</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 198--><p class="noindent" >The RHS vector. <br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">local </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">required</span><br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">in</span>.<br
|
|
|
|
|
class="newline" />Specified as: a rank one array or an object of type <a
|
|
|
|
|
href="userhtmlse3.html#vdata"><span
|
|
|
|
|
class="cmtt-10">psb</span><span
|
|
|
|
|
class="cmtt-10">_T</span><span
|
|
|
|
|
class="cmtt-10">_vect</span><span
|
|
|
|
|
class="cmtt-10">_type</span></a>.
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 203--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">x</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--l. 203--><p class="noindent" >The initial guess. <br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">local </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">required</span><br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">inout</span>.<br
|
|
|
|
|
class="newline" />Specified as: a rank one array or an object of type <a
|
|
|
|
|
href="userhtmlse3.html#vdata"><span
|
|
|
|
|
class="cmtt-10">psb</span><span
|
|
|
|
|
class="cmtt-10">_T</span><span
|
|
|
|
|
class="cmtt-10">_vect</span><span
|
|
|
|
|
class="cmtt-10">_type</span></a>.
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 208--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">eps</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 208--><p class="noindent" >The stopping tolerance. <br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">global </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">required</span><br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">in</span>.<br
|
|
|
|
|
class="newline" />Specified as: a real number.
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 213--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">desc</span><span
|
|
|
|
|
class="cmbx-10">_a</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 213--><p class="noindent" >contains data structures for communications.<br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">local </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">required</span><br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">in</span>.<br
|
|
|
|
|
class="newline" />Specified as: a structured data of type <a
|
|
|
|
|
href="userhtmlse3.html#descdata"><span
|
|
|
|
|
class="cmtt-10">psb</span><span
|
|
|
|
|
class="cmtt-10">_desc</span><span
|
|
|
|
|
class="cmtt-10">_type</span></a>.
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 218--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">itmax</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 218--><p class="noindent" >The maximum number of iterations to perform.<br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">global </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">optional</span><br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">in</span>.<br
|
|
|
|
|
class="newline" />Default: <span
|
|
|
|
|
class="cmmi-10">itmax </span>= 1000.<br
|
|
|
|
|
class="newline" />Specified as: an integer variable <span
|
|
|
|
|
class="cmmi-10">itmax </span><span
|
|
|
|
|
class="cmsy-10">≥ </span>1.
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 224--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">itrace</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 224--><p class="noindent" >If <span
|
|
|
|
|
class="cmmi-10">> </span>0 print out an informational message about convergence every <span
|
|
|
|
|
class="cmmi-10">itrace</span>
|
|
|
|
|
iterations. If = 0 print a message in case of convergence failure.<br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">global </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">optional</span><br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">in</span>.<br
|
|
|
|
|
class="newline" />Default: <span
|
|
|
|
|
class="cmmi-10">itrace </span>= <span
|
|
|
|
|
class="cmsy-10">-</span>1.<br
|
|
|
|
|
class="newline" />
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 232--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">istop</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--l. 232--><p class="noindent" >An integer specifying the stopping criterion.<br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">global </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">optional</span>.<br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">in</span>.<br
|
|
|
|
|
class="newline" />Values: 1: use the normwise backward error, 2: use the scaled 2-norm of
|
|
|
|
|
the residual, 3: use the residual reduction in the 2-norm. Default: 2.
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 238--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">On Return</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 238--><p class="noindent" >
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 239--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">x</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 239--><p class="noindent" >The computed solution. <br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">local </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">required</span><br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">inout</span>.<br
|
|
|
|
|
class="newline" />Specified as: a rank one array or an object of type <a
|
|
|
|
|
href="userhtmlse3.html#vdata"><span
|
|
|
|
|
class="cmtt-10">psb</span><span
|
|
|
|
|
class="cmtt-10">_T</span><span
|
|
|
|
|
class="cmtt-10">_vect</span><span
|
|
|
|
|
class="cmtt-10">_type</span></a>.
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 244--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">iter</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 244--><p class="noindent" >The number of iterations performed.<br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">global </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">optional</span><br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">out</span>.<br
|
|
|
|
|
class="newline" />Returned as: an integer variable.
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 249--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">err</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 249--><p class="noindent" >The convergence estimate on exit.<br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">global </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">optional</span><br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">out</span>.<br
|
|
|
|
|
class="newline" />Returned as: a real number.
|
|
|
|
|
</dd><dt class="description">
|
|
|
|
|
<!--l. 254--><p class="noindent" >
|
|
|
|
|
<span
|
|
|
|
|
class="cmbx-10">info</span> </dt><dd
|
|
|
|
|
class="description">
|
|
|
|
|
<!--l. 254--><p class="noindent" >Error code.<br
|
|
|
|
|
class="newline" />Scope: <span
|
|
|
|
|
class="cmbx-10">local </span><br
|
|
|
|
|
class="newline" />Type: <span
|
|
|
|
|
class="cmbx-10">required </span><br
|
|
|
|
|
class="newline" />Intent: <span
|
|
|
|
|
class="cmbx-10">out</span>.<br
|
|
|
|
|
class="newline" />An integer value; 0 means no error has been detected.</dd></dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|