[petsc-users] Petsc has generated inconsistent data - Divide by zero!

TAY wee-beng zonexo at gmail.com
Fri Jul 8 17:17:02 CDT 2011


Hi Jed,

This is my output when the error happens for gmres:

   2 KSP preconditioned resid norm 1.556688898463e+007 true resid norm 
2.58995443
8801e+003 ||Ae||/||Ax|| 1.232088736212e+003
   2 KSP preconditioned resid norm 1.556688898463e+007 true resid norm 
2.58995443
8801e+003 ||Ae||/||Ax|| 1.232088736212e+003
   3 KSP preconditioned resid norm 1.207952812560e+003 true resid norm 
9.05939430
1179e+003 ||Ae||/||Ax|| 4.309719703237e+003
   3 KSP preconditioned resid norm 1.207952812560e+003 true resid norm 
9.05939430
1179e+003 ||Ae||/||Ax|| 4.309719703237e+003
   3 KSP preconditioned resid norm 1.207952812560e+003 true resid norm 
9.05939430
1179e+003 ||Ae||/||Ax|| 4.309719703237e+003
   3 KSP preconditioned resid norm 1.207952812560e+003 true resid norm 
9.05939430
1179e+003 ||Ae||/||Ax|| 4.309719703237e+003
   3 KSP preconditioned resid norm 1.207952812560e+003 true resid norm 
9.05939430
1179e+003 ||Ae||/||Ax|| 4.309719703237e+003
   4 KSP preconditioned resid norm 3.815055004710e+001 true resid norm 
1.96385966
1729e+002 ||Ae||/||Ax|| 9.342439899591e+001
   4 KSP preconditioned resid norm 3.815055004710e+001 true resid norm 
1.96385966
1729e+002 ||Ae||/||Ax|| 9.342439899591e+001
   4 KSP preconditioned resid norm 3.815055004710e+001 true resid norm 
1.96385966
1729e+002 ||Ae||/||Ax|| 9.342439899591e+001
   4 KSP preconditioned resid norm 3.815055004710e+001 true resid norm 
1.96385966
1729e+002 ||Ae||/||Ax|| 9.342439899591e+001
   4 KSP preconditioned resid norm 3.815055004710e+001 true resid norm 
1.96385966
1729e+002 ||Ae||/||Ax|| 9.342439899591e+001

for fgmres:

  34 KSP preconditioned resid norm 2.428114102327e-005 true resid norm 
3.35941610
6265e-005 ||Ae||/||Ax|| 1.598129588716e-005
  34 KSP preconditioned resid norm 2.428114102327e-005 true resid norm 
3.35941610
6265e-005 ||Ae||/||Ax|| 1.598129588716e-005
  35 KSP preconditioned resid norm 2.200715659545e-005 true resid norm 
3.88294769
5703e-005 ||Ae||/||Ax|| 1.847182191086e-005
  35 KSP preconditioned resid norm 2.200715659545e-005 true resid norm 
3.88294769
5703e-005 ||Ae||/||Ax|| 1.847182191086e-005
  35 KSP preconditioned resid norm 2.200715659545e-005 true resid norm 
3.88294769
5703e-005 ||Ae||/||Ax|| 1.847182191086e-005
  35 KSP preconditioned resid norm 2.200715659545e-005 true resid norm 
3.88294769
5703e-005 ||Ae||/||Ax|| 1.847182191086e-005
  35 KSP preconditioned resid norm 2.200715659545e-005 true resid norm 
3.88294769
5703e-005 ||Ae||/||Ax|| 1.847182191086e-005
  36 KSP preconditioned resid norm 2.011575409369e-005 true resid norm 
3.89282805
6204e-005 ||Ae||/||Ax|| 1.851882441357e-005
  36 KSP preconditioned resid norm 2.011575409369e-005 true resid norm 
3.89282805
6204e-005 ||Ae||/||Ax|| 1.851882441357e-005
  36 KSP preconditioned resid norm 2.011575409369e-005 true resid norm 
3.89282805
6204e-005 ||Ae||/||Ax|| 1.851882441357e-005
  36 KSP preconditioned resid norm 2.011575409369e-005 true resid norm 
3.89282805
6204e-005 ||Ae||/||Ax|| 1.851882441357e-005
  36 KSP preconditioned resid norm 2.011575409369e-005 true resid norm 
3.89282805
6204e-005 ||Ae||/||Ax|| 1.851882441357e-005

Btw, I am solving the x and y momentum eqns so there 's 2 eqns to solve. 
I am using windows so I can show only part of the output. If req, I can 
transfer my code to linux and capture the output.

Hope this explains something.

Thanks!


Yours sincerely,

TAY wee-beng


On 8/7/2011 3:34 PM, Jed Brown wrote:
> On Fri, Jul 8, 2011 at 08:26, TAY wee-beng <zonexo at gmail.com 
> <mailto:zonexo at gmail.com>> wrote:
>
>     [0]PETSC ERROR: KSPSolve_BCGS() line 75 in
>     src/ksp/ksp/impls/bcgs/C:\Codes\PETSC
>     -~1.1-P\src\ksp\ksp\impls\bcgs\bcgs.c
>
>
>     ierr = KSP_PCApplyBAorAB(ksp,P,V,T);CHKERRQ(ierr);  /*   v <- K p 
>           */
>     ierr = VecDot(V,RP,&d1);CHKERRQ(ierr);
>     if (d1 == 0.0) SETERRQ(PETSC_ERR_PLIB,"Divide by zero");
>
> I suspect your preconditioner is singular. What options are you 
> running with? What happens if you use -ksp_type gmres 
> -ksp_gmres_restart 1000 -ksp_gmres_modifiedgramschmidt 
> -ksp_monitor_true_residual? Also do the same run with -ksp_type fgmres.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110709/b8e4dd7c/attachment-0001.htm>


More information about the petsc-users mailing list