[petsc-users] KSP and matrix-free matrix (shell)

Jed Brown jed at jedbrown.org
Thu Oct 18 21:10:30 CDT 2018


Matthew Knepley <knepley at gmail.com> writes:

> On Thu, Oct 18, 2018 at 12:07 PM Zhang, Hong <hzhang at mcs.anl.gov> wrote:
>
>> When you use shell matrix, i.e., matrix-free, you cannot it as a
>> preconditioner. Add option '-pc_type none'.
>>
>
> There are some you can use, like -pc_type cheby

That doesn't exist.  You can do the nested iteration that Matt has in
mind with

  -pc_type ksp -ksp_ksp_type chebyshev -ksp_pc_type none

which can be useful if GMRES restarts are killing you, for example.  But
most people using matrix-free are either using geometric multigrid,
defining the diagonal using

  MatShellSetOperation(A, MATOP_GET_DIAGONAL, f)

and/or using PCShell for preconditioning.


More information about the petsc-users mailing list