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

Barry Smith bsmith at mcs.anl.gov
Tue Nov 15 17:13:43 CST 2011


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. 


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




More information about the petsc-dev mailing list