[petsc-users] snes set function and Jacobian concurrently

Matthew Knepley knepley at gmail.com
Mon Apr 18 08:40:28 CDT 2016


On Mon, Apr 18, 2016 at 9:34 AM, Hoang Giang Bui <hgbk2008 at gmail.com> wrote:

> Hello
>
> Is it possible to combine the SNESSetFunction and SNESSetJacobian into one
> call, i.e. SNESSetFunctionAndJacobian which takes unique function pointer
> to compute rhs and Jacobian concurrently? The reason for it is that the
> finite element code I'm working on contribute to global rhs and stiffness
> at one call, so to cater for SNES would break the existing interface.
>

The Jacobian and Residual are not always formed together, so you would have
to stash your computation in a user context
and then check that the same X had been passed to both functions. For
example, the Residual can be called many times in
a line search routine.

   Matt


> Another supporting point for that feature is that for irreversible
> problem, the rhs (equilirium) and Jacobian shall not be decoupled, since
> they are not able to return to the past state after proceed.
>




> Giang
>
>


-- 
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/20160418/fbc2ee77/attachment.html>


More information about the petsc-users mailing list