[petsc-users] preconditioner for -snes_fd or -snes_fd_color
Xiangdong
epscodes at gmail.com
Fri Apr 4 16:15:42 CDT 2014
On Fri, Apr 4, 2014 at 5:02 PM, Peter Brune <brune at mcs.anl.gov> wrote:
>
>
>
> On Fri, Apr 4, 2014 at 3:57 PM, Xiangdong <epscodes at gmail.com> wrote:
>
>> Hello everyone,
>>
>> If we use -snes_fd or -snes_fd_color, can we still pass a preconditioner
>> to snes/ksp?
>>
>> In snes/ex1.c, when I use -snes_fd, the program never calls the
>> FormJacobian1 to get the preconditioner.
>>
>
> FormJacobian1 forms... wait for it... the Jacobian! Not the
> preconditioner. -snes_fd and -snes_fd_color replace the Jacobian-forming
> routine.
>
It looks like the FormJacobian1 forms both Jacobian J and preconditioner B.
My observations are
1) Without any options, FormJacobian1 can provide both Jacobian J and
preconditioner B.
2) With -snes_fd, the program does not call the FormJacobian1 function at
all, even if we have SNESSetJacobian in the codes.
If it does not call the FormJacobian1 and SNESSetJacobian is ignored with
-snes_fd, how can I provide the preconditioner to snes?
Thank you.
Xiangdong
>
>
>>
>> Any suggestions about providing preconditioner to snes_fd or
>> snes_fd_color?
>>
>>
> Both of these explicitly create the approximate Jacobian matrix by using
> finite differences, so they may be used with any preconditioner. -snes_mf
> is a different beast entirely and merely approximates the action of the
> matrix without forming it, which is where the preconditioner issues come in.
>
> - Peter
>
>
>> Thanks.
>>
>> Xiangdong
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140404/f8cd450f/attachment.html>
More information about the petsc-users
mailing list