#include "petscsnes.h" PetscErrorCode SNESSetPicard(SNES snes,Vec r,PetscErrorCode (*b)(SNES,Vec,Vec,void*),Mat Amat, Mat Pmat, PetscErrorCode (*J)(SNES,Vec,Mat,Mat,void*),void *ctx)Logically Collective on SNES
snes | - the SNES context | |
r | - vector to store function value | |
b | - function evaluation routine | |
Amat | - matrix with which A(x) x - b(x) is to be computed | |
Pmat | - matrix from which preconditioner is computed (usually the same as Amat) | |
J | - function to compute matrix value, see SNESJacobianFunction for details on its calling sequence | |
ctx | - [optional] user-defined context for private data for the function evaluation routine (may be NULL) |
One can call SNESSetPicard() or SNESSetFunction() (and possibly SNESSetJacobian()) but cannot call both
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}
Note that when an exact solver is used this corresponds to the "classic" Picard A(x^{n}) x^{n+1} = b(x^{n}) iteration.
Run with -snes_mf_operator to solve the system with Newton's method using A(x^{n}) to construct the preconditioner.
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)
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 :-).