[petsc-users] about Matrix-Free

behzad baghapour behzad.baghapour at gmail.com
Mon Jun 4 01:41:06 CDT 2012


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.

Thanks,
BehZad


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

> Dear all,
>
> I want to compute Jacobian matrix via Matrix-Free manner in SNES
> procedure. I should consider the time-marching term as M*dQ/dt with is not
> the part of finite-differencing and should be added into diagonal blocks of
> the matrix. So, how should be right to calculate the Jacobian using the
> prepared Petsc routines?
>
> Thanks a lot,
> BehZad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120604/699dd35c/attachment.html>


More information about the petsc-users mailing list