On Thu, 14 Jan 2010 10:49:11 -0600, Barry Smith <bsmith at mcs.anl.gov> wrote: > Does this handle all situations you are thinking of?
This is definitely the right thing for my example. The other case would be -snes_mf_operator where part of the preconditioner is cached while evaluating F. But this is also not a big deal, since again, the user can SNESGetJacobian(snes,&A,0,0,0); PetscTypeCompare(A,MFFD,&flg); if (flg) MatMFFDSetFunction(A,FormFunctionNoCache,ctx); Doing something different based on the call stack is a really bad thing, I don't think FormFunction should be allowed to find out, just that any cases that seem to call for it should have an alternate mechanism (which they do). Jed