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

Zou (Non-US), Ling ling.zou at inl.gov
Wed Sep 19 13:54:17 CDT 2012


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?
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.

Best Regards,

Ling



Ling


On Wed, Sep 5, 2012 at 11:35 AM, Matthew Knepley <knepley at gmail.com> wrote:

> On Wed, Sep 5, 2012 at 12:24 PM, Zou (Non-US), Ling <ling.zou at inl.gov>wrote:
>
>> Dear All,
>>
>> I am trying to use the option '-snes_type test' to test my coded
>> Jacobian. I tested with different snes options and it gives me
>> different answers. I wonder if someone could give me a hint what is
>> wrong with my settings.
>>
>> The command line looks like this:
>> ./my-code-opt -i test.i -snes_type test -snes_test_display
>>
>> 1), when using 'petsc_option = -snes' in my input file, it says the
>> Finite difference Jacobian is very different than the Hand-coded
>> Jacobian
>>
>
> This means your hand-coded routine is likely wrong.
>
>
>> 2), when using 'petsc_option = -snes_fd' in my input file, it says the
>> Finite difference Jacobian is idential to the Hand-coded Jacobian
>>
>
> snes_fd replaces your hand-coded routine with our FD routine, so it
> is of course the same as our FD routine.
>
>
>> 3), when using 'petsc_option = -snes_mf_operator', it gives error
>> messages like:
>> "Invalid argument! Cannot test with alternative preconditioner!"
>>
>
> This is inappropriate for testing.
>
>    Matt
>
>
>> Thanks in advance.
>>
>> 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/b4d1683a/attachment.html>


More information about the petsc-users mailing list