File: SNESSetFromOptions.html

package info (click to toggle)
petsc 3.7.5%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 163,864 kB
  • ctags: 618,438
  • sloc: ansic: 515,133; python: 29,793; makefile: 20,458; fortran: 18,998; cpp: 6,515; f90: 3,914; sh: 1,012; xml: 621; objc: 445; csh: 240; java: 13
file content (122 lines) | stat: -rw-r--r-- 8,366 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetFromOptions.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>SNESSetFromOptions</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/SNES/SNESSetFromOptions.html "><small>Report Typos and Errors</small></a></div>
<A NAME="SNESSetFromOptions"><H1>SNESSetFromOptions</H1></A>
Sets various <A HREF="../SNES/SNES.html#SNES">SNES</A> and <A HREF="../KSP/KSP.html#KSP">KSP</A> parameters from user options. 
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscsnes.h"  
PetscErrorCode  SNESSetFromOptions(SNES snes)
</PRE>
Collective on <A HREF="../SNES/SNES.html#SNES">SNES</A>
<P>
<H3><FONT COLOR="#CC3333">Input Parameter</FONT></H3>
<DT><B>snes </B> -the <A HREF="../SNES/SNES.html#SNES">SNES</A> 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>-snes_type &lt;type&gt; </B></TD><TD>- newtonls, newtontr, ngmres, ncg, nrichardson, qn, vi, fas, <A HREF="../SNES/SNESType.html#SNESType">SNESType</A> for complete list
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_stol </B></TD><TD>- convergence tolerance in terms of the norm
of the change in the solution between steps
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_atol &lt;abstol&gt; </B></TD><TD>- absolute tolerance of residual norm
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_rtol &lt;rtol&gt; </B></TD><TD>- relative decrease in tolerance norm from initial
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_max_it &lt;max_it&gt; </B></TD><TD>- maximum number of iterations
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_max_funcs &lt;max_funcs&gt; </B></TD><TD>- maximum number of function evaluations
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_max_fail &lt;max_fail&gt; </B></TD><TD>- maximum number of line search failures allowed before stopping, default is none
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_max_linear_solve_fail </B></TD><TD>- number of linear solver failures before <A HREF="../SNES/SNESSolve.html#SNESSolve">SNESSolve</A>() stops
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_lag_preconditioner &lt;lag&gt; </B></TD><TD>- how often preconditioner is rebuilt (use -1 to never rebuild)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_lag_jacobian &lt;lag&gt; </B></TD><TD>- how often Jacobian is rebuilt (use -1 to never rebuild)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_trtol &lt;trtol&gt; </B></TD><TD>- trust region tolerance
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_no_convergence_test </B></TD><TD>- skip convergence test in nonlinear
solver; hence iterations will continue until max_it
or some other criterion is reached. Saves expense
of convergence test
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_monitor [ascii][:filename][:viewer format] </B></TD><TD>- prints residual norm at each iteration. if no filename given prints to stdout
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_monitor_solution [ascii binary draw][:filename][:viewer format] </B></TD><TD>- plots solution at each iteration
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_monitor_residual [ascii binary draw][:filename][:viewer format] </B></TD><TD>- plots residual (not its norm) at each iteration
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_monitor_solution_update [ascii binary draw][:filename][:viewer format] </B></TD><TD>- plots update to solution at each iteration
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_monitor_lg_residualnorm </B></TD><TD>- plots residual norm at each iteration
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_monitor_lg_range </B></TD><TD>- plots residual norm at each iteration
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_fd </B></TD><TD>- use finite differences to compute Jacobian; very slow, only for testing
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_fd_color </B></TD><TD>- use finite differences with coloring to compute Jacobian
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_mf_ksp_monitor </B></TD><TD>- if using matrix-free multiply then print h at each <A HREF="../KSP/KSP.html#KSP">KSP</A> iteration
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_converged_reason </B></TD><TD>- print the reason for convergence/divergence after each solve
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Options Database for Eisenstat-Walker method</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_ksp_ew </B></TD><TD>- use Eisenstat-Walker method for determining linear system convergence
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_ksp_ew_version ver </B></TD><TD>- version of  Eisenstat-Walker method
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_ksp_ew_rtol0 &lt;rtol0&gt; </B></TD><TD>- Sets rtol0
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_ksp_ew_rtolmax &lt;rtolmax&gt; </B></TD><TD>- Sets rtolmax
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_ksp_ew_gamma &lt;gamma&gt; </B></TD><TD>- Sets gamma
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_ksp_ew_alpha &lt;alpha&gt; </B></TD><TD>- Sets alpha
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_ksp_ew_alpha2 &lt;alpha2&gt; </B></TD><TD>- Sets alpha2
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>-snes_ksp_ew_threshold &lt;threshold&gt; </B></TD><TD>- Sets threshold
</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: ch_snes
<P>

<P>
<H3><FONT COLOR="#CC3333">Keywords</FONT></H3>
 <A HREF="../SNES/SNES.html#SNES">SNES</A>, nonlinear, set, options, database
<BR>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 <A HREF="../SNES/SNESSetOptionsPrefix.html#SNESSetOptionsPrefix">SNESSetOptionsPrefix</A>()
<BR><P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>beginner
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/snes/interface/snes.c.html#SNESSetFromOptions">src/snes/interface/snes.c</A>
<BR><A HREF="./index.html">Index of all SNES 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/snes/examples/tutorials/ex1.c.html">src/snes/examples/tutorials/ex1.c.html</A><BR>
<A HREF="../../../src/snes/examples/tutorials/ex2.c.html">src/snes/examples/tutorials/ex2.c.html</A><BR>
<A HREF="../../../src/snes/examples/tutorials/ex3.c.html">src/snes/examples/tutorials/ex3.c.html</A><BR>
<A HREF="../../../src/snes/examples/tutorials/ex5.c.html">src/snes/examples/tutorials/ex5.c.html</A><BR>
<A HREF="../../../src/snes/examples/tutorials/ex5s.c.html">src/snes/examples/tutorials/ex5s.c.html</A><BR>
<A HREF="../../../src/snes/examples/tutorials/ex7.c.html">src/snes/examples/tutorials/ex7.c.html</A><BR>
<A HREF="../../../src/snes/examples/tutorials/ex12.c.html">src/snes/examples/tutorials/ex12.c.html</A><BR>
<A HREF="../../../src/snes/examples/tutorials/ex14.c.html">src/snes/examples/tutorials/ex14.c.html</A><BR>
<A HREF="../../../src/snes/examples/tutorials/ex15.c.html">src/snes/examples/tutorials/ex15.c.html</A><BR>
<A HREF="../../../src/snes/examples/tutorials/ex18.c.html">src/snes/examples/tutorials/ex18.c.html</A><BR>
<A HREF="../../../src/snes/examples/tutorials/ex19.c.html">src/snes/examples/tutorials/ex19.c.html</A><BR>
</BODY></HTML>