<div dir="ltr"><div>Hello,<br><br>I am using KSP framework to solve the problem   A \Delta x = b in the matrix free fashion. where A is the matrix free matrix. I have another assembled matrix for preconditioning, but I'm NOT using it.  My code is not working so I'm debugging it.<br>
I run the code with options -ksp_pc_side left -ksp_max_it 10 -ksp_gmres_restart 30 -ksp_monitor_true_residual -pc_type none -ksp_view<br><br>I think if pc_type is none, the precondiitoned resid norm should equal to true resid norm (Am I correct?). But this doesn't happen. So maybe it would be helpful if I know how preconditioned resid norm and true resid norm are computed.<br>
<br>Website says true resid norm is just b - A \Delta x.   But how is preconditioned resid norm computed? Any suggestions? Thank you very much.<br></div><div><br><br>  0 KSP preconditioned resid norm 9.619278462343e-03 true resid norm 9.619278462343e-03 ||r(i)||/||b|| 1.000000000000e+00<br>
  1 KSP preconditioned resid norm 9.619210849854e-03 true resid norm 2.552369536916e+06 ||r(i)||/||b|| 2.653389801437e+08<br>  2 KSP preconditioned resid norm 9.619210847390e-03 true resid norm 2.552458142544e+06 ||r(i)||/||b|| 2.653481913988e+08<br>
  3 KSP preconditioned resid norm 9.619210847385e-03 true resid norm 2.552458343191e+06 ||r(i)||/||b|| 2.653482122576e+08<br>  4 KSP preconditioned resid norm 9.619210847385e-03 true resid norm 2.552458344014e+06 ||r(i)||/||b|| 2.653482123432e+08<br>
  5 KSP preconditioned resid norm 9.619210847385e-03 true resid norm 2.552458344015e+06 ||r(i)||/||b|| 2.653482123433e+08<br>.......<br>Linear solve did not converge due to DIVERGED_ITS iterations 10<br>KSP Object: 1 MPI processes<br>
  type: gmres<br>    GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement<br>    GMRES: happy breakdown tolerance 1e-30<br>  maximum iterations=10, initial guess is zero<br>
  tolerances:  relative=1e-06, absolute=1e-50, divergence=100000<br>  left preconditioning<br>  using PRECONDITIONED norm type for convergence test<br>PC Object: 1 MPI processes<br>  type: none<br>  linear system matrix followed by preconditioner matrix:<br>
  Matrix Object:   1 MPI processes<br>    type: mffd<br>    rows=22905, cols=22905<br>      Matrix-free approximation:<br>        err=1.49012e-08 (relative error in function evaluation)<br>        Using wp compute h routine<br>
            Does not compute normU<br>  Matrix Object:   1 MPI processes<br>    type: seqbaij<br>    rows=22905, cols=22905, bs=5<br>    total: nonzeros=785525, allocated nonzeros=785525<br>    total number of mallocs used during MatSetValues calls =0<br>
        block size is 5<br></div></div>