On a related note, it seems that we have this wonky notion of different code paths for the same thing, in which we have SNESSetApplicationContext, DMSetApplicationContext, and then the ctx arguments to SNESSetFunction/Jacobian/GS/Picard. Perhaps we should clarify what is used for what, or remove some?<br>
<br>- Peter<br><br><div class="gmail_quote">On Tue, Aug 14, 2012 at 4:59 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
On Aug 14, 2012, at 4:49 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
<br>
> On Tue, Aug 14, 2012 at 4:47 PM, Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>> wrote:<br>
> On Tue, Aug 14, 2012 at 3:44 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
> You can, but the setter routines interpret NULL as "ignore", i.e.<br>
><br>
> if (func) ctx->func = func;<br>
><br>
> Does this make sense to anyone? Can we remove that if?<br>
><br>
> Then we would have to revisit lots of locations and get the old value before resetting it.<br>
<br>
</div> Explain?<br>
<br>
If the user is providing a new ComputeJacobian with SNESSetJacobian() then it seems reasonable that they are passing a new context to go with that new<br>
ComputeJacobian function. Presumably the old context no longer has any meaning?<br>
<br>
My understanding is that when we pass in a function, ctx pair they are our (crude) C way of passing an object of a simple class. That is they always go together. So if the user passes a null it should replace the old value. If the old one has any meaning, what is it's meaning? Why don't we just null that value out?<br>
<br>
We can always try it and see what happens.<br>
<span class="HOEnZb"><font color="#888888"><br>
Barry<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
> Passing NULL was a convenience.<br>
><br>
> Ah, I see. This is crappy design.<br>
><br>
> Matt<br>
><br>
> --<br>
> 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<br>
<br>
</div></div></blockquote></div><br>