<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>The physical problem itself is ill-conditioned since there are
floating regions in the simulation domain.<br>
</p>
<p>I use MUMPS as 64 bit LU solver, and a special improved SuperLU
as 128 bit LU solver (<a class="moz-txt-link-freetext" href="https://github.com/cogenda/superlu">https://github.com/cogenda/superlu</a>, added
float128 support).<br>
</p>
<p>Although 128 bit solver works, it is 10x slower. <br>
</p>
<p><br>
</p>
<p>I'd like to try, if jacobian can be processed under 64 bit
precision while keeps the Newton iteration convergence. <br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>Method 1:<br>
</p>
<p>Use a block inversion of the main diagonal of jacobian as
preconditioner (or ILU? ). Then factorize M*J.<br>
</p>
<p>Both the precondition matrix and jacobian matrix are 64 bit.<br>
</p>
<p><br>
</p>
<p>Method 2:<br>
</p>
<p>Do a 64 bit LU factorization of jacobian matrix, and use the
factorization result as a preconditioner for higher precision
krylov solver (such as iterative refinement)<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 2023/9/14 23:05, Zhang, Hong wrote:<br>
</div>
<blockquote type="cite"
cite="mid:SA1PR09MB8607F977CB20282B0D9A12C688F7A@SA1PR09MB8607.namprd09.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, "system-ui", Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display: inline
!important; color: rgb(36, 36, 36); background-color: rgb(255,
255, 255);" class="ContentPasted0">Gong Ding,</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, "system-ui", Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display: inline
!important; color: rgb(36, 36, 36); background-color: rgb(255,
255, 255);" class="ContentPasted0">When you use a LU solver,
the preconditioner M = inv(LU) = inv (J) on theory. I suspect
your jacobian evaluation by<span style="display: inline
!important; background-color: rgb(255, 255, 255);"
class="ContentPasted1"> 64bit might be inaccurate. What LU
solver did you use? Run your code with option '-snes_view
-snes_monitor -ksp_monitor' and compare the displays.</span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, "system-ui", Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display: inline
!important; color: rgb(36, 36, 36); background-color: rgb(255,
255, 255);" class="ContentPasted0"><span style="display:
inline !important; background-color: rgb(255, 255, 255);"
class="ContentPasted1">Hong</span></span></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
face="Calibri, sans-serif" color="#000000"><b>From:</b>
petsc-users <a class="moz-txt-link-rfc2396E" href="mailto:petsc-users-bounces@mcs.anl.gov"><petsc-users-bounces@mcs.anl.gov></a> on behalf
of Mark Adams <a class="moz-txt-link-rfc2396E" href="mailto:mfadams@lbl.gov"><mfadams@lbl.gov></a><br>
<b>Sent:</b> Thursday, September 14, 2023 5:35 AM<br>
<b>To:</b> Gong Ding <a class="moz-txt-link-rfc2396E" href="mailto:gongding@cn.cogenda.com"><gongding@cn.cogenda.com></a><br>
<b>Cc:</b> <a class="moz-txt-link-abbreviated" href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>
<a class="moz-txt-link-rfc2396E" href="mailto:petsc-users@mcs.anl.gov"><petsc-users@mcs.anl.gov></a><br>
<b>Subject:</b> Re: [petsc-users] Is precondition works for
ill-conditioned jacobian matrix</font>
<div> </div>
</div>
<div>
<div dir="ltr">I would first verify that you are happy with the
solution that works.
<div><br>
</div>
<div>Next, I would worry about losing accuracy in computing
M*J, but you could try it and search for any related work.
There may be some tricks.</div>
<div><br>
</div>
<div>And MUMPS is good at high accuracy, you might try that
and if it fails look at the MUMPS docs for any flags for
high-accuracy.</div>
<div><br>
</div>
<div>Good luck,</div>
<div>Mark</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Thu, Sep 14, 2023 at
5:35 AM Gong Ding <<a
href="mailto:gongding@cn.cogenda.com"
moz-do-not-send="true" class="moz-txt-link-freetext">gongding@cn.cogenda.com</a>>
wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px
0.8ex; border-left:1px solid rgb(204,204,204);
padding-left:1ex">
Hi all<br>
<br>
I find such a nonlinear problem, the jacobian matrix is ill
conditioned.<br>
<br>
Solve the jacobian matrix by 64bit LU solver, the Newton
method failed <br>
to convergence.<br>
<br>
However, when solve the jacobian matrix by 128bit LU solver
, Newton <br>
iteration will convergence.<br>
<br>
I think this phenomena indicate that , the jacobian matrix
is ill <br>
conditioned.<br>
<br>
<br>
The question is, if I do a precondition as M*J*dx = -M*f(x),
here M is <br>
the precondition matrix, . then I solve the matrix A=M*J by
a LU solver.<br>
<br>
Can I expect that solve A=M*J has a better precision result
that help <br>
the convergence of Newton iteration?<br>
<br>
Gong Ding<br>
<br>
<br>
<br>
<br>
</blockquote>
</div>
</div>
</blockquote>
</body>
</html>