On Mon, Feb 27, 2012 at 11:24 AM, Jed Brown <jedbrown@mcs.anl.gov> wrote:
On Mon, Feb 27, 2012 at 11:21, Matthew Knepley <knepley@gmail.com> wrote:Having DM hold the callbacks is a problem. But don't we have them in the context arg?PetscErrorCode SNESDMComputeJacobian(SNES snes,Vec X,Mat *J,Mat *B,MatStructure *flag,void *ptr){PetscErrorCode ierr;DM dm;PetscFunctionBegin;ierr = SNESGetDM(snes,&dm);CHKERRQ(ierr);ierr = DMComputeJacobian(dm,X,*J,*B,flag);CHKERRQ(ierr);PetscFunctionReturn(0);}
The SNES is not available from the callback.Aren't they just passed in? Or do you mean auxiliary vectors?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.