[petsc-users] Question about TSSetIJacobian examples

Torquil Macdonald Sørensen torquil at gmail.com
Mon Jan 25 04:58:41 CST 2016


I have been looking at some of the PETSc examples where TSSetIJacobian,
and there is one thing which is unclear to me. Consider e.g. the example:


In the function RoberJacobian(), CEJacobian(), OregoJacobian(), there
are two matrix function arguments A and B. The matrix A is the one that
is actually set in the code. My question is: what is the purpose of


when A != B at the end of the function? How does that piece of code
affect B? In the documentation of these functions it says that they are
to be called after e.g. MatSetValues. But MatSetValues have not been
called on B in those functions, so that's why I'm wondering what those
lines are for.

Best regards,
Torquil Sørensen

More information about the petsc-users mailing list