[petsc-dev] snes/examples/tutorials/ex27.c

Matthew Knepley knepley at gmail.com
Tue Nov 15 17:37:39 CST 2011


On Tue, Nov 15, 2011 at 5:13 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
> On Nov 15, 2011, at 3:48 PM, Jed Brown wrote:
>
> > On Tue, Nov 15, 2011 at 15:44, Barry Smith <bsmith at mcs.anl.gov> wrote:
> > How about a SNES level interface that backs into the TS for the
> implementation? The thing is "if one is solving a nonlinear problem they
> should use the nonlinear solver interface" not a completely different
> interface that exists for a different purpose.
> >
> > Well, I don't choose KSP, SNES, or TS based on what kind of problem I'm
> trying to solve,
>
>    I do :-)
>
>
> > I choose it based on how I want to describe the problem. So I might use
> SNES for a linear problem because I want to write a function to evaluate
> the RHS and a function to evaluate the Jacobian. And I might use TS for a
> steady problem because I want a principled way to do damping and to
> accelerate certain regions.
>
>    Hmm, if I write my code to use SNES to solve a nonlinear system and
> decide I want to instead use Ptc I have to write new code and a whole knew
> interface.
>
>   If I wrote my code to use Jacobi and decided I wanted to try ILU should
> I have to write a new code? Obviously not so why is your case different? I
> just add a mass matrix (for example) and say I want to use Ptc with SNES or
> don't even add a mass matrix just say I want to use Ptc.


This does expose a problem with our solvers. They should fit together
better than they do. I would like to see them telescope so that

  a) A and b set into a KSP could be used by an enclosing SNES to do
iterative refinement

  b) FormFunction and FormJacobian in a SNES could be used by an enclosing
TS to do pseudo-timestepping

This way, the user does no more work than create a solver wrapper, and we
get interface separation.

   Matt


>
> >
> > I think it would be more confusing to use SNES because then we would
> need to augment the SNES interface so the user can provide the IJacobian.
> Having another function signature that the user has to implement is BAD.
>
>   I think using TS to solve a nonlinear equation is more confusing.
>
>   This needs a few use cases to clarify
>
>   Barry
>
>


-- 
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/20111115/264b2a53/attachment.html>


More information about the petsc-dev mailing list