[petsc-users] Question about TSSetIJacobian examples

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


Hi!

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:

http://www.mcs.anl.gov/petsc/petsc-current/src/ts/examples/tutorials/ex8.c.html

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

MatAssemblyBegin(B,MAT_FINAL_ASSEMBLY);
MatAssemblyEnd(B,MAT_FINAL_ASSEMBLY);

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