<div dir="ltr"><div class="gmail_default" style="color:#674ea7">Thanks Jed,</div><div class="gmail_default" style="color:#674ea7"><br></div><div class="gmail_default" style="color:#674ea7">In the code I have it took five (Picard) iterations for single time-step and here are the outputs from "ksp_monitor_true_residual -ksp_view" for one iteration:</div><div class="gmail_default" style="color:#674ea7"><br></div><div class="gmail_default" style="color:#674ea7">CG with bjacobi:<br><br> 0 KSP preconditioned resid norm 1.084140086188e+03 true resid norm 7.471524858215e-01 ||r(i)||/||b|| 1.114656457671e-37<br> 1 KSP preconditioned resid norm 6.296985199017e+02 true resid norm 6.804895514298e-01 ||r(i)||/||b|| 1.015203840277e-37<br> 2 KSP preconditioned resid norm 2.107325578297e+02 true resid norm 3.137762047326e-01 ||r(i)||/||b|| 4.681141795093e-38<br> 3 KSP preconditioned resid norm 4.225436610327e+01 true resid norm 1.732061654699e-01 ||r(i)||/||b|| 2.584015639554e-38<br> 4 KSP preconditioned resid norm 3.812640492590e+01 true resid norm 1.011864685639e-01 ||r(i)||/||b|| 1.509573383666e-38<br> 5 KSP preconditioned resid norm 1.883814249049e+01 true resid norm 5.398301531955e-02 ||r(i)||/||b|| 8.053579125059e-39<br> 6 KSP preconditioned resid norm 6.625289830879e+00 true resid norm 3.680797942761e-02 ||r(i)||/||b|| 5.491282267192e-39<br> 7 KSP preconditioned resid norm 7.791516954461e+00 true resid norm 2.236588077783e-02 ||r(i)||/||b|| 3.336704878000e-39<br> 8 KSP preconditioned resid norm 2.968740859730e+00 true resid norm 1.501379468210e-02 ||r(i)||/||b|| 2.239867164217e-39<br> 9 KSP preconditioned resid norm 3.027103876686e+00 true resid norm 1.041339881198e-02 ||r(i)||/||b|| 1.553546625669e-39<br> 10 KSP preconditioned resid norm 1.702923094998e+00 true resid norm 5.758722184966e-03 ||r(i)||/||b|| 8.591280887390e-40<br> 11 KSP preconditioned resid norm 6.959360907334e-01 true resid norm 3.209679120577e-03 ||r(i)||/||b|| 4.788432919244e-40<br> 12 KSP preconditioned resid norm 5.947063495977e-01 true resid norm 1.792219139479e-03 ||r(i)||/||b|| 2.673762953736e-40<br> 13 KSP preconditioned resid norm 1.638992222627e-01 true resid norm 9.582599930477e-04 ||r(i)||/||b|| 1.429602001797e-40<br> 14 KSP preconditioned resid norm 1.619641126005e-01 true resid norm 5.129340629231e-04 ||r(i)||/||b|| 7.652323674838e-41<br> 15 KSP preconditioned resid norm 6.298555854405e-02 true resid norm 2.630662976191e-04 ||r(i)||/||b|| 3.924614493042e-41<br> 16 KSP preconditioned resid norm 3.381480328186e-02 true resid norm 1.405167435648e-04 ||r(i)||/||b|| 2.096331051529e-41<br> 17 KSP preconditioned resid norm 2.188634069174e-02 true resid norm 7.170524515175e-05 ||r(i)||/||b|| 1.069751035753e-41<br> 18 KSP preconditioned resid norm 6.591386695704e-03 true resid norm 3.789193478287e-05 ||r(i)||/||b|| 5.652994616344e-42<br> 19 KSP preconditioned resid norm 5.988963507321e-03 true resid norm 1.922304552896e-05 ||r(i)||/||b|| 2.867833841361e-42<br> 20 KSP preconditioned resid norm 1.890309986311e-03 true resid norm 9.615814496304e-06 ||r(i)||/||b|| 1.434557192470e-42<br> 21 KSP preconditioned resid norm 1.322603958495e-03 true resid norm 4.933661540922e-06 ||r(i)||/||b|| 7.360395368965e-43<br> 22 KSP preconditioned resid norm 6.147516465031e-04 true resid norm 2.434568419681e-06 ||r(i)||/||b|| 3.632066361467e-43<br> 23 KSP preconditioned resid norm 2.443285908381e-04 true resid norm 1.258673156233e-06 ||r(i)||/||b|| 1.877780223336e-43<br> 24 KSP preconditioned resid norm 1.903790820937e-04 true resid norm 6.814992942512e-07 ||r(i)||/||b|| 1.016710248109e-43<br> 25 KSP preconditioned resid norm 5.897463754127e-05 true resid norm 3.612787156069e-07 ||r(i)||/||b|| 5.389818825638e-44<br>KSP Object: 1 MPI processes<br> type: cg<br> maximum iterations=10000, nonzero initial guess<br> tolerances: relative=1e-10, absolute=1e-10, divergence=1e+300<br> left preconditioning<br> using PRECONDITIONED norm type for convergence test<br>PC Object: 1 MPI processes<br> type: bjacobi<br> number of blocks = 1<br> Local solve is same for all blocks, in the following KSP and PC objects:<br> KSP Object: (sub_) 1 MPI processes<br> type: preonly<br> maximum iterations=10000, initial guess is zero<br> tolerances: relative=1e-05, absolute=1e-50, divergence=10000.<br> left preconditioning<br> using NONE norm type for convergence test<br> PC Object: (sub_) 1 MPI processes<br> type: ilu<br> out-of-place factorization<br> 0 levels of fill<br> tolerance for zero pivot 2.22045e-14<br> matrix ordering: natural<br> factor fill ratio given 1., needed 1.<br> Factored matrix follows:<br> Mat Object: 1 MPI processes<br> type: seqaij<br> rows=408848, cols=408848<br> package used to perform factorization: petsc<br> total: nonzeros=5918082, allocated nonzeros=5918082<br> total number of mallocs used during MatSetValues calls =0<br> not using I-node routines<br> linear system matrix = precond matrix:<br> Mat Object: 1 MPI processes<br> type: seqaij<br> rows=408848, cols=408848<br> total: nonzeros=5918082, allocated nonzeros=5918082<br> total number of mallocs used during MatSetValues calls =0<br> not using I-node routines<br> linear system matrix = precond matrix:<br> Mat Object: 1 MPI processes<br> type: seqaij<br> rows=408848, cols=408848<br> total: nonzeros=5918082, allocated nonzeros=5918082<br> total number of mallocs used during MatSetValues calls =0<br> not using I-node routines</div><div class="gmail_default" style="color:#674ea7"><br></div><div class="gmail_default" style="color:#674ea7"><br></div><div class="gmail_default" style="color:#674ea7"><br></div><div class="gmail_default" style="color:#674ea7">MINRES with bjacobi:<br><br> 0 KSP preconditioned resid norm 1.400513201683e+03 true resid norm 7.911033287257e+31 ||r(i)||/||b|| 1.181672927444e-05<br> 1 KSP preconditioned resid norm 2.320798481784e-13 true resid norm 5.094603145770e-03 ||r(i)||/||b|| 7.609820860095e-40<br>KSP Object: 1 MPI processes<br> type: minres<br> maximum iterations=10000, nonzero initial guess<br> tolerances: relative=1e-10, absolute=1e-10, divergence=1e+300<br> left preconditioning<br> using PRECONDITIONED norm type for convergence test<br>PC Object: 1 MPI processes<br> type: bjacobi<br> number of blocks = 1<br> Local solve is same for all blocks, in the following KSP and PC objects:<br> KSP Object: (sub_) 1 MPI processes<br> type: preonly<br> maximum iterations=10000, initial guess is zero<br> tolerances: relative=1e-05, absolute=1e-50, divergence=10000.<br> left preconditioning<br> using NONE norm type for convergence test<br> PC Object: (sub_) 1 MPI processes<br> type: ilu<br> out-of-place factorization<br> 0 levels of fill<br> tolerance for zero pivot 2.22045e-14<br> matrix ordering: natural<br> factor fill ratio given 1., needed 1.<br> Factored matrix follows:<br> Mat Object: 1 MPI processes<br> type: seqaij<br> rows=408848, cols=408848<br> package used to perform factorization: petsc<br> total: nonzeros=5918082, allocated nonzeros=5918082<br> total number of mallocs used during MatSetValues calls =0<br> not using I-node routines<br> linear system matrix = precond matrix:<br> Mat Object: 1 MPI processes<br> type: seqaij<br> rows=408848, cols=408848<br> total: nonzeros=5918082, allocated nonzeros=5918082<br> total number of mallocs used during MatSetValues calls =0<br> not using I-node routines<br> linear system matrix = precond matrix:<br> Mat Object: 1 MPI processes<br> type: seqaij<br> rows=408848, cols=408848<br> total: nonzeros=5918082, allocated nonzeros=5918082<br> total number of mallocs used during MatSetValues calls =0<br> not using I-node routines</div><div class="gmail_default" style="color:#674ea7"><br></div><div class="gmail_default" style="color:#674ea7"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 31, 2019 at 3:19 AM Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</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">Are you saying that the MINRES error is larger than CG error? In which<br>
norm? And which norm are you using for CG? (Output from<br>
-ksp_monitor_true_residual -ksp_view would be useful.)<br>
<br>
CG does find a solution that is optimal in a different inner product,<br>
though this is usually pretty benign unless you have a poor<br>
preconditioner.<br>
<br>
Mohammad Gohardoust via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> writes:<br>
<br>
> Hi,<br>
><br>
> I am trying to evaluate different solver/preconditioner combinations for<br>
> solving Richards' equation in porous media. The coefficient matrix is<br>
> symmetric positive definite and is usually solved by CG solver. I tried<br>
> MINRES with various preconditioners. The solution is acceptable but with<br>
> somehow considerable errors (compared to other solvers) which requires me<br>
> to decrease the tolerance threshold in my Picard iteration leading to<br>
> larger computation time. I would like to know if this is common for MINRES<br>
> and how to possibly overcome this?<br>
><br>
> Thanks,<br>
> Mohammad<br>
</blockquote></div>