<div class="gmail_quote">On Mon, Feb 27, 2012 at 11:48, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":4k4">? My signature for FormJacobianLocal(DM dm, Vec X, Mat Jac, AppCtx *user) definitely has a context, which is<div>required to have DM as the first member. We could require the solver as the second member.</div>
</div></blockquote></div><br><div>"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*).</div>
<div><br></div><div>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.</div><div>
<br></div><div>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).</div>