[petsc-users] about Matrix-Free

Jed Brown jedbrown at mcs.anl.gov
Mon Jun 4 06:34:03 CDT 2012


On Mon, Jun 4, 2012 at 1:41 AM, behzad baghapour <behzad.baghapour at gmail.com
> wrote:

> According to my last question, I am trying to use Shell to handle the
> MatrixFree procedure as below:
>
> 1- Define residual as:
>        F := M * DQ/Dt - R(Q) (R is the nonlinear residual obtained from
> discretization)
> 2- MatCreateShell
> 3- MatShellSetOperation -> MATOP_MULT as follows:
>        dF/dQ * v = M * v / Dt - ( R(Q+eps*v) - R(Q) ) / eps
> 4- Using this operation in each step of KSP (GMRES) subspace construction.
>
> Does the above procedure seem reasonable to use with SNES? Please help me
> if it needs more considerations.
>

You can just set the SNES function and do -snes_mf, then this will be done
for you.

You might also consider using TS. TSSetIFunction() is the interface you
propose.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120604/17a05adf/attachment.html>


More information about the petsc-users mailing list