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

Jed Brown jedbrown at mcs.anl.gov
Mon Feb 27 11:55:24 CST 2012


On Mon, Feb 27, 2012 at 11:48, Matthew Knepley <knepley at gmail.com> wrote:

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

"My" is not the one in DM base. We are suffering some fragmentation because
different DMs implement the local problem differently. I think it would
mostly resolve the issues if the DM functions forwarded the SNES and TS on
to the user, but that makes a dependency loop (unless that code does not
live in DM; we can hack around it with void*).

Alternatively, we can make TS and SNES have PushDM() and PopDM() methods so
the callback can be (SNES, Vec, Mat, void *ctx), but SNESGetDM() returns
the correct DM. Maybe this is too confusing.

In any case, if we fix the DM callbacks, I would prefer to get rid of the
ability for SNES and TS to hold their own callbacks. We can keep
essentially the same user interface (though perhaps the DM argument would
become explicit).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120227/74c5843a/attachment.html>


More information about the petsc-dev mailing list