<html><head><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;">  <div>  Do you wish to use a different norm </div><div><br></div><div>   1) ONLY for displaying (printing out) the residual norms to track progress</div><div><br></div><div>   2) in the convergence testing</div><div><br></div><div>   3) to change the numerical algorithm (for example using the L2 inner product instead of the usual linear algebra R^N l2 inner product).</div><div><br></div><div>   For 1) use SNESMonitorSet() and in your monitor function use SNESGetSolution() to grab the solution and then VecGetArray(). Now you can compute any weighted norm you want on the solution.</div><div><br></div><div>   For 2) similar but you need to use SNESSetConvergenceTest</div><div><br></div><div>   For 3) yes, but you need to ask us specifically.</div><div><br></div><div>  Barry</div><div><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Jun 11, 2025, at 4:45 AM, Ali ALI AHMAD <ali.ali_ahmad@utt.fr> wrote:</div><br class="Apple-interchange-newline"><div><div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"><div><div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;" data-mce-style="font-family: 'arial', 'helvetica', sans-serif; font-size: 12pt; color: #000000;"><div><div>Dear PETSc team,<br><br>I hope this message finds you well.<br><br>I am currently using PETSc in a C++, where I rely on the nonlinear solvers `SNES` with either `newtonls` or `newtontr` methods. I would like to ask if it is possible to change the default norm used (typically the L2 Euclidean norm) to a custom norm, specifically the L2 norm in the sense of Lebesgue (e.g., involving cell-wise weighted integrals over the domain).<br><br>My main goal is to define a custom residual norm that better reflects the physical quantities of interest in my simulation.<br><br>Would this be feasible within the PETSc framework? If so, could you point me to the recommended approach (e.g., redefining the norm manually, using specific PETSc hooks or options)?<br><br>Thank you very much in advance for your help and for the great work on PETSc!<br><br>Best regards,  <br><br><hr></div><div><span style="font-family: 'georgia', serif;" data-mce-style="font-family: 'georgia', serif;">Ali ALI AHMAD</span><br><span style="font-family: 'georgia', serif;" data-mce-style="font-family: 'georgia', serif;">PhD Student</span><br><span style="font-family: 'georgia', serif;" data-mce-style="font-family: 'georgia', serif;">University of Technology of Troyes - UTT - France</span><br><span style="font-family: 'georgia', serif;" data-mce-style="font-family: 'georgia', serif;">GAMMA3 Project - Office H008 - Phone No: +33 7 67 44 68 18</span><br><span style="font-family: 'georgia', serif;" data-mce-style="font-family: 'georgia', serif;">12 rue Marie Curie - CS 42060 10004 TROYES Cedex</span></div></div></div></div></div></div></div></div></blockquote></div><br></div></body></html>