<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=Windows-1252">
<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:Monaco;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
p.m477101460960849173p1, li.m477101460960849173p1, div.m477101460960849173p1
{mso-style-name:m_477101460960849173p1;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.m477101460960849173p2, li.m477101460960849173p2, div.m477101460960849173p2
{mso-style-name:m_477101460960849173p2;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.p1, li.p1, div.p1
{mso-style-name:p1;
margin:0cm;
font-size:9.0pt;
font-family:Monaco;
color:black;}
span.m477101460960849173apple-converted-space
{mso-style-name:m_477101460960849173apple-converted-space;}
span.gmailsignatureprefix
{mso-style-name:gmail_signature_prefix;}
span.EmailStyle23
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-GB" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">I just noticed that the line search diverges even for the linear Poisson equation (where the Jacobian is a constant). I am not sure, what I am doing wrong.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">Karthik.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Chockalingam, Karthikeyan (STFC,DL,HC) <karthikeyan.chockalingam@stfc.ac.uk><br>
<b>Date: </b>Thursday, 7 September 2023 at 12:19<br>
<b>To: </b>Stefano Zampini <stefano.zampini@gmail.com><br>
<b>Cc: </b>petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Subject: </b>Re: [petsc-users] Non-linear solve: DIVERGED_LINE_SEARCH<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">I am trying to solve the non-linear scalar problem</span><o:p></o:p></p>
<p class="p1">-\nabla \cdot \big( (1+u^2)\nabla u\big)=f<o:p></o:p></p>
<p class="p1">Using finite element formulation.<o:p></o:p></p>
<p class="p1"> <o:p></o:p></p>
<p class="p1">The linear iteration converged – does that mean my Jacobian is correct??<o:p></o:p></p>
<p class="p1"> <o:p></o:p></p>
<p class="p1">I am hoping the non-linear residual goes down to 1-e11.<o:p></o:p></p>
<p class="p1"> <o:p></o:p></p>
<p class="p1">Kind regards,<o:p></o:p></p>
<p class="p1">Karthik.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Stefano Zampini <stefano.zampini@gmail.com><br>
<b>Date: </b>Thursday, 7 September 2023 at 11:49<br>
<b>To: </b>Chockalingam, Karthikeyan (STFC,DL,HC) <karthikeyan.chockalingam@stfc.ac.uk><br>
<b>Cc: </b>petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Subject: </b>Re: [petsc-users] Non-linear solve: DIVERGED_LINE_SEARCH</span><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">The solver did not diverge.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">It was the line search that was not able to make further progress in minimizing the 2-norm of the residual.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">This is common in nonlinear solvers. It would help if you tell us what you are trying to solve.</span><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Note that at the first step, your residual norm is already 1.e-6. What kind of accuracy do you want?</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Il giorno gio 7 set 2023 alle ore 13:08 Karthikeyan Chockalingam - STFC UKRI via petsc-users <</span><a href="mailto:petsc-users@mcs.anl.gov"><span style="font-size:11.0pt">petsc-users@mcs.anl.gov</span></a><span style="font-size:11.0pt">>
ha scritto:</span><o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Hello,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">The non-linear solution diverged. The final solution seems right and I believe the Jacobian is correct (not 100% certain).
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">I am not sure if I doing something wrong in the solver setting.
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black"> </span></span><span style="color:black">0 SNES Function norm 3.890991210938e-03<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">0 KSP Residual norm 9.037762538598e+00<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">1 KSP Residual norm 2.120375403775e-01<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">2 KSP Residual norm 5.155439334511e-03<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">3 KSP Residual norm 1.394364169369e-04<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">4 KSP Residual norm 9.233543407204e-06<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Linear solve converged due to CONVERGED_RTOL iterations 4</span><o:p></o:p></p>
<p class="m477101460960849173p2"><span style="color:black"> </span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Using full step: fnorm 3.890991210938e-03 gnorm 7.701511565083e-06</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">1 SNES Function norm 7.701511565083e-06<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">0 KSP Residual norm 5.630229687829e-03<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">1 KSP Residual norm 1.030475601271e-04<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">2 KSP Residual norm 2.576454714319e-06<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">3 KSP Residual norm 6.669316846898e-08<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">4 KSP Residual norm 3.215810984829e-09<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Linear solve converged due to CONVERGED_RTOL iterations 4</span><o:p></o:p></p>
<p class="m477101460960849173p2"><span style="color:black"> </span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: gnorm after quadratic fit 1.805500533481e-05</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Cubic step no good, shrinking lambda, current gnorm 2.563759884284e-05 lambda=3.0804668685096816e-02</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Cubic step no good, shrinking lambda, current gnorm 3.332721829751e-05 lambda=3.0804668685096817e-03</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Cubic step no good, shrinking lambda, current gnorm 4.102754045833e-05 lambda=3.0804668685096822e-04</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Cubic step no good, shrinking lambda, current gnorm 4.872893294880e-05 lambda=3.0804668685096822e-05</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Cubic step no good, shrinking lambda, current gnorm 5.643043250787e-05 lambda=3.0804668685096822e-06</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Cubic step no good, shrinking lambda, current gnorm 6.413194279696e-05 lambda=3.0804668685096827e-07</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Cubic step no good, shrinking lambda, current gnorm 7.183345417492e-05 lambda=3.0804668685096828e-08</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Cubic step no good, shrinking lambda, current gnorm 7.953496567312e-05 lambda=3.0804668685096829e-09</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Cubic step no good, shrinking lambda, current gnorm 8.723647719173e-05 lambda=3.0804668685096831e-10</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Cubic step no good, shrinking lambda, current gnorm 9.493798871875e-05 lambda=3.0804668685096832e-11</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Cubic step no good, shrinking lambda, current gnorm 1.026395002516e-04 lambda=3.0804668685096835e-12</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: Cubic step no good, shrinking lambda, current gnorm 1.103410117889e-04 lambda=3.0804668685096835e-13</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: unable to find good step length! After 12 tries<span class="m477101460960849173apple-converted-space"> </span></span><o:p></o:p></p>
<p class="m477101460960849173p1"><span class="m477101460960849173apple-converted-space"><span style="color:black">
</span></span><span style="color:black">Line search: fnorm=7.7015115650831560e-06, gnorm=1.1034101178892401e-04, ynorm=6.2052357872955976e-03, minlambda=9.9999999999999998e-13, lambda=3.0804668685096835e-13, initial slope=-5.9313318983096354e-11</span><o:p></o:p></p>
<p class="m477101460960849173p1"><span style="color:black">Nonlinear solve did not converge due to DIVERGED_LINE_SEARCH iterations 1</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Thank you for your help.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Kind regards,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Karthik.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">-- </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#2D2D62">Dr. Karthik Chockalingam</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">Senior Research Software Engineer</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">High Performance Systems Engineering Group</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black">Hartree Centre | Science and Technology Facilities Council</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="mailto:karthikeyan.chockalingam@stfc.ac.uk" target="_blank"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#0563C1">karthikeyan.chockalingam@stfc.ac.uk</span></a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"> </span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#414141"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#414141"> </span></b><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:#1F497D"><img border="0" width="254" height="116" style="width:2.6458in;height:1.2083in" id="_x0000_i1025" src="cid:image001.png@01D9E17A.4E8AA8B0" alt="signature_3970890138"></span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"><br clear="all">
<br>
<span class="gmailsignatureprefix">-- </span></span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Stefano</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>