<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">I’ve attached typical examples of “A” and “b”. Do these qualify as large values?<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">The two runs are with and without “-ksp_pc_side right”.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Barry Smith <bsmith@petsc.dev> <br>
<b>Sent:</b> Tuesday, December 7, 2021 3:44 PM<br>
<b>To:</b> Fischer, Greg A. <fischega@westinghouse.com><br>
<b>Cc:</b> Fischer, Greg A. via petsc-users <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] KSPBuildResidual and KSPType compatibility<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:red">[External Email]</span> <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">When the preconditioned and non-preconditioner residual norms as so hugely different this usually indicates something is badly scaled or something "bad" is happening within the preconditioner. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">0 KSP preconditioned resid norm 2.434689662304e-01 true resid norm 1.413757649058e+09 ||r(i)||/||b|| 1.442188243865e-04
<o:p></o:p></p>
<div>
<p class="MsoNormal">....<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">19 KSP preconditioned resid norm 4.505576228085e-15 true resid norm 1.810377537457e-02 ||r(i)||/||b|| 1.846784138157e-15<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">notice that at the end the true residual is not particularly small. Is your b really big and does the matrix have really large values in it?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">What are the two runs? Left and right preconditioning with ibcgs or something else?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Dec 7, 2021, at 12:44 PM, Fischer, Greg A. <<a href="mailto:fischega@westinghouse.com">fischega@westinghouse.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Attached are outputs with these options.<span class="apple-converted-space"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">What should I make of these?<span class="apple-converted-space"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<div>
<p class="MsoNormal"><b>From:</b><span class="apple-converted-space"> </span>Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>><span class="apple-converted-space"> </span><br>
<b>Sent:</b><span class="apple-converted-space"> </span>Monday, December 6, 2021 2:16 PM<br>
<b>To:</b><span class="apple-converted-space"> </span>Fischer, Greg A. via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br>
<b>Cc:</b><span class="apple-converted-space"> </span>Fischer, Greg A. <<a href="mailto:fischega@westinghouse.com">fischega@westinghouse.com</a>><br>
<b>Subject:</b><span class="apple-converted-space"> </span>Re: [petsc-users] KSPBuildResidual and KSPType compatibility<o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="color:red">[External Email]</span><o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">What do you get for <span style="font-size:10.5pt;font-family:"Menlo",serif">-ksp_type ibcgs -ksp_monitor -ksp_monitor_true_residual</span><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Menlo",serif">with and without  -ksp_pc_side right ?</span><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal">On Dec 6, 2021, at 12:00 PM, Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">"Fischer, Greg A. via petsc-users" <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> writes:<br>
<br>
<br>
<br>
<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Hello petsc-users,<br>
<br>
I would like to check convergence against the infinity norm, so I defined my own convergence test routine with KSPSetConvergenceTest. (I understand that it may be computationally expensive.)<br>
<br>
I would like to do this with the "ibcgs" method. When I use KSPBuildResidual and calculate the NORM_2 against the output vector, I get a value that differs from the 2-norm that gets passed into the convergence test function. However, when I switch to the "gcr"
 method, the value I calculate matches the function input value.<o:p></o:p></p>
</div>
</blockquote>
<div>
<p class="MsoNormal"><br>
IBCGS uses the preconditioned norm by default while GCR uses the unpreconditioned norm. You can use -ksp_norm_type unpreconditioned or KSPSetNormType() to make IBCGS use unpreconditioned.<br>
<br>
<br>
<br>
<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Is the KSPBuildResidual function only compatible with a subset of the KSPType methods? If I want to evaluate convergence against the infinity norm, do I need to set KSPSetInitialGuessNonzero and continually re-start the solver with a lower
 tolerance values until I get a satisfactory value of the infinity norm?<br>
<br>
Thanks,<br>
Greg<br>
<br>
<br>
________________________________<br>
<br>
This e-mail may contain proprietary information of the sending organization. Any unauthorized or improper disclosure, copying, distribution, or use of the contents of this e-mail and attached document(s) is prohibited. The information contained in this e-mail
 and attached document(s) is intended only for the personal and private use of the recipient(s) named above. If you have received this communication in error, please notify the sender immediately by email and delete the original e-mail and attached document(s).<o:p></o:p></p>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="100%" align="center">
</div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial",sans-serif;color:gray"><br>
This e-mail may contain proprietary information of the sending organization. Any unauthorized or improper disclosure, copying, distribution, or use of the contents of this e-mail and attached document(s) is prohibited. The information contained in this e-mail
 and attached document(s) is intended only for the personal and private use of the recipient(s) named above. If you have received this communication in error, please notify the sender immediately by email and delete the original e-mail and attached document(s).<br>
</span><ksp-monitor_output.txt><ksp-monitor_output-pc_side_right.txt><o:p></o:p></p>
</div>
</blockquote>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1"><br>
This e-mail may contain proprietary information of the sending organization. Any unauthorized or improper disclosure, copying, distribution, or use of the contents of this e-mail and attached document(s) is prohibited. The information contained in this e-mail
 and attached document(s) is intended only for the personal and private use of the recipient(s) named above. If you have received this communication in error, please notify the sender immediately by email and delete the original e-mail and attached document(s).<br>
</font>
</body>
</html>