[petsc-users] Question about petsc-3.2-p5/src/ts/examples/tutorials/ex15.c

Feng-Chao Wang wolfshow at gmail.com
Tue Dec 27 18:07:06 CST 2011


Dear Hong, Thank you very much for your patient explanations. I got that. Thank you!
Feng-Chao

2011-12-28



Feng-Chao Wang



Message: 2
Date: Tue, 27 Dec 2011 10:16:10 -0600
From: Hong Zhang <hzhang at mcs.anl.gov>
Subject: Re: [petsc-users] Question about
petsc-3.2-p5/src/ts/examples/tutorials/ex15.c
To: PETSc users list <petsc-users at mcs.anl.gov>
Message-ID:
<CAGCphBu6GsUaZty1vseHwhLDJeKX2=ViM=VFUMLaHtnbY+Nhpg at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Feng-Chao,
Jtype == 1 is for /* slow finite difference J; */
computes dense Jacobian one column at a time, taking prohibitively
long time for large
matrices. For 101*101 matrix, i.e., it evaluates 1.e+4 columns
(evaluate function 1.e+4 times).
Running it on my Mac, the execution terminates after a hang with error
timestep 0: time 0, solution norm 391.65, max 1, min 0
[0]PETSC ERROR: --------------------- Error Message
------------------------------------
[0]PETSC ERROR:   !
[0]PETSC ERROR: TSStep has failed due to DIVERGED_NONLINEAR_SOLVE!
With -da_grid_x 51 -da_grid_y 51, it runs, but is extremely slow.
As stated in the petsc manual, SNESDefaultComputeJacobian() is not
recommended for general use in large-scale applications. It only works on
tiny matrices for checking the correctness of a user-provided Jacobian.
For ex15.c, it obviously only works for up to 51x51 grids on the
machine we tested.
Hong
On Tue, Dec 27, 2011 at 12:32 AM, Fatcharm <wolfshow at gmail.com> wrote:
> Dear all,
>
> I am working with an example of "petsc-3.2-p5/src/ts/examples/tutorials/ex15.c"
>
> I noticed that in ex15.c,
>
> Jtype == 0 means ?that /* use user provided Jacobian evaluation routine */
> Jtype == 1 is for /* slow finite difference J; */
> and Jtype == 2 is /* Use coloring to compute ?finite difference J efficiently */
>
> I found a problem, when I run ex15 with
>
> mpiexec -n 8 ./ex15 -da_grid_x 101 -da_grid_y 101 -Jtype 0 -drawcontours
>
> or
>
> mpiexec -n 8 ./ex15 -da_grid_x 101 -da_grid_y 101 -Jtype 2 -drawcontours
>
> , it works well.
>
> However, when I run ex15 with
>
> mpiexec -n 8 ./ex15 -da_grid_x 101 -da_grid_y 101 -Jtype 1 -drawcontours
>
> the solution remains the same as the initial condition.
>
> If I reduced the da_grid_x and da_grid_y, the command
>
> mpiexec -n 8 ./ex15 -da_grid_x 51 -da_grid_y 51 -Jtype 1 -drawcontours
>
> works well.
>
> The manual tells me that "Although SNESDefaultComputeJacobian() is not
> recommended for general use in large-scale applications, It can be
> useful in checking the correctness of a user-provided Jacobian."
>
> I am confused that if SNESDefaultComputeJacobian() can not give the
> correct Jacobian when using "mpiexec -n 8 ./ex15 -da_grid_x 101
> -da_grid_y 101 -Jtype 1 -drawcontours", then how can it be used to
> check the user-provided Jacobian?
>
> Is there somebody encountering the same problem or give me some advice?
>
> Thank you very much!
>
> Feng-Chao Wang
------------------------------
_______________________________________________
petsc-users mailing list
petsc-users at mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/petsc-users
End of petsc-users Digest, Vol 36, Issue 80
*******************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111228/e6ed6f82/attachment.htm>


More information about the petsc-users mailing list