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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
<!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/KSPSetFromOptions.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>KSPSetFromOptions</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<div id="version" align=right><b>petsc-3.4.2 2013-07-02</b></div>
<A NAME="KSPSetFromOptions"><H1>KSPSetFromOptions</H1></A>
Sets <A HREF="../KSP/KSP.html#KSP">KSP</A> options from the options database. This routine must be called before <A HREF="../KSP/KSPSetUp.html#KSPSetUp">KSPSetUp</A>() if the user is to be allowed to set the Krylov type.
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscksp.h"
PetscErrorCode KSPSetFromOptions(KSP ksp)
</PRE>
Collective on <A HREF="../KSP/KSP.html#KSP">KSP</A>
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<DT><B>ksp </B> -the Krylov space context
<br>
<P>
<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_max_it </B></TD><TD>- maximum number of linear iterations
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_rtol rtol </B></TD><TD>- relative tolerance used in default determination of convergence, i.e.
if residual norm decreases by this factor than convergence is declared
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_atol abstol </B></TD><TD>- absolute tolerance used in default convergence test, i.e. if residual
norm is less than this then convergence is declared
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_divtol tol </B></TD><TD>- if residual norm increases by this factor than divergence is declared
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_converged_use_initial_residual_norm </B></TD><TD>- see <A HREF="../KSP/KSPDefaultConvergedSetUIRNorm.html#KSPDefaultConvergedSetUIRNorm">KSPDefaultConvergedSetUIRNorm</A>()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_converged_use_min_initial_residual_norm </B></TD><TD>- see <A HREF="../KSP/KSPDefaultConvergedSetUMIRNorm.html#KSPDefaultConvergedSetUMIRNorm">KSPDefaultConvergedSetUMIRNorm</A>()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_norm_type </B></TD><TD>- none - skip norms used in convergence tests (useful only when not using
</TD></TR>
<pre>
convergence test (say you always want to run with 5 iterations) to
</pre>
<pre>
save on communication overhead
</pre>
<pre>
preconditioned - default for left preconditioning
</pre>
<pre>
unpreconditioned - see <A HREF="../KSP/KSPSetNormType.html#KSPSetNormType">KSPSetNormType</A>()
</pre>
<pre>
natural - see <A HREF="../KSP/KSPSetNormType.html#KSPSetNormType">KSPSetNormType</A>()
</pre>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_check_norm_iteration it </B></TD><TD>- do not compute residual norm until iteration number it (does compute at 0th iteration)
</TD></TR>
<pre>
works only for PCBCGS, PCIBCGS and and PCCG
</pre>
-ksp_lag_norm - compute the norm of the residual for the ith iteration on the i+1 iteration; this means that one can use
<pre>
the norm of the residual for convergence test WITHOUT an extra MPI_Allreduce() limiting global synchronizations.
</pre>
<pre>
This will require 1 more iteration of the solver than usual.
</pre>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_fischer_guess <model,size> </B></TD><TD>- uses the Fischer initial guess generator for repeated linear solves
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_constant_null_space </B></TD><TD>- assume the operator (matrix) has the constant vector in its null space
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_test_null_space </B></TD><TD>- tests the null space set with <A HREF="../KSP/KSPSetNullSpace.html#KSPSetNullSpace">KSPSetNullSpace</A>() to see if it truly is a null space
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_knoll </B></TD><TD>- compute initial guess by applying the preconditioner to the right hand side
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_monitor_cancel </B></TD><TD>- cancel all previous convergene monitor routines set
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_monitor <optional filename> </B></TD><TD>- print residual norm at each iteration
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_monitor_lg_residualnorm </B></TD><TD>- plot residual norm at each iteration
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_monitor_solution </B></TD><TD>- plot solution at each iteration
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_monitor_singular_value </B></TD><TD>- monitor extremem singular values at each iteration
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
To see all options, run your program with the -help option
or consult <A href="../../docs/manual.pdf#nameddest=<A HREF="../../manual.pdf#chapter.4">Chapter 4 KSP: Linear Equations Solvers</A>"><A HREF="../KSP/KSP.html#KSP">KSP</A> chapter of the users manual</A>.
<P>
<P>
<H3><FONT COLOR="#CC3333">Keywords</FONT></H3>
<A HREF="../KSP/KSP.html#KSP">KSP</A>, set, from, options, database
<BR>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
KSPSetUseFischerInitialGuess()
<BR>
<P>
<P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>beginner
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/ksp/ksp/interface/itcl.c.html#KSPSetFromOptions">src/ksp/ksp/interface/itcl.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/ex1.c.html">src/ksp/ksp/examples/tutorials/ex1.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex2.c.html">src/ksp/ksp/examples/tutorials/ex2.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex3.c.html">src/ksp/ksp/examples/tutorials/ex3.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex4.c.html">src/ksp/ksp/examples/tutorials/ex4.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex5.c.html">src/ksp/ksp/examples/tutorials/ex5.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex7.c.html">src/ksp/ksp/examples/tutorials/ex7.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex8.c.html">src/ksp/ksp/examples/tutorials/ex8.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex8g.c.html">src/ksp/ksp/examples/tutorials/ex8g.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex9.c.html">src/ksp/ksp/examples/tutorials/ex9.c.html</A><BR>
</BODY></HTML>
|