[petsc-dev] SNES, Coloring, DM, and TS
Jed Brown
jedbrown at mcs.anl.gov
Mon Feb 27 23:12:44 CST 2012
So we still haven't resolved the issue. Let's start by deciding who owns
the function pointers. Are we putting all the function pointers for SNES
and TS into DM? If this is the right route, I can make a simple container
DM that SNES and TS automatically allocate to store the pointers, so the
current interface would continue to work, at least for a while.
What is the alternative?
On Mon, Feb 27, 2012 at 11:55, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> 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/42529510/attachment.html>
More information about the petsc-dev
mailing list