|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
|
|
|
"http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
<html >
|
|
|
|
<head><title>psb_krylov — Krylov Methods Driver Routine</title>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
|
<meta name="generator" content="TeX4ht (http://www.tug.org/tex4ht/)">
|
|
|
|
<meta name="originator" content="TeX4ht (http://www.tug.org/tex4ht/)">
|
|
|
|
<!-- html,3 -->
|
|
|
|
<meta name="src" content="userhtml.tex">
|
|
|
|
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
|
|
|
</head><body
|
|
|
|
>
|
|
|
|
<!--l. 15--><div class="crosslinks"><p class="noindent">[<a
|
|
|
|
href="userhtmlsu87.html#tailuserhtmlsu90.html">tail</a>] [<a
|
|
|
|
href="# " >up</a>] </p></div>
|
|
|
|
<h4 class="subsectionHead"><span class="titlemark">11.1 </span> <a
|
|
|
|
id="x107-14300011.1"></a>psb_krylov — Krylov Methods Driver Routine</h4>
|
|
|
|
<!--l. 17--><p class="noindent" >This subroutine is a driver that provides a general interface for all the Krylov-Subspace
|
|
|
|
family methods implemented in PSBLAS version 2.
|
|
|
|
<!--l. 20--><p class="indent" > The stopping criterion can take the following values:
|
|
|
|
<dl class="description"><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">1</span> </dt><dd
|
|
|
|
class="description">normwise backward error in the infinity norm; the iteration is stopped when
|
|
|
|
<center class="math-display" >
|
|
|
|
<img
|
|
|
|
src="userhtml30x.png" alt="err = -----∥ri∥------< eps
|
|
|
|
(∥A ∥∥xi∥ + ∥b∥)
|
|
|
|
" class="math-display" ></center>
|
|
|
|
<!--l. 24--><p class="nopar" >
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">2</span> </dt><dd
|
|
|
|
class="description">Relative residual in the 2-norm; the iteration is stopped when
|
|
|
|
<center class="math-display" >
|
|
|
|
<img
|
|
|
|
src="userhtml31x.png" alt="err = ∥ri∥-< eps
|
|
|
|
∥b∥2
|
|
|
|
" class="math-display" ></center>
|
|
|
|
<!--l. 27--><p class="nopar" >
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">3</span> </dt><dd
|
|
|
|
class="description">Relative residual reduction in the 2-norm; the iteration is stopped when
|
|
|
|
<center class="math-display" >
|
|
|
|
<img
|
|
|
|
src="userhtml32x.png" alt="err = -∥ri∥-< eps
|
|
|
|
∥r0∥2
|
|
|
|
" class="math-display" ></center>
|
|
|
|
<!--l. 30--><p class="nopar" ></dd></dl>
|
|
|
|
<!--l. 32--><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. 37-->
|
|
|
|
<div class="lstlisting" id="listing-16"><span class="label"><a
|
|
|
|
id="x107-143001r1"></a></span><span
|
|
|
|
class="cmbx-10">call</span> psb_krylov(method,a,prec,b,x,eps,desc_a,info,& <br /><span class="label"><a
|
|
|
|
id="x107-143002r2"></a></span>     & itmax,iter,<span
|
|
|
|
class="cmbx-10">err</span>,itrace,irst,istop,cond)
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!--l. 42--><p class="indent" >
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="description"><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">Type:</span> </dt><dd
|
|
|
|
class="description">Synchronous.
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">On Entry</span> </dt><dd
|
|
|
|
class="description">
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">method</span> </dt><dd
|
|
|
|
class="description">a string that defines the iterative method to be used. Supported values
|
|
|
|
are:
|
|
|
|
<dl class="description"><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">CG:</span> </dt><dd
|
|
|
|
class="description">the Conjugate Gradient method;
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">CGS:</span> </dt><dd
|
|
|
|
class="description">the Conjugate Gradient Stabilized method;
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">GCR:</span> </dt><dd
|
|
|
|
class="description">the Generalized Conjugate Residual method;
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">FCG:</span> </dt><dd
|
|
|
|
class="description">the Flexible Conjugate Gradient method<span class="footnote-mark"><a
|
|
|
|
href="userhtml108.html#fn5x0"><sup class="textsuperscript">5</sup></a></span><a
|
|
|
|
id="x107-143003f5"></a> ;
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">BICG:</span> </dt><dd
|
|
|
|
class="description">the Bi-Conjugate Gradient method;
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">BICGSTAB:</span> </dt><dd
|
|
|
|
class="description">the Bi-Conjugate Gradient Stabilized method;
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">BICGSTABL:</span> </dt><dd
|
|
|
|
class="description">the Bi-Conjugate Gradient Stabilized method with
|
|
|
|
restarting;
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">RGMRES:</span> </dt><dd
|
|
|
|
class="description">the Generalized Minimal Residual method with restarting.</dd></dl>
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">a</span> </dt><dd
|
|
|
|
class="description">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="userhtmlsu6.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">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">prec</span> </dt><dd
|
|
|
|
class="description">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="userhtmlsu8.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">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">b</span> </dt><dd
|
|
|
|
class="description">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="userhtmlsu7.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">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">x</span> </dt><dd
|
|
|
|
class="description">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="userhtmlsu7.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">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">eps</span> </dt><dd
|
|
|
|
class="description">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">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">desc</span><span
|
|
|
|
class="cmbx-10">_a</span> </dt><dd
|
|
|
|
class="description">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="userhtmlsu5.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">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">itmax</span> </dt><dd
|
|
|
|
class="description">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">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">itrace</span> </dt><dd
|
|
|
|
class="description">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">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">irst</span> </dt><dd
|
|
|
|
class="description">An integer specifying the restart parameter.<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: <span
|
|
|
|
class="cmmi-10">irst > </span>0. This is employed for the BiCGSTABL or RGMRES methods,
|
|
|
|
otherwise it is ignored.
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">istop</span> </dt><dd
|
|
|
|
class="description">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">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">On Return</span> </dt><dd
|
|
|
|
class="description">
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">x</span> </dt><dd
|
|
|
|
class="description">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="userhtmlsu7.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">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">iter</span> </dt><dd
|
|
|
|
class="description">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">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">err</span> </dt><dd
|
|
|
|
class="description">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">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">cond</span> </dt><dd
|
|
|
|
class="description">An estimate of the condition number of matrix <span
|
|
|
|
class="cmmi-10">A</span>; only available with the <span
|
|
|
|
class="cmmi-10">CG</span>
|
|
|
|
method on real data.<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. A correct result will be greater than or
|
|
|
|
equal to one; if specified for non-real data, or an error occurred, zero is
|
|
|
|
returned.
|
|
|
|
</dd><dt class="description">
|
|
|
|
<span
|
|
|
|
class="cmbx-10">info</span> </dt><dd
|
|
|
|
class="description">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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--l. 2--><div class="crosslinks"><p class="noindent">[<a
|
|
|
|
href="userhtmlsu90.html" >front</a>] [<a
|
|
|
|
href="# " >up</a>] </p></div>
|
|
|
|
<!--l. 2--><p class="indent" > <a
|
|
|
|
id="tailuserhtmlsu90.html"></a>
|
|
|
|
</body></html>
|