Re: [petsc-dev] SNES, Coloring, DM, and TS
On Mon, Feb 27, 2012 at 11:31 AM, Jed Brown <[email protected]> wrote:
On Mon, Feb 27, 2012 at 11:28, Matthew Knepley <[email protected]> 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 be a 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.
? My signature for FormJacobianLocal(DM dm, Vec X, Mat Jac, AppCtx *user) definitely has a context, which is required to have DM as the first member. We could require the solver as the second member. Matt -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener
participants (1)
-
Matthew Knepley