<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p></p>
<div>Hi,<br>
I am running CG with a Jacobi preconditioner. I have a monitor function that prints the residual and saves the solution at every iteration. To get the solution at every iteration, I am using the function KSPBuildSolution. I am setting the KSP norm as UNPRECONDITIONED.<br>
<br>
The convergence test is consistent with the 2-norm of KSPBuildResidual. However this norm does not match the 2-norm of the residual computed explicitly from the solution (obtained with KSPBuildSolution). It also does not match the preconditioned norm. What
 norm is it computing?<br>
<br>
When the CG is not preconditioned, the norm of KSPBuildResidual and the norm of the residual computed from the solution match, as I expected.<br>
<br>
This is KSPView():<br>
<br>
    KSP Object: 1 MPI process<br>
      type: cg<br>
        variant HERMITIAN<br>
      maximum iterations=100, nonzero initial guess<br>
      tolerances: relative=1e-08, absolute=1e-08, divergence=10000.<br>
      left preconditioning<br>
      using UNPRECONDITIONED norm type for convergence test<br>
    PC Object: 1 MPI process<br>
      type: jacobi<br>
        type DIAGONAL<br>
      linear system matrix = precond matrix:<br>
      Mat Object: 1 MPI process<br>
        type: nest<br>
        rows=524, cols=524<br>
          Matrix object:<br>
        type=nest, rows=3, cols=3<br>
        MatNest structure:<br>
        (0,0) : type=mpiaij, rows=176, cols=176<br>
        (0,1) : NULL<br>
        (0,2) : NULL<br>
        (1,0) : NULL<br>
        (1,1) : type=mpiaij, rows=172, cols=172<br>
        (1,2) : NULL<br>
        (2,0) : NULL<br>
        (2,1) : NULL<br>
        (2,2) : type=mpiaij, rows=176, cols=176<br>
        <br>
Cheers,<br>
Elena Moral Sánchez</div>
<br>
<p></p>
</div>
</body>
</html>