[petsc-users] Context behind SNESComputeFunction call

Smith, Barry F. bsmith at mcs.anl.gov
Mon Jan 8 15:15:17 CST 2018

> On Jan 8, 2018, at 2:59 PM, Alexander Lindsay <alexlindsay239 at gmail.com> wrote:
> Is there any elegant way to tell whether SNESComputeFunction is being called under different conceptual contexts?
> E.g. non-linear residual evaluation vs. Jacobian formation from finite differencing vs. Jacobian-vector products from finite differencing?

  Under normal usage with the options database no. 

  If you have some reason to know you could write three functions and provide them to SNESSetFunction(), MatMFFDSetFunction(), and MatFDColoringSetFunction(). Note that these functions have slightly different calling sequences but you can have all of them call the same  underlying common function if you are only interested in, for example, how many times the function is used for each purpose.


> Alex

More information about the petsc-users mailing list