<div class="gmail_quote">On Sat, Nov 5, 2011 at 08:06, Matthew Knepley <span dir="ltr">&lt;<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="KJjk4d"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I want to start small by porting a very simple code using fixed point<br>
iterations as follows: A(x)x = b(x) is approximated as A(x0)x = b(x0),<br>
then solved by KSP for x, then x0 is updated to x, then repeat until<br>
convergence.<br></blockquote></div></div></blockquote><div><br></div><div>Run the usual &quot;Newton&quot; methods with A(x) in place of the true Jacobian. You can compute A(x) in the residual</div><div><br></div><div>F(x) = A(x) x - b(x)</div>
<div><br></div><div>and cache it in your user context, then pass it back when asked to compute the Jacobian.</div><div><br></div><div>This runs your algorithm (often called Picard) in &quot;defect correction mode&quot;, but once you write your equations this way, you can try Newton iteration using -snes_mf_operator.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="KJjk4d"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
In the documentation chapter 5 I see all sorts of sophisticated Newton<br>
type methods, requiring computation of the Jacobian. Is the above<br>
defined simple method still accessible somehow in Petsc or such<br>
triviality can only be done by hand? Which one from the existing<br>
nonlinear solvers would be a closest match both in simplicity and<br>
robustness (even if slow performance)?<br></blockquote><div><br></div></div></div><div>You want -snes_type nrichardson. All you need is to define the residual.</div></blockquote></div><br><div>Matt, were the 1000 emails we exchanged over this last month not enough to prevent you from spreading misinformation under a different name?</div>