[petsc-users] ksppreonly question

Shao-Ching Huang huangsc at gmail.com
Sat Sep 22 02:42:04 CDT 2012


Sounds good. Many thanks!

On Fri, Sep 21, 2012 at 10:42 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> On Sat, Sep 22, 2012 at 12:33 AM, Shao-Ching Huang <huangsc at gmail.com>
> wrote:
>>
>> Is this equivalent to setting up a SNES where the (constant) Jacobian
>> is my A1 matrix, similar to ex35.c in the snes directory (despite with
>> different PC type)?
>
>
> Sure, make your residual function
>
> F(x) = A x - b
>
> and "Jacobian"
>
> J = A1
>
> This is the defect correction version of your algorithm. You can make it
> better by bringing in the concept of orthogonality/spectral adaptivity
> either in via -snes_type ngmres or, recognizing that this system is linear,
> by making the operator A available to the linear solver. You can do that by
> (a) -snes_mf_operator which will finite difference F to compute the action
> or (b) by filling the first Jacobian slot in the SNES compute Jacobian
> callback with a MATSHELL that applies the entire A. I would start with (a)
> because it is simpler, especially if your underlying problem is nonlinear.


More information about the petsc-users mailing list