<div dir="ltr"><div>Dear Pierre,<br></div><div>Yes, you are right. I should have looked at the source-code directly.</div><div>Sorry for the stupid question. Nevertheless it is quite misleading that scipy only reports the number of outer iterations.</div><div>I wanted to use PETSc anyway.</div><div><br></div><div>thanks for the fast reply and best wishes</div><div>Florian <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 9, 2020 at 5:34 PM Pierre Seize <<a href="mailto:pierre.seize@onera.fr">pierre.seize@onera.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>I think that `callback` is called once for each outer cycle, and
the default inner number of iterations is 30, so 30 x 5 = 150
iterations, it seems more realistic.</p>
<p><br>
</p>
<p>Pierre Seize<br>
</p>
<br>
<div>On 09/12/20 17:25, Stefano Zampini
wrote:<br>
</div>
<blockquote type="cite">
<div dir="auto">Could it be that scipy lgmres is reporting the
wrong number of iterations?
<div dir="auto"><br>
</div>
<div dir="auto">I would try to replicate the scipy code first <a href="https://github.com/scipy/scipy/blob/master/scipy/sparse/linalg/isolve/lgmres.py" target="_blank">https://github.com/scipy/scipy/blob/master/scipy/sparse/linalg/isolve/lgmres.py</a></div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Il Mer 9 Dic 2020, 19:17
Florian Bruckner <<a href="mailto:e0425375@gmail.com" target="_blank">e0425375@gmail.com</a>> ha
scritto:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>Dear PETSc developers,</div>
<div>I am currently re-implementing our FEM-BEM code using
Firedrake.</div>
<div>The original code we were using is based on FEniCS and
uses scipy sparse solvers for the solution of the coupled
FEM / BEM system.</div>
<div><br>
</div>
<div>For some reason the scipy lgmres method seems to
outperform all other methods which we tried. E.g. for the
strayfield-calculation of a 10x10x10 unit cube
scipy-lgmres needs 5 iterations (without preconditioner),
whereas scipy-gmres needs 167. The new implementation uses
petsc-gmres and petsc-lgmres, but both need around 170
iterations.</div>
<div><br>
</div>
<div>If I understand lgmres correctly it only improves
convergence if gmres is restarted. Since it only needs 5
iterations i think this cannot be the reason. But
nevertheless since the method seems to perform very good,
it would be worth looking at the differences in detail. I
provide the dense data of the system-matrix and
right-hand-side vector that I used, as well as scripts for
the different considered methods.</div>
<div><br>
</div>
<div>Any ideas how scipy-lgmres could be that good? It would
be nice if someone could validate my results (lgmres
solves within 5 iterations). For me the next step will be
to wrap scipy-lgmres using petsc4py. I know how to do it
with petsc4py directly, but I am not exactly sure how it
works with the firedrake interface. </div>
<div><br>
</div>
<div>best wishes</div>
<div>Florian</div>
<div><br>
</div>
</div>
</blockquote>
</div>
</blockquote>
<br>
</div>
</blockquote></div>