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
|
<!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/KSPCG.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>KSPCG</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<div id="version" align=right><b>petsc-3.4.2 2013-07-02</b></div>
<A NAME="KSPCG"><H1>KSPCG</H1></A>
The preconditioned conjugate gradient (PCG) iterative method
<H3><FONT COLOR="#CC3333">Options Database Keys</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_cg_type Hermitian </B></TD><TD>- (for complex matrices only) indicates the matrix is Hermitian, see <A HREF="../KSP/KSPCGSetType.html#KSPCGSetType">KSPCGSetType</A>()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_cg_type symmetric </B></TD><TD>- (for complex matrices only) indicates the matrix is symmetric
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_cg_single_reduction </B></TD><TD>- performs both inner products needed in the algorithm with a single MPI_Allreduce() call, see <A HREF="../KSP/KSPCGUseSingleReduction.html#KSPCGUseSingleReduction">KSPCGUseSingleReduction</A>()
</TD></TR></TABLE>
<P>
<P>
Notes: The PCG method requires both the matrix and preconditioner to be symmetric positive (or negative) (semi) definite
Only left preconditioning is supported.
<P>
For complex numbers there are two different CG methods. One for Hermitian symmetric matrices and one for non-Hermitian symmetric matrices. Use
<A HREF="../KSP/KSPCGSetType.html#KSPCGSetType">KSPCGSetType</A>() to indicate which type you are using.
<P>
Developer Notes: KSPSolve_CG() should actually query the matrix to determine if it is Hermitian symmetric or not and NOT require the user to
indicate it to the <A HREF="../KSP/KSP.html#KSP">KSP</A> object.
<P>
<H3><FONT COLOR="#CC3333">References</FONT></H3>
Methods of Conjugate Gradients for Solving Linear Systems, Magnus R. Hestenes and Eduard Stiefel,
Journal of Research of the National Bureau of Standards Vol. 49, No. 6, December 1952 Research Paper 2379
pp. 409--436.
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../KSP/KSPCreate.html#KSPCreate">KSPCreate</A>(), <A HREF="../KSP/KSPSetType.html#KSPSetType">KSPSetType</A>(), <A HREF="../KSP/KSPType.html#KSPType">KSPType</A> (for list of available types), <A HREF="../KSP/KSP.html#KSP">KSP</A>,
<BR><A HREF="../KSP/KSPCGSetType.html#KSPCGSetType">KSPCGSetType</A>(), <A HREF="../KSP/KSPCGUseSingleReduction.html#KSPCGUseSingleReduction">KSPCGUseSingleReduction</A>(), <A HREF="../KSP/KSPPIPECG.html#KSPPIPECG">KSPPIPECG</A>, <A HREF="../KSP/KSPGROPPCG.html#KSPGROPPCG">KSPGROPPCG</A>
<P>
<P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>beginner
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/ksp/ksp/impls/cg/cg.c.html#KSPCG">src/ksp/ksp/impls/cg/cg.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>
<P><H3><FONT COLOR="#CC3333">Examples</FONT></H3>
<A HREF="../../../src/ksp/pc/examples/tutorials/ex1.c.html">src/ksp/pc/examples/tutorials/ex1.c.html</A><BR>
<A HREF="../../../src/ksp/pc/examples/tutorials/ex2.c.html">src/ksp/pc/examples/tutorials/ex2.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex38.c.html">src/ksp/ksp/examples/tutorials/ex38.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex39.c.html">src/ksp/ksp/examples/tutorials/ex39.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex40.c.html">src/ksp/ksp/examples/tutorials/ex40.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex54.c.html">src/ksp/ksp/examples/tutorials/ex54.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex55.c.html">src/ksp/ksp/examples/tutorials/ex55.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex56.c.html">src/ksp/ksp/examples/tutorials/ex56.c.html</A><BR>
</BODY></HTML>
|