[petsc-users] Using matrix-free method for SNES problems with an explicit Jacobian

Matthew Knepley knepley at gmail.com
Wed May 13 15:15:09 CDT 2015


On Wed, May 13, 2015 at 2:54 PM, Justin Chang <jychang48 at gmail.com> wrote:

> Hello everyone,
>
> From what I read online, one could use a matrix-free method if using the
> conjugate gradient method for a symmetric and positive definite problem.
> Some of the PETSc SNES examples like ex12 compute the Jacobian A
> explicitly, but I was wondering if it's possible to convert this
> problem into matrix free form. That is, to directly assemble the product of
> A*x into vector form without first forming A and then invoking MatMult().
>

Yes, Jed advocates this all the time, but there is some infrastructure that
you want for this
to be really effective. For quadratic and higher orders, it makes sense to
compute the action
of your operator MF. This is done by defining something that looks a lot
like your residual
evaluation (element vec in and out) but computes the linearization.
However, you still usually
need a low order explicit matrix for preconditioning. I have not spent time
hooking that all together.

  Thanks,

    Matt


> Thanks,
> Justin
>



-- 
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-users/attachments/20150513/fa3db454/attachment.html>


More information about the petsc-users mailing list