<div class="gmail_quote">On Mon, Aug 29, 2011 at 06:39, Milan Mitrovic <span dir="ltr">&lt;<a href="mailto:milan.v.mitrovic@gmail.com">milan.v.mitrovic@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 id=":tk">so I guess this means that it is slightly wrong :)<br></div></blockquote><div><br></div><div>Or your system is somewhat ill-conditioned. If you add &#39;-mat_fd_type ds&#39; to the last command line, are the errors similar or improve a bit? A different way to test for a correct Jacobian is to run with</div>
<div><br></div><div>-snes_mf_operator -pc_type lu</div><div><br></div><div>and check that it converges in 1 or occasionally 2 iterations. This also helps if the Jacobian is incorrect, but not visibly so on the first iteration (e.g. because nonlinearities are silent for the initial guess).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div id=":tk">
can you explain now what it is doing here (and why I get this<br>
error)... </div></blockquote><div><br></div><div>The error to exit early because &quot;test&quot; is not intended to actually solve the equation, -snes_type test is supposed to do that.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":tk">can I make it try to solve the equation with the<br>
approximated fd jacobian (is it doing that already?)</div></blockquote></div><br><div>-snes_mf_operator : solve with matrix-free finite differenced Jacobian, preconditioned using the matrix you assembled</div><div>-snes_fd : assemble the dense FD operator (same as created by -snes_type test) and solve using that</div>