[petsc-users] Solutions different after program restart

Niceno Bojan bojan.niceno at psi.ch
Sun Jun 3 09:19:45 CDT 2012


> It's "safe" in the sense that both answers are equivalent, but it would be
> good to know what is causing the differences. ...

I agree.

> How is the matrix assembled?

I use a command like this:

  MatSetValues(A, 1, &gi, 1, &gj, &M[i][j], INSERT_VALUES);

Always inserting values, rather than adding.


> Did you use -ksp_view_binary and ksp ex10 to check that the system really
> is identical? Does ksp ex10 give the same output each time you run it? 

Not yet.  I am not that prudent with PETSc, I am currently celebrating for being able to see residual history :-)

> Can you send a few iterations of output from -ksp_monitor_true_residual?

Yes, they look like:

  0 KSP preconditioned resid norm 5.321355215818e+01 true resid norm 1.650035042618e+01 ||r(i)||/||b|| 1.000000000000e+00
  1 KSP preconditioned resid norm 2.013755144242e+01 true resid norm 1.361285352452e+01 ||r(i)||/||b|| 8.250039043366e-01
  2 KSP preconditioned resid norm 7.629376453731e+00 true resid norm 3.184316336783e-01 ||r(i)||/||b|| 1.929847702951e-02
  3 KSP preconditioned resid norm 3.869976235279e+00 true resid norm 4.559806478792e-01 ||r(i)||/||b|| 2.763460387822e-02
  4 KSP preconditioned resid norm 1.889666147602e+00 true resid norm 1.422513113059e-01 ||r(i)||/||b|| 8.621108499622e-03
  5 KSP preconditioned resid norm 9.253616017337e-01 true resid norm 1.065191369186e-02 ||r(i)||/||b|| 6.455568164761e-04
  6 KSP preconditioned resid norm 4.759923245260e-01 true resid norm 2.662360840276e-02 ||r(i)||/||b|| 1.613517756600e-03
  7 KSP preconditioned resid norm 2.492423883098e-01 true resid norm 1.216652507263e-02 ||r(i)||/||b|| 7.373494961255e-04
  8 KSP preconditioned resid norm 1.306776196573e-01 true resid norm 1.933734977205e-03 ||r(i)||/||b|| 1.171935702734e-04
  9 KSP preconditioned resid norm 7.267055499898e-02 true resid norm 9.770926706361e-04 ||r(i)||/||b|| 5.921647997767e-05
 10 KSP preconditioned resid norm 3.833602982459e-02 true resid norm 9.695036607433e-04 ||r(i)||/||b|| 5.875654975214e-05
  velocity[0] took 10 iterations to reach residual  3.83360e-02


    Kind regards,


    Bojan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3936 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120603/99db732b/attachment.bin>


More information about the petsc-users mailing list