On Mon, Feb 27, 2012 at 11:31 AM, Jed Brown <jedbrown@mcs.anl.gov> wrote:
On Mon, Feb 27, 2012 at 11:28, Matthew Knepley <knepley@gmail.com> wrote: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);}I thought the idea was for the solver to come in through the context argument of the user callback. Maybe there should bea structured way to for SNES to modify the DM context which it passes to the user callback.The way the code is written, there is no user context. The user can call DMGetApplicationContext() if they want one, _but_ that should not contain a SNES or TS. The application context should only contain resolution-independent parameters.