Re: [petsc-dev] broken TS example related to Jacobian and coloring etc.
On Aug 14, 2012, at 4:49 PM, Matthew Knepley <[email protected]> wrote:
On Tue, Aug 14, 2012 at 4:47 PM, Jed Brown <[email protected]> wrote: On Tue, Aug 14, 2012 at 3:44 PM, Matthew Knepley <[email protected]> wrote: You can, but the setter routines interpret NULL as "ignore", i.e.
if (func) ctx->func = func;
Does this make sense to anyone? Can we remove that if?
Then we would have to revisit lots of locations and get the old value before resetting it.
Explain? 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 ComputeJacobian function. Presumably the old context no longer has any meaning? 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? We can always try it and see what happens. Barry
Passing NULL was a convenience.
Ah, I see. This is crappy design.
Matt
-- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener
participants (1)
-
Barry Smith