<div dir="ltr"><div class="gmail_default" style="font-size:small">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.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">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?</div><div class="gmail_extra"><br></div></div>