File: SNESSetPicard.html

package info (click to toggle)
petsc 3.4.2.dfsg1-8.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 129,104 kB
  • ctags: 516,422
  • sloc: ansic: 395,939; cpp: 47,201; python: 34,788; makefile: 17,193; fortran: 16,251; f90: 1,592; objc: 954; sh: 822; xml: 621; java: 381; lisp: 293; csh: 241
file content (71 lines) | stat: -rw-r--r-- 4,882 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
<!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/SNESSetPicard.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>SNESSetPicard</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
   <div id="version" align=right><b>petsc-3.4.2 2013-07-02</b></div>
<A NAME="SNESSetPicard"><H1>SNESSetPicard</H1></A>
Use <A HREF="../SNES/SNES.html#SNES">SNES</A> to solve the semilinear-system A(x) x = b(x) via a Picard type iteration (Picard linearization) 
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscsnes.h"  
PetscErrorCode  SNESSetPicard(SNES snes,Vec r,PetscErrorCode (*SNESFunction)(SNES,Vec,Vec,void*),Mat Amat, Mat Pmat, PetscErrorCode (*SNESJacobianFunction)(SNES,Vec,Mat*,Mat*,MatStructure*,void*),void *ctx)
</PRE>
Logically Collective on <A HREF="../SNES/SNES.html#SNES">SNES</A>
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>snes </B></TD><TD>- the <A HREF="../SNES/SNES.html#SNES">SNES</A> context
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>r </B></TD><TD>- vector to store function value
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../SNES/SNESFunction.html#SNESFunction">SNESFunction</A> </B></TD><TD>- function evaluation routine
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>Amat </B></TD><TD>- matrix with which A(x) x - b(x) is to be computed
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>Pmat </B></TD><TD>- matrix from which preconditioner is computed (usually the same as Amat)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../SNES/SNESJacobianFunction.html#SNESJacobianFunction">SNESJacobianFunction</A>  </B></TD><TD>- function to compute matrix value
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>ctx </B></TD><TD>- [optional] user-defined context for private data for the
function evaluation routine (may be NULL)
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
We do not recomemend using this routine. It is far better to provide the nonlinear function F() and some approximation to the Jacobian and use
an approximate Newton solver. This interface is provided to allow porting/testing a previous Picard based code in PETSc before converting it to approximate Newton.
<P>
One can call <A HREF="../SNES/SNESSetPicard.html#SNESSetPicard">SNESSetPicard</A>() or <A HREF="../SNES/SNESSetFunction.html#SNESSetFunction">SNESSetFunction</A>() (and possibly <A HREF="../SNES/SNESSetJacobian.html#SNESSetJacobian">SNESSetJacobian</A>()) but cannot call both
<P>
<pre>
    Solves the equation A(x) x = b(x) via the defect correction algorithm A(x^{n}) (x^{n+1} - x^{n}) = b(x^{n}) - A(x^{n})x^{n}
</pre>
<pre>
    Note that when an exact solver is used this corresponds to the "classic" Picard A(x^{n}) x^{n+1} = b(x^{n}) iteration.
</pre>
<P>
Run with -snes_mf_operator to solve the system with Newton's method using A(x^{n}) to construct the preconditioner.
<P>
We implement the defect correction form of the Picard iteration because it converges much more generally when inexact linear solvers are used then
the direct Picard iteration A(x^n) x^{n+1} = b(x^n)
<P>
There is some controversity over the definition of a Picard iteration for nonlinear systems but almost everyone agrees that it involves a linear solve and some
believe it is the iteration  A(x^{n}) x^{n+1} = b(x^{n}) hence we use the name Picard. If anyone has an authoritative  reference that defines the Picard iteration
different please contact us at petsc-dev@mcs.anl.gov and we'll have an entirely new argument :-).
<P>

<P>
<H3><FONT COLOR="#CC3333">Keywords</FONT></H3>
 <A HREF="../SNES/SNES.html#SNES">SNES</A>, nonlinear, set, function
<BR>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 <A HREF="../SNES/SNESGetFunction.html#SNESGetFunction">SNESGetFunction</A>(), <A HREF="../SNES/SNESSetFunction.html#SNESSetFunction">SNESSetFunction</A>(), <A HREF="../SNES/SNESComputeFunction.html#SNESComputeFunction">SNESComputeFunction</A>(), <A HREF="../SNES/SNESSetJacobian.html#SNESSetJacobian">SNESSetJacobian</A>(), <A HREF="../SNES/SNESGetPicard.html#SNESGetPicard">SNESGetPicard</A>(), <A HREF="../SNES/SNESLineSearchPreCheckPicard.html#SNESLineSearchPreCheckPicard">SNESLineSearchPreCheckPicard</A>()
<BR><P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>intermediate
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/snes/interface/snes.c.html#SNESSetPicard">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>
</BODY></HTML>