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

Matthew Knepley knepley at gmail.com
Mon Feb 27 23:31:37 CST 2012


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

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


I like this because we are using DM for our equation abstraction. I think
the dependency loops are due to refusal to
decompose the DM.

  Matt


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


-- 
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/dcf8ad17/attachment.html>


More information about the petsc-dev mailing list