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

TAY wee-beng zonexo at gmail.com
Sat Jul 9 17:21:49 CDT 2011


Hi Jed,

I have attached the output runing under linux. It's only running with 1 
processor. I am using runge kutta 3rd order to solve my problem, so 
there's 3 substeps per time step ie I need to solve the x/y momentum 
eqns 3 times per time step.

The error occurs at t=2, substep=2. It stated in the output.

Btw, I am solving the x and y momentum eqns separately, since they are 
independent of one another. How can I solve it together?

My code is:

call 
MatSetValues(A_semi_x,1,II,1,JJ,semi_mat_x(k,kk),INSERT_VALUES,ierr) ...

call MatAssemblyBegin(A_semi_x,MAT_FINAL_ASSEMBLY,ierr)
call MatAssemblyEnd(A_semi_x,MAT_FINAL_ASSEMBLY,ierr)

call KSPGetPC(ksp_semi_x,pc_semi_x,ierr)
ksptype=KSPBCGS
call KSPSetType(ksp_semi_x,ksptype,ierr)
call KSPSetFromOptions(ksp_semi_x,ierr)

tol=1.e-5

call 
KSPSetTolerances(ksp_semi_x,tol,PETSC_DEFAULT_DOUBLE_PRECISION,PETSC_DEFAULT_DOUBLE_PRECISION,PETSC_DEFAULT_INTEGER,ierr)

exactly the same for y...

call VecAssemblyBegin(b_rhs_semi_x,ierr)
call VecAssemblyEnd(b_rhs_semi_x,ierr)

call VecAssemblyBegin(xx_semi_x,ierr)
call VecAssemblyEnd(xx_semi_x,ierr)

call KSPSetOperators(ksp_semi_x,A_semi_x,A_semi_x,SAME_NONZERO_PATTERN,ierr)
call KSPSolve(ksp_semi_x,b_rhs_semi_x,xx_semi_x,ierr)
call KSPGetConvergedReason(ksp_semi_x,reason,ierr)

exactly the same for y...

Thanks alot!

Yours sincerely,

TAY wee-beng


On 9/7/2011 12:26 AM, Jed Brown wrote:
> On Fri, Jul 8, 2011 at 17:17, TAY wee-beng <zonexo at gmail.com 
> <mailto:zonexo at gmail.com>> wrote:
>
>     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
>
>
> Why is the same line output multiple times? Do you have an MPI problem?
>
> This convergence looks funky; I suspect your preconditioner is 
> singular and/or nonlinear. Please send -ksp_view output as you are 
> running here and with -pc_type asm -sub_pc_type lu.
>
>
>     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.
>
>
> Do you solve them separately or both at once? (We usually recommend 
> the latter.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110710/e817c691/attachment-0001.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: log1
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110710/e817c691/attachment-0002.diff>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: log2
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110710/e817c691/attachment-0003.diff>


More information about the petsc-users mailing list