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

Jed Brown jedbrown at mcs.anl.gov
Mon Feb 27 11:31:32 CST 2012


On Mon, Feb 27, 2012 at 11:28, Matthew Knepley <knepley at 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 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120227/79981ce6/attachment.html>


More information about the petsc-dev mailing list