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 64 65 66 67 68 69
|
<!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/KSPComputeRitz.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>KSPComputeRitz</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<div id="version" align=right><b>petsc-3.7.5 2017-01-01</b></div>
<div id="bugreport" align=right><a href="mailto:petsc-maint@mcs.anl.gov?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: petsc-3.7.5 v3.7.5 docs/manualpages/KSP/KSPComputeRitz.html "><small>Report Typos and Errors</small></a></div>
<A NAME="KSPComputeRitz"><H1>KSPComputeRitz</H1></A>
Computes the Ritz or harmonic Ritz pairs associated to the smallest or largest in modulus, for the preconditioned operator. Called after <A HREF="../KSP/KSPSolve.html#KSPSolve">KSPSolve</A>().
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscksp.h"
PetscErrorCode KSPComputeRitz(KSP ksp,PetscBool ritz,PetscBool small,PetscInt *nrit,Vec S[],PetscReal tetar[],PetscReal tetai[])
</PRE>
Not Collective
<P>
<H3><FONT COLOR="#CC3333">Input Parameter</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>ksp </B></TD><TD>- iterative context obtained from <A HREF="../KSP/KSPCreate.html#KSPCreate">KSPCreate</A>()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>ritz </B></TD><TD>- <A HREF="../Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A> or <A HREF="../Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A> for ritz pairs or harmonic Ritz pairs, respectively
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>small </B></TD><TD>- <A HREF="../Sys/PETSC_TRUE.html#PETSC_TRUE">PETSC_TRUE</A> or <A HREF="../Sys/PETSC_FALSE.html#PETSC_FALSE">PETSC_FALSE</A> for smallest or largest (harmonic) Ritz values, respectively
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>nrit </B></TD><TD>- number of (harmonic) Ritz pairs to compute
</TD></TR>
<P>
<H3><FONT COLOR="#CC3333">Output Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>nrit </B></TD><TD>- actual number of computed (harmonic) Ritz pairs
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>S </B></TD><TD>- multidimensional vector with Ritz vectors
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>tetar </B></TD><TD>- real part of the Ritz values
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>tetai </B></TD><TD>- imaginary part of the Ritz values
</TD></TR>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
-For GMRES, the (harmonic) Ritz pairs are computed from the Hessenberg matrix obtained during
the last complete cycle, or obtained at the end of the solution if the method is stopped before
a restart. Then, the number of actual (harmonic) Ritz pairs computed is less or equal to the restart
parameter for GMRES if a complete cycle has been performed or less or equal to the number of GMRES
iterations.
-Moreover, for real matrices, the (harmonic) Ritz pairs are possibly complex-valued. In such a case,
the routine selects the complex (harmonic) Ritz value and its conjugate, and two successive columns of S
are equal to the real and the imaginary parts of the associated vectors.
-the (harmonic) Ritz pairs are given in order of increasing (harmonic) Ritz values in modulus
-this is currently not implemented when PETSc is built with complex numbers
<P>
One must call <A HREF="../KSP/KSPSetComputeRitz.html#KSPSetComputeRitz">KSPSetComputeRitz</A>() before calling <A HREF="../KSP/KSPSetUp.html#KSPSetUp">KSPSetUp</A>()
in order for this routine to work correctly.
<P>
<P>
<H3><FONT COLOR="#CC3333">Keywords</FONT></H3>
<A HREF="../KSP/KSP.html#KSP">KSP</A>, compute, ritz, values
<BR>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../KSP/KSPSetComputeRitz.html#KSPSetComputeRitz">KSPSetComputeRitz</A>()
<BR><P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>advanced
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/ksp/ksp/interface/itfunc.c.html#KSPComputeRitz">src/ksp/ksp/interface/itfunc.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>
|