<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Oct 29, 2017 at 5:15 PM, zakaryah . <span dir="ltr"><<a href="mailto:zakaryah@gmail.com" target="_blank">zakaryah@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:small">Good point, Jed - I feel silly for missing this.</div><div style="font-size:small"><br></div><div style="font-size:small">Can I use -snes_type test -snes_test_display with the Jacobian generated from a DMComposite? When I try, it looks like the finite difference Jacobian is missing all the elements in the row corresponding to the redundant variable, except the diagonal, which is wrong.</div></div></blockquote><div><br></div><div>Well, this leads me to believe the residual function is wrong. What the FD Jacobian does is just call the residual</div><div>twice with different solutions. Thus if the residual is different when you perturb the redundant variable, you should</div><div>have Jacobian entries there.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:small">I'm not sure my code for setting the submatrices is correct. I'm especially uncertain about the submatrix J_bh, where b is the redundant variable and h is the displacements. This submatrix has only one row, and all of its columns are non-zero. Can its values be set with MatSetValuesLocal, on all processors?</div><div style="font-size:small"><br></div><div style="font-size:small">Is there an example of manually coding a Jacobian with a DMRedundant?</div></div>
</blockquote></div><br>I don't think so. We welcome contributions.</div><div class="gmail_extra"><br></div><div class="gmail_extra"> Matt<br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>