[petsc-users] Condition Number and GMRES iteration

Mark Adams mfadams at lbl.gov
Fri Feb 7 12:31:43 CST 2020


On Thu, Feb 6, 2020 at 8:07 PM Alexander Lindsay <alexlindsay239 at gmail.com>
wrote:

> It looks like Fande has attached the eigenvalue plots with the real axis
> having a logarithmic scale. The same plots with a linear scale are attached
> here.
>
> The system has 306 degrees of freedom. 12 eigenvalues are unity for both
> scaled and unscaled cases; this number corresponds to the number of mesh
> nodes with Dirichlet boundary conditions (just a 1 on the diagonal for the
> corresponding rows). The rest of the eigenvalues are orders of magnitude
> smaller for the unscaled case; using scaling these eigenvalues are brought
> much closer 1.
>

So you are running un-preconditioned GMRES, I assume. So your condition
number is like 10^23 because if these 1s on the diagonal. I suggest always
scaling by the diagonal for that reason, but if you want to run
un-preconditioned then you have to be careful about what amount to penalty
terms. In this case just take them out of the system entirely. They are
just mudding up your numerical studies. (Now Krylov is just nailing these
in the first iteration, espicaily GMRES which focuses on the largest
eigenvalue vectors).

BTW, one of my earliest talks, in grad school before I had any real
results, was called "condition number does not matter" and I showed
examples problems where solvers, multigrid to be specific in some cases,
work great on poorly conditioned problems (eg, scale and your problem) and
fail on well conditioned problems (eg, incompressibility)


>
> This particular problem is linear but we solve it with SNES, so constant
> Jacobian. We run with options '-pc_type none -ksp_gmres_restart 1000
> -snes_rtol 1e-8 -ksp_rtol 1e-5` so for this linear problem it takes two
> non-linear iterations to solve.
>
> Unscaled:
>
> first nonlinear iteration takes 2 linear iterations
> second nonlinear iteration takes 99 linear iterations
>
> Scaled:
>
> first nonlinear iteration takes 94 linear iterations
> second nonlinear iteration takes 100 linear iterations
>
> Running with `-pc_type svd` the condition number for the unscaled
> simulation is 4e9 while it is 2e3 for the scaled simulation.
>
>
>
> On Thu, Feb 6, 2020 at 4:36 PM Fande Kong <fdkong.jd at gmail.com> wrote:
>
>> Hi All,
>>
>> MOOSE team, Alex and I are working on some variable scaling techniques to
>> improve the condition number of the matrix of linear systems. The goal of
>> variable scaling is to make the diagonal of matrix as close to unity as
>> possible. After scaling (for certain example), the condition number of the
>> linear system is actually reduced, but the GMRES iteration does not
>> decrease at all.
>>
>> From my understanding, the condition number is the worst estimation for
>> GMRES convergence. That is, the GMRES iteration should not increases when
>> the condition number decreases. This actually could example what we saw:
>> the improved condition number does not necessary lead to a decrease in
>> GMRES iteration. We try to understand this a bit more, and we guess that
>> the number of eigenvalue clusters of the matrix of the linear system
>> may/might be related to the convergence rate of GMRES.  We plot eigenvalues
>> of scaled system and unscaled system, and the clusters look different from
>> each other, but the GMRRES iterations are the same.
>>
>> Anyone know what is the right relationship between the condition number
>> and GMRES iteration? How does the number of eigenvalue clusters affect
>> GMRES iteration?  How to count eigenvalue clusters? For example, how many
>> eigenvalue clusters we have in the attach image respectively?
>>
>> If you need more details, please let us know. Alex and I are happy to
>> provide any details you are interested in.
>>
>>
>> Thanks,
>>
>> Fande Kong,
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200207/a968a55a/attachment.html>


More information about the petsc-users mailing list