[petsc-users] Using SNES in a legacy code

Matthew Knepley knepley at gmail.com
Fri May 5 11:28:38 CDT 2017


On Fri, May 5, 2017 at 11:14 AM, Karin&NiKo <niko.karin at gmail.com> wrote:

> Dear PETSc team,
>
> I am part of the development team of legacy fortran code with a tailored
> Newton's method. The software is already using PETSc's linear solvers and
> we enjoy it. Now I would like to evaluate the SNES solver.
> I have already extracted a function in order to compute the Jacobian and
> another one to compute the residual.
> But there is something I cannot figure out : at each Newton's iteration,
> our solver needs to know the unknowns value in order to compute the
> Jacobian. But the increment vector is computed within the SNES.
>

The FormJacobian() function that you pass in gets the current guess as an
argument.

  Thanks,

    Matt


> How can I synchronize PETSc's vector of unknowns  and mine? Is there some
> kind of SNESSetPostSolveShell ?
>
> Thanks for developping PETSc,
> Nicolas
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170505/852d2b22/attachment.html>


More information about the petsc-users mailing list