Hypre tolerances

So I ran hypre with varying tolerances for the radiation solve and found that the solution only converged when I set the tolerance to be 1e-10

Movie

So I looked more closely at what the 'tolerance' actually refers to in hypre. The hypre user guide is not much help…

Convergence can be controlled by the number of iterations, as well as various tolerances such as relative residual, preconditioned residual, etc. Like all parameters, reasonable defaults are used. Users are free to change these, though care must be taken. For example, if an iterative method is used as a preconditioner for a Krylov method, a constant number of iterations is usually required.

I'm assuming that hypre is trying to solve Ax=b and instead ends up solving Ax'=b' where r stands for the residual (r=b'-b) and x' is the approximate solution to x. I'm not sure what the _C means or what the <C*b,b> represents… presumably this is the inner product of some matrix 'C' times b with b.

Iters       ||r||_C     conv.rate  ||r||_C/||b||_C
-----    ------------    ---------  ------------ 
    1    1.667442e-07    265.427358    3.581554e-08
    2    2.421703e-07    1.452347    5.201657e-08
    3    2.037404e-07    0.841310    4.376208e-08
    4    1.176484e-07    0.577442    2.527008e-08
    5    7.646604e-08    0.649954    1.642440e-08
    6    4.446094e-08    0.581447    9.549914e-09
    7    2.173844e-08    0.488933    4.669272e-09
    8    1.033716e-08    0.475525    2.220354e-09
    9    5.190075e-09    0.502079    1.114794e-09
   10    2.514604e-09    0.484502    5.401202e-10
   11    1.291694e-09    0.513677    2.774473e-10
   12    6.662719e-10    0.515812    1.431108e-10
   13    4.688375e-10    0.703673    1.007032e-10
   14    2.451621e-10    0.522915    5.265918e-11
   15    1.654131e-10    0.674709    3.552962e-11
   16    8.812279e-11    0.532744    1.892819e-11
   17    5.478943e-11    0.621740    1.176841e-11
   18    7.612170e-11    1.389350    1.635043e-11
   19    1.416387e-10    1.860687    3.042304e-11
   20    2.346052e-10    1.656364    5.039163e-11
   21    4.389153e-10    1.870868    9.427609e-11
   22    1.170443e-09    2.666672    2.514034e-10
   23    3.069051e-09    2.622127    6.592117e-10
   24    3.268667e-09    1.065042    7.020879e-10
   25    3.349935e-09    1.024863    7.195436e-10
   26    1.136404e-09    0.339232    2.440919e-10
   27    2.175246e-10    0.191415    4.672284e-11
   28    7.067671e-11    0.324914    1.518089e-11
   29    2.139085e-11    0.302658    4.594611e-12
   30    7.493659e-12    0.350321    1.609588e-12
   31    3.051552e-12    0.407218    6.554531e-13


<C*b,b>: 2.167928e+01

So I looked for an explanation of convergence for linear system solves and found this document

The condition number of a matrix is related to how much a relative error in the rhs affects the relative error in the lhs. ie

which would imply that

In general we have

and indicates how close to singular a matrix is. (ie a singular matrix would have an infinite condition number)

Also because of machine precision, there is an unavoidable error related to the condition number

AstroBEAR solveres

Now we have two solvers available in the code… One is GMres and the other is PCG (preconditioned conjugate gradient). GMres does not converge unless the tolerance is set to ~ 1e-3 - but then it does nothing. PCG apparently expects symmetric positive definite matrices - but the matrices are certainly not symmetric. Not sure how much that matters… I'm also not sure whether PCG is actually doing any preconditioning automatically. I am not setting the preconditioner etc…

Also the actual solution vector 'x' is in terms of the Radiation Energy, and not radiation temperature - and since E ~ T4, there and there is a 3 order range of temperatures - there will be a 12 order range in Energies - and the relative error in the vector norm will be dominated by the larger values… A better metric would be the maximum local relative error…

Attachments (4)

Comments

No comments.