[petsc-dev] broken TS example related to Jacobian and coloring etc.

Barry Smith bsmith at mcs.anl.gov
Tue Aug 14 17:09:33 CDT 2012


On Aug 14, 2012, at 5:06 PM, Peter Brune <prbrune at gmail.com> wrote:

> 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?

   Yup. Absolutely. 

    There is the issue of mesh size specific stuff in one location and mesh independent stuff in another location. What is the status of that now?



     Barry

> 
> - Peter
> 
> On Tue, Aug 14, 2012 at 4:59 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
> On Aug 14, 2012, at 4:49 PM, Matthew Knepley <knepley at gmail.com> wrote:
> 
> > On Tue, Aug 14, 2012 at 4:47 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> > On Tue, Aug 14, 2012 at 3:44 PM, Matthew Knepley <knepley at gmail.com> 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
> 
> 




More information about the petsc-dev mailing list