[petsc-users] Snes ex22.c

Ryan Yan vyan2000 at gmail.com
Mon Mar 29 11:17:10 CDT 2010


Dear All,
Could someone help to answer a question about snes/ex22.c?
I runed the program twice with two different option sets.

In the first run,  I used:
mpirun -np 1 ./ex22 -da_grid_x 10 -snes_monitor

this will invoke all the matrix_free_options at line 96.   It is shown that
on all grid levels we have a aggressive convergence.
http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/src/snes/examples/tutorials/ex22.c.html
          0 SNES Function norm 6.285393610547e-01
          1 SNES Function norm 3.743759728398e-06
          2 SNES Function norm 2.855651342153e-11
        0 SNES Function norm 4.708310005567e-01
        1 SNES Function norm 2.696769540300e-06
        2 SNES Function norm 9.009613143190e-12
      0 SNES Function norm 3.456250981375e-01
      1 SNES Function norm 3.224179904192e-07
      2 SNES Function norm 8.831908707996e-13
    0 SNES Function norm 2.565116065949e-01
    1 SNES Function norm 2.781184363175e-08
    2 SNES Function norm 1.880008919009e-14
  0 SNES Function norm 1.957654311750e-01
  1 SNES Function norm 4.039546692288e-07
  2 SNES Function norm 3.668272652964e-13


In the second run, I use the matrix based method, with the following options
mpirun -np 1 ./ex22 -da_grid_x 10 -use_matrix_based -ksp_type fgmres
-snes_monitor
(The reason why I use fgmres is because I want to compare the result with
the first run.)
No significant convergence can be obtained at this run.
           0 SNES Function norm 6.285393610547e-01
           1 SNES Function norm 1.646083626629e-01
         0 SNES Function norm 6.321514185793e-01
       0 SNES Function norm 1.046493792681e+00
     0 SNES Function norm 1.906667654680e+00
   0 SNES Function norm 3.721097900524e+00


I have checked the ksp_view and snes_view for both cases. The only
difference seems to me is that in the first run it is using matrix free
method to achieve MatVec for the GMRES method(inside the Multigrid
preconditioner ) for the error equation, and in the second run it is using a
concrete matrix obtained from finite difference to achieve MatVec for the
GMRES method(inside the Multigrid preconditioner ) for the error equation.

An deeper check using -ksp_monitor will show that for the second run, within
each newton inner loop the ksp residual stagnates.

I guess my question is: Is this behavior normal and how to understand this?
Or is there any other difference that I did not see in those two different
test runs, except the way they use to achieve the MatVec?

Thank you very much,

Yan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20100329/d89cb629/attachment.htm>


More information about the petsc-users mailing list