[petsc-users] Questions about residual function can't be reduced

Yingjie Wu yjwu16 at gmail.com
Thu Sep 6 03:47:38 CDT 2018


Dear Petsc developer:
Hi,
Thank you for your previous help.
I recently modeled on PETSc's SNES example and wrote a computer program
myself. This program is mainly for solving nonlinear equations of thermal
hydraulics.

∇·(λ∇T) - ∇_y(ρ*Cp*u) - T_source = 0

w*ρ*u = ρg - ∇_y(P)

     ∇·( 1/w * ∇P ) =  - ∇( ρg / w )

Where P, T and u are variables, the distribution represents pressure,
temperature and velocity. The rest are nonlinear physical parameters and
constants.

Because the program is very preliminary, so I use - snes_mf so that I can
save the part of writing to calculate the Jacobian matrix.

After compiling and passing, I found that the residual function had not
dropped to a small enough level, but the program stopped, as follows:

Setting Up: -snes_mf  -snes_monitor  -draw_pause  10  -snes_view

0 SNES Function norm 3.724996516631e+09

  1 SNES Function norm 2.194322909557e+09

  2 SNES Function norm 1.352051559826e+09

  3 SNES Function norm 1.522311916217e+08

SNES Object: 1 MPI processes

  type: newtonls

  maximum iterations=50, maximum function evaluations=10000

  tolerances: relative=1e-08, absolute=1e-50, solution=1e-08

  total number of linear solver iterations=1298

  total number of function evaluations=11679

  norm schedule ALWAYS

  SNESLineSearch Object: 1 MPI processes

    type: bt

      interpolation: cubic

      alpha=1.000000e-04

    maxstep=1.000000e+08, minlambda=1.000000e-12

    tolerances: relative=1.000000e-08, absolute=1.000000e-15,
lambda=1.000000e-08

    maximum iterations=40

  KSP Object: 1 MPI processes

    type: gmres

      restart=30, using Classical (unmodified) Gram-Schmidt
Orthogonalization with no iterative refinement

      happy breakdown tolerance 1e-30

    maximum iterations=10000, initial guess is zero

    tolerances:  relative=1e-05, absolute=1e-50, divergence=10000.

    left preconditioning

    using PRECONDITIONED norm type for convergence test

  PC Object: 1 MPI processes

    type: none

    linear system matrix = precond matrix:

    Mat Object: 1 MPI processes

      type: mffd

      rows=300, cols=300

        Matrix-free approximation:

          err=1.49012e-08 (relative error in function evaluation)

          Using wp compute h routine

              Does not compute normU

I would like to know why the residual function can not continue to decline,
and why the program will stop before convergence.
I do not know much about the convergence criteria and convergence rules of
PETSc for solving nonlinear equations. I hope I can get your help.
I'm looking forward to your reply~

Thanks,
Yingjie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180906/d31d80e4/attachment.html>


More information about the petsc-users mailing list