[petsc-dev] SNES, Coloring, DM, and TS

Matthew Knepley knepley at gmail.com
Mon Feb 27 11:28:10 CST 2012


On Mon, Feb 27, 2012 at 11:24 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> 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);
> }
>

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.

   Matt

   Matt


> 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.
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120227/19b606f2/attachment.html>


More information about the petsc-dev mailing list