<div dir="ltr"><div>It looks like the RHS is zero in the 2nd case (0 KSP unpreconditioned resid norm 0.000000000000e+00), but the true residual is the same.</div><div><br></div><div>It looks like you added "nest_subvec" to our example.</div><div><br></div><div>You can start by looking at the vectors with -vec_view (there is code that you can view vectors explicitly in your code to get more control if this is too noisy)</div><div><br></div><div>You could send us the diffs in ex111. We may be able to see something wrong.</div><div><br></div><div>Mark</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 11, 2022 at 2:17 PM Pierre Jolivet <<a href="mailto:pierre@joliv.et">pierre@joliv.et</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">Hello,<br>
Could anyone help me understand what is going on in the following example, please?<br>
I have a VecNest.<br>
I either: a) initialize all values to 0.0, then set a specific part of the vector to nonzero or b) initialize a part of the vector to 0.0 and set the other part to nonzero.<br>
I don’t see why a) and b) produce different results.<br>
<br>
$ ./ex1111 -pc_type fieldsplit -ksp_monitor_true_residual -ksp_converged_reason -fieldsplit_pc_type jacobi -ksp_pc_side right -ksp_view_final_residual -nest_subvec true <br>
  0 KSP unpreconditioned resid norm 8.375635517980e-01 true resid norm 8.375635517980e-01 ||r(i)||/||b|| 1.000000000000e+00<br>
  1 KSP unpreconditioned resid norm 4.748816884247e-01 true resid norm 4.748816884247e-01 ||r(i)||/||b|| 5.669798875623e-01<br>
  2 KSP unpreconditioned resid norm 4.713006778679e-01 true resid norm 4.713006778679e-01 ||r(i)||/||b|| 5.627043784990e-01<br>
  3 KSP unpreconditioned resid norm 7.092979927129e-02 true resid norm 7.092979927129e-02 ||r(i)||/||b|| 8.468587144106e-02<br>
  4 KSP unpreconditioned resid norm 1.457836310255e-02 true resid norm 1.457836310255e-02 ||r(i)||/||b|| 1.740567992870e-02<br>
  5 KSP unpreconditioned resid norm 1.625040500524e-14 true resid norm 1.633468028779e-14 ||r(i)||/||b|| 1.950261595401e-14<br>
Linear solve converged due to CONVERGED_RTOL iterations 5<br>
KSP final norm of residual 1.63347e-14<br>
$ ./ex1111 -pc_type fieldsplit -ksp_monitor_true_residual -ksp_converged_reason -fieldsplit_pc_type jacobi -ksp_pc_side right -ksp_view_final_residual -nest_subvec false<br>
  0 KSP unpreconditioned resid norm 0.000000000000e+00 true resid norm 8.375635517980e-01 ||r(i)||/||b||            inf<br>
Linear solve converged due to CONVERGED_ATOL iterations 0<br>
KSP final norm of residual 0.837564<br>
<br>
Thanks,<br>
Pierre<br>
<br>
</blockquote></div></div>