<!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">
 PCFactorSetShiftType() only works for certain preconditioners, ILU. If the matrix is not symmetric it also doesn't help. Are you sure the matrix is symmetric positive definite? On Aug 5, 2024, at 4: 43 AM, Константин Мурусидзе <konstantin. murusidze@ math. msu. ru>
</div>
<!-- Preheader Text : END -->

<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>

<!--[if ((ie)|(mso))]>
  <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 16px 0px 16px 0px; direction: ltr" ><tr><td>
    <table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 10px 5px 6px; width: 100%; border-radius:4px; border-top:4px solid #90a4ae;background-color:#D0D8DC;"><tr><td valign="top">
      <table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 4px 8px 4px 8px">
        <tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; direction: ltr">
          This Message Is From an External Sender
        </td></tr>
        <tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
          This message came from outside your organization.
        </td></tr>

      </table>

    </td></tr></table>
  </td></tr></table>
<![endif]-->

<![if !((ie)|(mso))]>
  <div dir="ltr"  id="pfptBannerct7rlai" style="all: revert !important; display:block !important; text-align: left !important; margin:16px 0px 16px 0px !important; padding:8px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #D0D8DC !important; background-color: #D0D8DC; border-top: 4px solid #90a4ae !important; border-top: 4px solid #90a4ae;">
    <div id="pfptBannerct7rlai" style="all: unset !important; float:left !important; display:block !important; margin: 0px 0px 1px 0px !important; max-width: 600px !important;">
      <div id="pfptBannerct7rlai" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:18px !important; line-height:18px">
        This Message Is From an External Sender
      </div>
      <div id="pfptBannerct7rlai" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:18px !important; line-height:18px; margin-top:2px !important;">
This message came from outside your organization.
      </div>

    </div>

    <div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
  </div>
<![endif]>

<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->

<!-- BaNnErBlUrFlE-BoDy-end -->
<html><head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
  #pfptBannerct7rlai { all: revert !important; display: block !important; 
    visibility: visible !important; opacity: 1 !important; 
    background-color: #D0D8DC !important; 
    max-width: none !important; max-height: none !important }
  .pfptPrimaryButtonct7rlai:hover, .pfptPrimaryButtonct7rlai:focus {
    background-color: #b4c1c7 !important; }
  .pfptPrimaryButtonct7rlai:active {
    background-color: #90a4ae !important; }
</style>

<!-- BaNnErBlUrFlE-HeAdEr-end -->
<meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">PCFactorSetShiftType() only works for certain preconditioners, ILU. <div><br></div><div>If the matrix is not symmetric it also doesn't help.</div><div><br></div><div>Are you sure the matrix is symmetric positive definite?</div><div><br></div><div><br><div><blockquote type="cite"><br><br></blockquote><div><blockquote type="cite"><div>On Aug 5, 2024, at 4:43 AM, Константин Мурусидзе <konstantin.murusidze@math.msu.ru> wrote:</div><br class="Apple-interchange-newline"><div><div>After this procedure I saw "Linear solution did not converge due to DIVERGED_INDEFINITE_MAT". Then as shown on <a href="https://urldefense.us/v3/__https://petsc.org/main/manualpages/KSP/KSP_DIVERGED_INDEFINITE_PC/__;!!G_uCfscf7eWS!dUAb2JB1g_tVNhPsjMe6qIzyNarGnl8HzZh2cOn_IkzWnHD5QJPY06dL8iwmKAJH2A_CYwssOq3IcWT2ButJOns$">https://petsc.org/main/manualpages/KSP/KSP_DIVERGED_INDEFINITE_PC/</a>​  I wrote such line PetscCall(PCFactorSetShiftType(pc, MAT_SHIFT_POSITIVE_DEFINITE)); but nothing changed and I still have divergence</div><div><br></div><div><br></div><div>22.07.2024, 17:22, "Barry Smith" <bsmith@petsc.dev>:</div><blockquote><div><br></div>   Run with -ksp_monitor_true_residual -ksp_converged_reason -ksp_view to see why it is stopping at 38 iterations.<div><br></div><div>   Barry</div><div><br id="1197d38eabd6a1f130a6b8653e70493blineBreakAtBeginningOfMessage"><div><br><blockquote><div>On Jul 22, 2024, at 7:37 AM, Константин Мурусидзе <<a href="mailto:konstantin.murusidze@math.msu.ru">konstantin.murusidze@math.msu.ru</a>> wrote:</div><br class="34bd394265c9c48ce7af3175baf9655dApple-interchange-newline"><div><div id="8853c347f276207aa3e14a8120b15c37pfptBannerrgpugnr" dir="ltr" style="background-color:rgb( 208 , 216 , 220 ) !important;border-radius:4px !important;border-top-color:rgb( 144 , 164 , 174 ) !important;border-top-style:solid !important;border-top-width:4px !important;display:block !important;font-family:'revert' !important;margin-bottom:16px !important;margin-left:0px !important;margin-right:0px !important;margin-top:16px !important;min-width:200px !important;padding-bottom:8px !important;padding-left:16px !important;padding-right:16px !important;padding-top:8px !important;text-align:left !important"><div id="8853c347f276207aa3e14a8120b15c37pfptBannerrgpugnr" style="display:block !important;float:left !important;font-family:'unset' !important;margin-bottom:1px !important;margin-left:0px !important;margin-right:0px !important;margin-top:0px !important;max-width:600px !important"><div id="8853c347f276207aa3e14a8120b15c37pfptBannerrgpugnr" style="background-color:rgb( 208 , 216 , 220 ) !important;display:block !important;font-family:'arial' , sans-serif !important;font-size:14px !important;font-weight:bold !important;line-height:18px !important;visibility:visible !important">This Message Is From an External Sender</div><div id="8853c347f276207aa3e14a8120b15c37pfptBannerrgpugnr" style="background-color:rgb( 208 , 216 , 220 ) !important;display:block !important;font-family:'arial' , sans-serif !important;font-size:12px !important;line-height:18px !important;margin-top:2px !important;visibility:visible !important">This message came from outside your organization.</div></div><div style="clear:both !important;display:block !important;font-size:0.01px !important;height:0px;line-height:0 !important;visibility:hidden !important"></div></div><div style="font-family:'helvetica';font-size:18px;font-style:normal;font-weight:400;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div>Good afternoon. I am a student at the Faculty of Mathematics and for my course work I need to solve SLAE with a relative accuracy of 1e-8 or more. To do this, I created the function PetscCall(KSPSetTolerances(ksp, 1.e-8, PETSC_DEFAULT, PETSC_DEFAULT, 100000));. But in the end, only 38 iterations were made and the relative norm ||Ax-b||/||b|| it turns out 4.54011. If you reply to my email, I can give you more information about the solver settings.</div></div></div></blockquote></div><br></div></blockquote></div></blockquote></div><br></div></div></body></html>