[petsc-dev] Promote MatShellSetOperation() and MatShellSetContext() to Mat

Jed Brown jed at 59A2.org
Mon Jun 6 13:32:18 CDT 2011


On Mon, Jun 6, 2011 at 19:57, Barry Smith <bsmith at mcs.anl.gov> wrote:

> I am not yet comfortable with a MatSetApplicationContext() nor a
> VecSetApplicationContext(). I do think it makes sense to have a
> PCSetApplicationContext().
>
>  Should the "solver" application contexts be unified in the following way.
>
>     TSSetApplicationContext() calls SNESSetApplicationContext() calls
> KSPSetApplicationContext() calls PCSetApplicationContext(). And users with
> nonlinear problems call SNESSetApplicationContext() directly and linear
> problems call KSPSetApplicationContext() directly, of course.
>

What about nested linear (or nonlinear) solvers? Does the app context get
forwarded in at each level? What happens when a component is accessed from
multiple places?

I wonder if this forwarding should be made to not overwrite what is already
there. That is, if the user sets it explicitly, then it will not be
overwritten by a parent.


>
>    Meanwhile DMSetContext() is changed to DMSetApplicationContext(), while
> MatShellSetContext() remains MatShellSetContext().  Note that it does not
> have application in it because it is the MatShell context only.
>

How should MatShellSetOperation behave? Should it error or do nothing when
the matrix type is not MATSHELL? If the current behavior is to be preserved,
what is your recommended way to get a context into the function overloading
a method on a non-MATSHELL Mat?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110606/4011615d/attachment.html>


More information about the petsc-dev mailing list