[petsc-dev] The question about FD Jacobian

Jed Brown jedbrown at mcs.anl.gov
Fri Dec 6 20:11:43 CST 2013


Lulu Liu <lulu.liu at kaust.edu.sa> writes:

> The Jacobian of the nonlinear system (unknowns are p,s) has the form of J=[
> Jpp,Jps;Jsp,Jss].
> However, I want to compute each block of Jacobian at different points.
> Jpp at x=(p1,s1); Jps at x(p2,s2);
> Is it possible to approximate each block (evaluated at different points)
> using FD? I have the residual expression for the nonlinear system:
> f[j][i].p=....
> f[j][i].S=....

You can use MatFDColoring, but you'll have to write separate functions
for each part (fp(p;S), fp(S;p), fS(p;S), fS(S;p)).  Those could be
wrappers around a function that evaluates the whole f(p,S).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20131206/38e4e8ec/attachment.sig>


More information about the petsc-dev mailing list