<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" 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 class="moz-cite-prefix">On 09/12/20 17:25, Stefano Zampini
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAGPUisig1ASSo_bp34Rv4yjgDn-T2_5XLBgjfUMXF40D2hJi8A@mail.gmail.com">
      <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"
            moz-do-not-send="true">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"
            moz-do-not-send="true">e0425375@gmail.com</a>> ha
          scritto:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;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>
  </body>
</html>