File: KSPSetFromOptions.html

package info (click to toggle)
petsc 3.10.3%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 209,064 kB
  • sloc: ansic: 587,333; python: 29,696; makefile: 12,445; fortran: 11,626; f90: 9,677; cpp: 8,768; sh: 1,027; xml: 621; objc: 445; csh: 194; java: 13
file content (128 lines) | stat: -rw-r--r-- 11,298 bytes parent folder | download
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
118
119
120
121
122
123
124
125
126
127
128
<!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.10.3 2018-12-18</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.10.3 v3.10.3 docs/manualpages/KSP/KSPSetFromOptions.html "><small>Report Typos and Errors</small></a></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" 
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  <A HREF="../KSP/KSPSetFromOptions.html#KSPSetFromOptions">KSPSetFromOptions</A>(<A HREF="../KSP/KSP.html#KSP">KSP</A> 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/KSPConvergedDefaultSetUIRNorm.html#KSPConvergedDefaultSetUIRNorm">KSPConvergedDefaultSetUIRNorm</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/KSPConvergedDefaultSetUMIRNorm.html#KSPConvergedDefaultSetUMIRNorm">KSPConvergedDefaultSetUMIRNorm</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
convergence test (say you always want to run with 5 iterations) to
save on communication overhead
preconditioned - default for left preconditioning
unpreconditioned - see <A HREF="../KSP/KSPSetNormType.html#KSPSetNormType">KSPSetNormType</A>()
natural - see <A HREF="../KSP/KSPSetNormType.html#KSPSetNormType">KSPSetNormType</A>()
</TD></TR>
<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)
works only for PCBCGS, PCIBCGS and and PCCG
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_lag_norm </B></TD><TD>- compute the norm of the residual for the ith iteration on the i+1 iteration; this means that one can use
the norm of the residual for convergence test WITHOUT an extra MPI_Allreduce() limiting global synchronizations.
This will require 1 more iteration of the solver than usual.
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_guess_type </B></TD><TD>- Type of initial guess generator for repeated linear solves
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-ksp_fischer_guess &lt;model,size&gt; </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="../Mat/MatSetNullSpace.html#MatSetNullSpace">MatSetNullSpace</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 &lt;optional filename&gt; </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 [ascii binary or draw][:filename][:format option] </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 extreme 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 Users-Manual: <A HREF="../../manual.pdf#chapter.4">Chapter 4 KSP: Linear System Solvers</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>
 <A HREF="../KSP/KSPSetOptionsPrefix.html#KSPSetOptionsPrefix">KSPSetOptionsPrefix</A>(), <A HREF="../KSP/KSPResetFromOptions.html#KSPResetFromOptions">KSPResetFromOptions</A>(), <A HREF="../KSP/KSPSetUseFischerGuess.html#KSPSetUseFischerGuess">KSPSetUseFischerGuess</A>()
<BR>
<P>
<P><B></B><H3><FONT COLOR="#CC3333">Level</FONT></H3>beginner<BR>
<H3><FONT COLOR="#CC3333">Location</FONT></H3>
</B><A HREF="../../../src/ksp/ksp/interface/itcl.c.html#KSPSetFromOptions">src/ksp/ksp/interface/itcl.c</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/pc/examples/tutorials/ex3.c.html">src/ksp/pc/examples/tutorials/ex3.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/ex5.c.html">src/ksp/ksp/examples/tutorials/ex5.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex6.c.html">src/ksp/ksp/examples/tutorials/ex6.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/ex9.c.html">src/ksp/ksp/examples/tutorials/ex9.c.html</A><BR>
<P><H3><FONT COLOR="CC3333">Implementations</FONT></H3><A HREF="../../../src/ksp/ksp/impls/bcgs/bcgs.c.html#KSPSetFromOptions_BCGS">KSPSetFromOptions_BCGS in src/ksp/ksp/impls/bcgs/bcgs.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/bcgsl/bcgsl.c.html#KSPSetFromOptions_BCGSL">KSPSetFromOptions_BCGSL in src/ksp/ksp/impls/bcgsl/bcgsl.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/cg/cg.c.html#KSPSetFromOptions_CG">KSPSetFromOptions_CG in src/ksp/ksp/impls/cg/cg.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/cg/pipelcg/pipelcg.c.html#KSPSetFromOptions_PIPELCG">KSPSetFromOptions_PIPELCG in src/ksp/ksp/impls/cg/pipelcg/pipelcg.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/cheby/cheby.c.html#KSPSetFromOptions_Chebyshev">KSPSetFromOptions_Chebyshev in src/ksp/ksp/impls/cheby/cheby.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/fcg/fcg.c.html#KSPSetFromOptions_FCG">KSPSetFromOptions_FCG in src/ksp/ksp/impls/fcg/fcg.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/fcg/pipefcg/pipefcg.c.html#KSPSetFromOptions_PIPEFCG">KSPSetFromOptions_PIPEFCG in src/ksp/ksp/impls/fcg/pipefcg/pipefcg.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/fetidp/fetidp.c.html#KSPSetFromOptions_FETIDP">KSPSetFromOptions_FETIDP in src/ksp/ksp/impls/fetidp/fetidp.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/gcr/gcr.c.html#KSPSetFromOptions_GCR">KSPSetFromOptions_GCR in src/ksp/ksp/impls/gcr/gcr.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/gcr/pipegcr/pipegcr.c.html#KSPSetFromOptions_PIPEGCR">KSPSetFromOptions_PIPEGCR in src/ksp/ksp/impls/gcr/pipegcr/pipegcr.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/gmres/agmres/agmres.c.html#KSPSetFromOptions_AGMRES">KSPSetFromOptions_AGMRES in src/ksp/ksp/impls/gmres/agmres/agmres.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/gmres/dgmres/dgmres.c.html#KSPSetFromOptions_DGMRES">KSPSetFromOptions_DGMRES in src/ksp/ksp/impls/gmres/dgmres/dgmres.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/gmres/fgmres/fgmres.c.html#KSPSetFromOptions_FGMRES">KSPSetFromOptions_FGMRES in src/ksp/ksp/impls/gmres/fgmres/fgmres.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/gmres/gmres.c.html#KSPSetFromOptions_GMRES">KSPSetFromOptions_GMRES in src/ksp/ksp/impls/gmres/gmres.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/gmres/lgmres/lgmres.c.html#KSPSetFromOptions_LGMRES">KSPSetFromOptions_LGMRES in src/ksp/ksp/impls/gmres/lgmres/lgmres.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/gmres/pgmres/pgmres.c.html#KSPSetFromOptions_PGMRES">KSPSetFromOptions_PGMRES in src/ksp/ksp/impls/gmres/pgmres/pgmres.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/gmres/pipefgmres/pipefgmres.c.html#KSPSetFromOptions_PIPEFGMRES">KSPSetFromOptions_PIPEFGMRES in src/ksp/ksp/impls/gmres/pipefgmres/pipefgmres.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/lcd/lcd.c.html#KSPSetFromOptions_LCD">KSPSetFromOptions_LCD in src/ksp/ksp/impls/lcd/lcd.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/lsqr/lsqr.c.html#KSPSetFromOptions_LSQR">KSPSetFromOptions_LSQR in src/ksp/ksp/impls/lsqr/lsqr.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/qcg/qcg.c.html#KSPSetFromOptions_QCG">KSPSetFromOptions_QCG in src/ksp/ksp/impls/qcg/qcg.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/rich/rich.c.html#KSPSetFromOptions_Richardson">KSPSetFromOptions_Richardson in src/ksp/ksp/impls/rich/rich.c</A><BR>
<A HREF="../../../src/ksp/ksp/impls/tsirm/tsirm.c.html#KSPSetFromOptions_TSIRM">KSPSetFromOptions_TSIRM in src/ksp/ksp/impls/tsirm/tsirm.c</A><BR>
<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>