1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPInitialResidual.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>KSPInitialResidual</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<div id="version" align=right><b>petsc-3.4.2 2013-07-02</b></div>
<A NAME="KSPInitialResidual"><H1>KSPInitialResidual</H1></A>
Computes the residual. Either b - A*C*u = b - A*x with right preconditioning or C*(b - A*x) with left preconditioning; that later residual is often called the "preconditioned residual".
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscksp.h"
PetscErrorCode KSPInitialResidual(KSP ksp,Vec vsoln,Vec vt1,Vec vt2,Vec vres,Vec vb)
</PRE>
Collective on <A HREF="../KSP/KSP.html#KSP">KSP</A>
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>vsoln </B></TD><TD>- solution to use in computing residual
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>vt1, vt2 </B></TD><TD>- temporary work vectors
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>vb </B></TD><TD>- right-hand-side vector
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Output Parameters</FONT></H3>
<DT><B>vres </B> -calculated residual
<br>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
This routine assumes that an iterative method, designed for
<pre>
A x = b
</pre>
will be used with a preconditioner, C, such that the actual problem is either
<pre>
AC u = b (right preconditioning) or
</pre>
<pre>
CA x = Cb (left preconditioning).
</pre>
This means that the calculated residual will be scaled and/or preconditioned;
the true residual
<pre>
b-Ax
</pre>
is returned in the vt2 temporary.
<P>
<P>
<H3><FONT COLOR="#CC3333">Keywords</FONT></H3>
<A HREF="../KSP/KSP.html#KSP">KSP</A>, residual
<BR>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../KSP/KSPMonitor.html#KSPMonitor">KSPMonitor</A>()
<BR><P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>developer
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/ksp/ksp/interface/itres.c.html#KSPInitialResidual">src/ksp/ksp/interface/itres.c</A>
<BR><A HREF="./index.html">Index of all KSP routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
</BODY></HTML>
|