[petsc-dev] broken TS example related to Jacobian and coloring etc.

Jed Brown jedbrown at mcs.anl.gov
Tue Aug 14 17:58:01 CDT 2012


On Tue, Aug 14, 2012 at 4:19 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>  Ok, but then that context cannot be used for any other purpose because of
> the possible conflict. Which means SNEScoloring thing must be changed.
>
>    Why not use SNESSetApplicationContext() to get the ts into SNES?
>

I don't mind this, but I think it would be cleaner to change SNES coloring.


> Here you are passing into the jacobian location something more general
> than the jacobian context.
>

Why is it more general? It's exactly the context needed to compute the
Jacobian.


> Do you also pass the ts to the SNESSetFunction() context?
>

Yes.


I philosophically like having separate contexts for each callback because
it avoids imposing a certain class structure on the user. That is, if we
just had XXSetApplicationContext() and all the callbacks used that, it
basically forces the user to implement each callback from the same class. I
think that is usually the right design, but not always, and I'd hate to
place that constraint on the user.

Now assuming that the flexibility above is good, we should not have SNES
treat TS specially. When someone wraps a different loop around SNES
(optimization, UQ, etc), they should be able to compose using standard
interfaces. This is why I think that SNES coloring is the misbehaving
component.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120814/3cd662bf/attachment.html>


More information about the petsc-dev mailing list