[petsc-users] using '-snes_type test' to test my coded Jacobian

Matthew Knepley knepley at gmail.com
Wed Sep 19 15:35:06 CDT 2012


On Wed, Sep 19, 2012 at 3:34 PM, Zou (Non-US), Ling <ling.zou at inl.gov>wrote:

> ==================================================
> Framework Information:
> SVN Revision:            13656
> PETSc Version:           3.1.0
> Current Time:            Wed Sep 19 14:17:01 2012
> Executable Timestamp:    Wed Sep 19 14:14:46 2012
> ==================================================
>
> I believe my version is 3.1.0.
>

If you upgrade to the latest release, it will work.

   Matt


> Ling
>
>
>
> On Wed, Sep 19, 2012 at 2:31 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>
>> Are you using an older version of PETSc?
>>
>>
>> On Wed, Sep 19, 2012 at 2:56 PM, Zou (Non-US), Ling <ling.zou at inl.gov>wrote:
>>
>>> No Jacobian output showed when I did this,
>>>
>>> ./my-project-opt -i input.i -snes_compare_explicit
>>>
>>> Any suggestion?
>>>
>>> Ling
>>>
>>>
>>>
>>> On Wed, Sep 19, 2012 at 1:12 PM, Zou (Non-US), Ling <ling.zou at inl.gov>wrote:
>>>
>>>>
>>>>
>>>> On Wed, Sep 19, 2012 at 1:03 PM, Jed Brown <jedbrown at mcs.anl.gov>wrote:
>>>>
>>>>> On Wed, Sep 19, 2012 at 1:54 PM, Zou (Non-US), Ling <ling.zou at inl.gov>wrote:
>>>>>
>>>>>> Dear Matt,
>>>>>>
>>>>>> Thanks again for helping me on the '-snes_type test' issue. This is a
>>>>>> great tool which helped us make really good progress recently.
>>>>>>
>>>>>> I have couple of more questions about the '-snes_type test'. From my
>>>>>> understanding, this finite difference method is based on a tiny
>>>>>> perturbation from a base solution vector. This base solution vector, from
>>>>>> my observation, seems to be [1, 1, 1, ....].  However, this solution vector
>>>>>> sometimes is very far from real physics, which causes issue, for example a
>>>>>> dependent pressure variable get negative value.
>>>>>>
>>>>>> I wonder,
>>>>>> 1), if this [1, 1, 1, ...] base solution vector is always used during
>>>>>> the real simulation, for example when using the finite difference
>>>>>> preconditioner. Or this base solution vector will change as solution gets
>>>>>> updated?
>>>>>>
>>>>>
>>>>> -snes_type test tries three different states: your user-defined state,
>>>>> then constant -1.0, then constant +1.0. It does not solve the system so you
>>>>> can't continue stepping, but you can just look at the result from the first
>>>>> test.
>>>>>
>>>>
>>>> Ahhh....... I see, that's why I always see three comparisons there. The
>>>> first one should help me better when dealing with real simulation case.
>>>>
>>>>>
>>>>>
>>>>>> 2), is it possible to choose a different base solution, for example,
>>>>>> [1000, 1000, 1000, 10, 10, 10, 1.e9, 1.e9, 1.e9] as the base solution
>>>>>> vector when using the '-snes_type test'  option to test my hand-coded
>>>>>> Jacobian.
>>>>>>
>>>>>
>>>>> You can also use -snes_compare_explicit which shows the matrix (only
>>>>> linearized around your actual state) and actually solves the system. There
>>>>> is also -snes_compare_explicit_draw. If you know that you preallocated
>>>>> correctly, -snes_compare_coloring is better. Details here.
>>>>>
>>>>>
>>>>> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESComputeJacobian.html
>>>>>
>>>>
>>>> This is something new to me. I'd take a look at the link. Thanks a lot,
>>>> Jed.
>>>>
>>>> Best,
>>>>
>>>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120919/58352d49/attachment.html>


More information about the petsc-users mailing list