<div dir="ltr">Thank you both for your fast answers! I agree, that it might not make a big difference using the centered difference formula, but just to get it from my list of things that could help I will try and implement it. I don't understand how I could miss this forum discussion when I was looking for a way to implement this all day yesterday, but the second link I got now from google typing "petsc MatShell" is a long discussion you had with another user on exactly what I want to do :) Just in case anyone else is looking for the same thing : <a href="http://lists.mcs.anl.gov/pipermail/petsc-users/2010-August/006821.html">http://lists.mcs.anl.gov/pipermail/petsc-users/2010-August/006821.html</a><br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, May 31, 2014 at 6:07 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
You might consider trying some of the non-Newton based nonlinear solvers now available in the development version of PETSc <a href="http://www.mcs.anl.gov/petsc/developers/index.html" target="_blank">http://www.mcs.anl.gov/petsc/developers/index.html</a> Here is a list of them see their manual pages for more details<br>
<br>
<br><br>
<br>
<br>
On May 31, 2014, at 10:02 AM, Jonas Mairhofer <<a href="mailto:mairhofer@itt.uni-stuttgart.de">mairhofer@itt.uni-stuttgart.de</a>> wrote:<br>
<br>
> Hi all,<br>
><br>
> I am using PETSc to solve a system of nonlinear equations arising from Density Functional Theory. Depending on the actual problem setup the residulas of the matrix-free linear solver (GMRES)<br>
> stagnate and the nonlinear system converges only slowly.<br>
> Besides preconditioning my second idea to improve the performance of the linear solver was to use a higher order approximation of the Jacobi-vector product. Therefore, I am trying to write a user defined subroutine that calculates the approximation of the matrix-free Jacobi-Vector product, i.e. I would like to have a routine which can replace the default 1st order approximation<br>
><br>
> J(x)*v = (F(x+eps*v) - F(x) ) / eps<br>
><br>
> for instance by a 2nd order approximation such as<br>
><br>
> J(x)*v = (F(x+eps*v) - F(x-eps*v) ) / 2eps<br>
><br>
> So assuming that I have a subroutine which claculates the approximation of J(x)*v, how do I get PETSc to use this result in the SNES solver?<br>
><br>
> Thank you very much,<br>
> Jonas<br>
<br>
<br></blockquote></div><br></div>