[petsc-dev] SNES, Coloring, DM, and TS
Jed Brown
jedbrown at mcs.anl.gov
Mon Feb 27 11:24:40 CST 2012
On Mon, Feb 27, 2012 at 11:21, Matthew Knepley <knepley at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120227/8a526e8a/attachment.html>
More information about the petsc-dev
mailing list