[petsc-users] petsc-users Digest, Vol 35, Issue 32

Bao Kai paeanball at gmail.com
Fri Nov 11 05:31:06 CST 2011


Dear Jed,

The following is the result with the options you told me. The iteration has
converged, while converged at a wrong solution, compared to the result from
LU.

tutorials]$ time ./ex78 -Ain A_phi -rhs rhs_phi -solu solu_phi -noshift
-pc_type hypre -pc_hypre_type parasails -ksp_gmres_restart 600 -ksp_rtol
1e-7 -ksp_typ gmres -ksp_monitor_true_residual -ksp_converged_reason


 Read matrix in ascii format ...
m: 288399, n: 288399, nz: 4023176
 read A completed
 rowNumber[0] = 13
 rowNumber[1] = 13
 rowNumber[2] = 19
 read A is complete !

 Read rhs in ascii format ...

 Read exact solution in ascii format ...
  0 KSP preconditioned resid norm 1.311815748108e+00 true resid norm
3.838432566849e-03 ||r(i)||/||b|| 1.000000000000e+00
  1 KSP preconditioned resid norm 5.507600629359e-01 true resid norm
1.878066463331e-03 ||r(i)||/||b|| 4.892795250727e-01
  2 KSP preconditioned resid norm 4.013507277599e-01 true resid norm
1.785692106749e-03 ||r(i)||/||b|| 4.652138797934e-01
  3 KSP preconditioned resid norm 3.186589484171e-01 true resid norm
1.939928539000e-03 ||r(i)||/||b|| 5.053960191341e-01
  4 KSP preconditioned resid norm 2.533816267053e-01 true resid norm
2.182716525094e-03 ||r(i)||/||b|| 5.686478756839e-01
  5 KSP preconditioned resid norm 1.956749847727e-01 true resid norm
2.436511231157e-03 ||r(i)||/||b|| 6.347672360328e-01
  6 KSP preconditioned resid norm 1.489551919079e-01 true resid norm
2.625495747280e-03 ||r(i)||/||b|| 6.840020507214e-01
  7 KSP preconditioned resid norm 1.129706022530e-01 true resid norm
2.726727688051e-03 ||r(i)||/||b|| 7.103753004809e-01
  8 KSP preconditioned resid norm 8.528153693722e-02 true resid norm
2.764872691683e-03 ||r(i)||/||b|| 7.203129515839e-01
  9 KSP preconditioned resid norm 6.419522418091e-02 true resid norm
2.765551151077e-03 ||r(i)||/||b|| 7.204897058665e-01
 10 KSP preconditioned resid norm 4.793073337207e-02 true resid norm
2.754803244091e-03 ||r(i)||/||b|| 7.176896288040e-01
 11 KSP preconditioned resid norm 3.590594904610e-02 true resid norm
2.738481920714e-03 ||r(i)||/||b|| 7.134375485361e-01
 12 KSP preconditioned resid norm 2.683482240096e-02 true resid norm
2.722031760807e-03 ||r(i)||/||b|| 7.091519033880e-01
 13 KSP preconditioned resid norm 2.001207136261e-02 true resid norm
2.709429246945e-03 ||r(i)||/||b|| 7.058686585627e-01
 14 KSP preconditioned resid norm 1.493908729876e-02 true resid norm
2.699791991674e-03 ||r(i)||/||b|| 7.033579318265e-01
 15 KSP preconditioned resid norm 1.111558666088e-02 true resid norm
2.692890954089e-03 ||r(i)||/||b|| 7.015600527536e-01
 16 KSP preconditioned resid norm 8.272119255509e-03 true resid norm
2.688069519102e-03 ||r(i)||/||b|| 7.003039580057e-01
 17 KSP preconditioned resid norm 6.143976425601e-03 true resid norm
2.684895702336e-03 ||r(i)||/||b|| 6.994771057136e-01
 18 KSP preconditioned resid norm 4.563685459707e-03 true resid norm
2.682859292253e-03 ||r(i)||/||b|| 6.989465740324e-01
 19 KSP preconditioned resid norm 3.394656398417e-03 true resid norm
2.681459888330e-03 ||r(i)||/||b|| 6.985819971124e-01
 20 KSP preconditioned resid norm 2.518916365228e-03 true resid norm
2.680609739005e-03 ||r(i)||/||b|| 6.983605136526e-01
 21 KSP preconditioned resid norm 1.872307188353e-03 true resid norm
2.680081243394e-03 ||r(i)||/||b|| 6.982228283859e-01
 22 KSP preconditioned resid norm 1.390334828536e-03 true resid norm
2.679742748684e-03 ||r(i)||/||b|| 6.981346427259e-01
 23 KSP preconditioned resid norm 1.034606694934e-03 true resid norm
2.679535108562e-03 ||r(i)||/||b|| 6.980805476966e-01
 24 KSP preconditioned resid norm 7.710134967260e-04 true resid norm
2.679397134577e-03 ||r(i)||/||b|| 6.980446022989e-01
 25 KSP preconditioned resid norm 5.725407938260e-04 true resid norm
2.679329449922e-03 ||r(i)||/||b|| 6.980269688889e-01
 26 KSP preconditioned resid norm 4.272990427118e-04 true resid norm
2.679284171589e-03 ||r(i)||/||b|| 6.980151728414e-01
 27 KSP preconditioned resid norm 3.181341598383e-04 true resid norm
2.679247206576e-03 ||r(i)||/||b|| 6.980055426050e-01
 28 KSP preconditioned resid norm 2.368729933003e-04 true resid norm
2.679233163958e-03 ||r(i)||/||b|| 6.980018841799e-01
 29 KSP preconditioned resid norm 1.766017339700e-04 true resid norm
2.679224053276e-03 ||r(i)||/||b|| 6.979995106376e-01
 30 KSP preconditioned resid norm 1.313377419946e-04 true resid norm
2.679217016981e-03 ||r(i)||/||b|| 6.979976775210e-01
 31 KSP preconditioned resid norm 9.789603459870e-05 true resid norm
2.679213290696e-03 ||r(i)||/||b|| 6.979967067380e-01
 32 KSP preconditioned resid norm 7.275708495896e-05 true resid norm
2.679210423371e-03 ||r(i)||/||b|| 6.979959597340e-01
 33 KSP preconditioned resid norm 5.412802491776e-05 true resid norm
2.679209810847e-03 ||r(i)||/||b|| 6.979958001573e-01
 34 KSP preconditioned resid norm 4.026672785271e-05 true resid norm
2.679209362635e-03 ||r(i)||/||b|| 6.979956833876e-01
 35 KSP preconditioned resid norm 2.990907253308e-05 true resid norm
2.679208426592e-03 ||r(i)||/||b|| 6.979954395269e-01
 36 KSP preconditioned resid norm 2.226822676398e-05 true resid norm
2.679208136434e-03 ||r(i)||/||b|| 6.979953639342e-01
 37 KSP preconditioned resid norm 1.654703590780e-05 true resid norm
2.679208182746e-03 ||r(i)||/||b|| 6.979953759996e-01
 38 KSP preconditioned resid norm 1.229268254949e-05 true resid norm
2.679208209944e-03 ||r(i)||/||b|| 6.979953830852e-01
 39 KSP preconditioned resid norm 9.149145951039e-06 true resid norm
2.679208050822e-03 ||r(i)||/||b|| 6.979953416303e-01
 40 KSP preconditioned resid norm 6.813825018110e-06 true resid norm
2.679207932900e-03 ||r(i)||/||b|| 6.979953109089e-01
 41 KSP preconditioned resid norm 5.075333494970e-06 true resid norm
2.679208029175e-03 ||r(i)||/||b|| 6.979953359907e-01
 42 KSP preconditioned resid norm 3.770609781438e-06 true resid norm
2.679208069198e-03 ||r(i)||/||b|| 6.979953464175e-01
 43 KSP preconditioned resid norm 2.808924777973e-06 true resid norm
2.679208000517e-03 ||r(i)||/||b|| 6.979953285246e-01
 44 KSP preconditioned resid norm 2.094599249993e-06 true resid norm
2.679207985642e-03 ||r(i)||/||b|| 6.979953246492e-01
 45 KSP preconditioned resid norm 1.559223301396e-06 true resid norm
2.679208018840e-03 ||r(i)||/||b|| 6.979953332981e-01
 46 KSP preconditioned resid norm 1.160309778657e-06 true resid norm
2.679208029228e-03 ||r(i)||/||b|| 6.979953360044e-01
 47 KSP preconditioned resid norm 8.638154916854e-07 true resid norm
2.679208013013e-03 ||r(i)||/||b|| 6.979953317800e-01
 48 KSP preconditioned resid norm 6.436084879799e-07 true resid norm
2.679208008459e-03 ||r(i)||/||b|| 6.979953305937e-01
 49 KSP preconditioned resid norm 4.797395939888e-07 true resid norm
2.679208018385e-03 ||r(i)||/||b|| 6.979953331796e-01
 50 KSP preconditioned resid norm 3.573839482305e-07 true resid norm
2.679208020910e-03 ||r(i)||/||b|| 6.979953338374e-01
 51 KSP preconditioned resid norm 2.662426448119e-07 true resid norm
2.679208017655e-03 ||r(i)||/||b|| 6.979953329896e-01
 52 KSP preconditioned resid norm 1.984893339085e-07 true resid norm
2.679208016597e-03 ||r(i)||/||b|| 6.979953327137e-01
 53 KSP preconditioned resid norm 1.484050273141e-07 true resid norm
2.679208018006e-03 ||r(i)||/||b|| 6.979953330809e-01
 54 KSP preconditioned resid norm 1.106994152625e-07 true resid norm
2.679208019541e-03 ||r(i)||/||b|| 6.979953334807e-01
Linear solve converged due to CONVERGED_RTOL iterations 54

 Accuracy of the soltuion on the solution from LU: | u -U_lu |_2 : 3321.15

 Iteration number is  :  54

 Accuracy of the soltuion: | b - A*u |_2 : 0.004681

real    0m15.393s
user    0m14.895s
sys    0m0.251s



> Message: 2
> Date: Thu, 10 Nov 2011 14:49:55 -0600
> From: Jed Brown <jedbrown at mcs.anl.gov>
> Subject: Re: [petsc-users] Any suggestion for this kinds of matrix?
> To: PETSc users list <petsc-users at mcs.anl.gov>
> Message-ID:
>        <CAM9tzSkW7PZaBLH_sXpxToYv6x3seupTQcY+sPj=fHc_ax-AjA at mail.gmail.com
> >
> Content-Type: text/plain; charset="utf-8"
>
> On Thu, Nov 10, 2011 at 14:45, Bao Kai <paeanball at gmail.com> wrote:
>
> > PCFIELDSPLIT seems a little more complex, I will try that.
> >
> > I tried some different preconditioners, only lu can get right results.
> >
> > With some pc, some wrong results can be obtained, such as the following
> > one.
> >
> > tutorials]$ time ./ex78 -Ain A_in -rhs rhs -solu solu -noshift -pc_type
> > hypre -pc_hypre_type parasails -ksp_gmres_restart 600 -ksp_rtol 1e-5
> > -ksp_typ gmres
> >
>
> Always run with -ksp_monitor_true_residual -ksp_converged_reason when
> checking whether a preconditioner is working.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111110/3d5e1de6/attachment-0001.htm
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111111/f4423574/attachment-0001.htm>


More information about the petsc-users mailing list