Fwd: [petsc-maint #38493] TSSetIJacobian()

Jed Brown jed at 59A2.org
Fri Dec 4 09:04:30 CST 2009


On Fri, 4 Dec 2009 08:23:15 -0600, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
>     Any ideas?

Maybe a -snes_mf has crept in.

> >>> I have a problem with a routine that evaluates a Jacobian matrix.
> >>> The problem is that PETSc never enters the RHSJacobian()
> >>> routine. I know that PETSc enters the RHSFunction() rotine threw a
> >>> print statement.  The output is something like:
> >>>
> >>> At t[0] =      0.00e+00 u=       0.00e+00 at the center
> >>> RHSFunction!
> >>> RHSFunction!
> >>> RHSFunction!
> >>> ...
> >>> RHSFunction!
> >>> RHSFunction!
> >>> RHSFunction!

This looks like a MatMFFD Jacobian, could you send -log_summary or -info
output?

If this is not it, could you set a breakpoint in SNESSetJacobian and
send the trace from every time it is called, it's a little tricky to
make the -snes_mf option work while not interfering with the TS setting
up the SNES.


> >>> /* Set user-provided RHSFunction and RHSJacobian */
> >>> ierr = TSSetIFunction(ts, RHSFunction, ctx);CHKERRQ(ierr);
> >>> ierr = TSSetIJacobian(ts, J, J, RHSJacobian, ctx);CHKERRQ(ierr);

Note that the implicit formulation is *not* a right hand side.  If your
system is written as x' = f(t,x) you can use the TSSetRHS* interface,
TSSetI* is for the more general f(t,x,x') = 0.

Your setup code looks fine to me.

Jed



More information about the petsc-dev mailing list