<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class="">I ran it with your test code, and it seemed to resolve the issue and ran the test suite, and it did not break anything.</div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class="">A redesigned/implemented PETSc would need some thought on how to improve the SetFromOptions model to prevent this kind of difficulty.</div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class="">Barry</div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 13, 2022, at 8:40 AM, Pierre Jolivet <<a href="mailto:pierre@joliv.et" class="">pierre@joliv.et</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hello,<br class="">A user(*) wants to switch back and forth with the option -fieldsplit_1_ksp_reuse_preconditioner, but it’s generating results that I don’t understand.<br class="">In the following example I solve three successive linear systems.<br class="">If I run<br class="">$ ./ex1111 -pc_type fieldsplit -fieldsplit_pc_type lu -log_view -info -options_view -switch false<br class="">-fieldsplit_1_ksp_reuse_preconditioner is always false, and I properly get:<br class="">1) convergence in a single iteration every time <br class="">2) [0] PCSetUp(): Setting up PC with same nonzero pattern for the last solve<br class="">3) MatLUFactorNum 3 in -log_view<br class=""><br class="">Now, if I run<br class="">$ ./ex1111 -pc_type fieldsplit -fieldsplit_pc_type lu -log_view -info -options_view -switch true<br class="">-fieldsplit_1_ksp_reuse_preconditioner is set to true for the second solve and switched back to false for the last solve.<br class="">I (wrongfully, IMHO?) get:<br class="">1) convergence in 2 iterations for the last solve (instead of 1?)<br class="">2) [0] PCSetUp(): Leaving PC with identical preconditioner since reuse preconditioner is set (which should not be set for the last solve?)<br class="">3) MatLUFactorNum 1 (instead of 2?)<br class="">4) #PETSc Option Table entries:<br class="">-fieldsplit_1_ksp_reuse_preconditioner false (though from -info, cf. point #2 just above, this option value is true?)<br class=""><br class="">Does it make sense or do you agree that something is off?<br class=""><br class="">Thanks,<br class="">Pierre<br class=""><br class=""><span id="cid:26734774-5894-4752-8BB9-731BC6BEA23F"><ex1111.c></span><br class=""><br class="">(*) <a href="https://community.freefem.org/t/supply-petsc-numbering-for-shared-memory-block-matrix/486/18" class="">https://community.freefem.org/t/supply-petsc-numbering-for-shared-memory-block-matrix/486/18</a></div></div></blockquote></div><br class=""></div></body></html>