<div dir="ltr"><div class="gmail_default" style="font-size:small">That worked - thanks Matt</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 17, 2018 at 1:19 PM Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Sep 17, 2018 at 12:12 PM zakaryah <<a href="mailto:zakaryah@gmail.com" target="_blank">zakaryah@gmail.com</a>> wrote:<br></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 still working on implementing a homotopy solver for systems of nonlinear equations. It seems that everything is working in serial, but I'm having at least one issue in parallel.</div><div style="font-size:small"><br></div><div style="font-size:small">To form the (n+1) x (n+1) Jacobian, I use MatGetLocalSubMatrix, with the ISs from the DMComposite. One of the submatrices is (globally) 1 x n. I need to set one of its values, at global column j, to a particular value. My current attempt to do this involves getting the local to global mappings, with DMCompositeGetISLocalToGlobalMappings, then using ISGlobalToLocalMappingsApply with global index j. If the processor has a locally mapped index, I call MatSetValuesLocal at the local index.</div><div style="font-size:small"><br></div><div style="font-size:small">So far, this works, in that it seems the value is set at the appropriate point. My issue is that I must use ADD_VALUES, due to the nature of the algorithm for the other submatrices. Therefore, I need a way to ensure that the correct value is set. For example, if two processors map to the same global index, then I need a way to check this and use local values such that the sum is the correct global value.</div></div></blockquote><div><br></div><div>This sounds wrong. I think you should fix the algorithm to use INSERT, which is what you really want. You can usually partition it into</div><div>and ADD phase, then call Assembly with FLUSH, and then an INSERT phase.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</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 suspect that this has a simple solution - hopefully someone has some hints. Thanks!</div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-2027444647991035263gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><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.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div>