[petsc-users] question on PETSc option '-snes_mf_operator'

Zou (Non-US), Ling ling.zou at inl.gov
Thu Sep 27 13:31:39 CDT 2012


Thanks again, Matt. Your answers are really helpful to me.

Best,

Ling


On Thu, Sep 27, 2012 at 12:22 PM, Matthew Knepley <knepley at gmail.com> wrote:

> On Thu, Sep 27, 2012 at 2:13 PM, Zou (Non-US), Ling <ling.zou at inl.gov>wrote:
>
>> Thank you Matt.
>>
>> I've noticed that there is a different option '-snes_fd', and I guess
>> PETSc will use finite difference method for both Jacobian (action) and
>> Preconditioner?
>>
>
> -snes_fd uses FD to create the entire dense Jacobian. This is just for
> testing. -snes_mf uses FD to evaluate the action
> of the Jacobian on a vector.
>
>
>> By the way, do you have any comments on my another question?
>> ====================
>> One more question, if I pass '-snes' to PETSc, since it is direct
>> Newton's method, I assume it will explicitly construct a Jacobian. Does
>> this Jacobian come from user provided Jacobian or from the finite
>> difference Jacobian?
>> ====================
>>
>
> The option -snes does not do anything. I am not sure what you are asking
> here. If you mean,
> what is used when you pass -snes_mf or -snes_mf_operator, it is FD, not
> the user provided
> Jacobian routine if it exists.
>
>    Matt
>
>
>> Best,
>>
>> Ling
>>
>> On Thu, Sep 27, 2012 at 12:09 PM, Matthew Knepley <knepley at gmail.com>wrote:
>>
>>> On Thu, Sep 27, 2012 at 2:01 PM, Zou (Non-US), Ling <ling.zou at inl.gov>wrote:
>>>
>>>> Dear all,
>>>>
>>>> I have a question on the PETSc option '-snes_mf_operator'.
>>>> I am reading the    <PETSc Users Manual Revision 3.3>. On page 100, 2nd
>>>> paragraph, it says:
>>>>
>>>>
>>>> ==============================================================================
>>>> "However, it allows us to check the analytic Jacobian we construct in
>>>> FormJacobian() by passing the -snes_mf_operator flag. This causes PETSc to
>>>> approximate the Jacobian using finite differencing of the function
>>>> evaluation (discussed in section 5.6), and the analytic Jacobian
>>>> becomes merely the preconditioner."
>>>>
>>>> ==============================================================================
>>>>
>>>> I wonder, if the '-snes_mf_operator' option is used, the Jacobian will
>>>> always be calculated from the finite difference method while
>>>> ignore whatever has been provided from user.
>>>>
>>> Yes, yhe action will be FD, but it will take the user provided operator
>>> to form a preconditioner from.
>>>
>>>    Matt
>>>
>>>
>>>> One more question, if I pass '-snes' to PETSc, since it is direct
>>>> Newton's method, I assume it will explicitly construct a Jacobian. Does
>>>> this Jacobian come from user provided Jacobian or from the finite
>>>> difference Jacobian?
>>>>
>>>>
>>>> Thanks,
>>>>
>>>>
>>>> Ling
>>>>
>>>>
>>>
>>>
>>> --
>>> 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
>>>
>>
>>
>
>
> --
> 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/20120927/a0927e25/attachment.html>


More information about the petsc-users mailing list