<div class="gmail_quote">On Mon, Feb 27, 2012 at 11:21, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div>Having DM hold the callbacks is a problem. But don't we have them in the context arg?</div></div></blockquote><div><br></div><div><div>PetscErrorCode SNESDMComputeJacobian(SNES snes,Vec X,Mat *J,Mat *B,MatStructure *flag,void *ptr)</div>
<div>{</div><div>  PetscErrorCode ierr;</div><div>  DM             dm;</div><div><br></div><div>  PetscFunctionBegin;</div><div>  ierr = SNESGetDM(snes,&dm);CHKERRQ(ierr);</div><div>  ierr = DMComputeJacobian(dm,X,*J,*B,flag);CHKERRQ(ierr);</div>
<div>  PetscFunctionReturn(0);</div><div>}</div></div><div><br></div><div>The SNES is not available from the callback.</div><div>  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div class="im"><div></div></div></div>Aren't they just passed in? Or do you mean auxiliary vectors?</blockquote></div><br><div>Auxiliary vectors. In this case, they are used by TS to convert the semi-discrete form provided by the user into the fully discrete form being solved by SNES.</div>