[petsc-dev] Picard with TS

Barry Smith bsmith at mcs.anl.gov
Sun Jan 1 12:00:33 CST 2017


   What are LandSNESFunction() and LandSNESJacobian()? 

   Note that Picard 

       Solves the equation A(x) x = b(x) via the defect correction algorithm A(x^{n}) (x^{n+1} - x^{n}) = b(x^{n}) - A(x^{n})x^{n}

   The functions you need to provide are (compute the vector) b(x)  and (compute the matrix) A(x).   A() is most definitely not the Jacobian of b(). To use Picard you have to rewrite the nonlinear equations that come out of the definition of the time-step in the form A(x) x = b(x).  This may require additions to TS, I don't know.

   Barry



> On Jan 1, 2017, at 8:56 AM, Mark Adams <mfadams at lbl.gov> wrote:
> 
> I tried using Picard inside of TS, and SNES diverged. Is this supposed to be possible?  I tried to do do this by wrapping my operator in a SNES version and simply adding it like this.
> 
> Mark
> 
>   ierr = TSSetIFunction(ts,NULL,LandIFunction,ctx);CHKERRQ(ierr);
>   ierr = TSSetIJacobian(ts,J,J,LandIJacobian,ctx);CHKERRQ(ierr);
>     SNES snes;
>     Vec vec;
>     ierr = VecDuplicate(uu,&vec);CHKERRQ(ierr);
>     ierr = TSGetSNES(ts,&snes);CHKERRQ(ierr);
>     ierr = SNESSetPicard(snes, vec, LandSNESFunction, J, J, LandSNESJacobian, ctx);CHKERRQ(ierr);
>   




More information about the petsc-dev mailing list