[petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

zakaryah . zakaryah at gmail.com
Tue Oct 24 13:45:28 CDT 2017


I see - I use a local variable to add up the terms on each process, then
call MPI_Reduce within the function on process 0, which owns the redundant
variable.

I have one more question - for the calculation of the Jacobian, my life is
made much much easier by using MatSetValuesStencil.  However, the matrix
which the SNES Jacobian receives as argument is the "full" matrix,
containing the DMDA variables (displacements), plus the redundant
variable.  How do I access the submatrix corresponding just to the DMDA?
If I can do that, then I can call MatSetValuesStencil on the submatrix.  Is
this the right approach?  I'm not sure how to set the elements of the
Jacobian which correspond to the redundant variable, either - i.e., how do
I get the ordering?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171024/26e77371/attachment.html>


More information about the petsc-users mailing list