<div data-ntes="ntes_mail_body_root" style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="margin:0;"><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">$</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">\</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(86, 156, 214);">quad</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">$</span><span style="background-color: rgb(30, 30, 30); color: rgb(218, 218, 218); font-family: Consolas, "Courier New", monospace; white-space: pre;"> Hello, I use </span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">`</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(206, 145, 120);">SNESComputeJacobianDefault</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">`</span><span style="background-color: rgb(30, 30, 30); color: rgb(218, 218, 218); font-family: Consolas, "Courier New", monospace; white-space: pre;"> to build a preconditioning matrix for JFNK and use </span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">`</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(206, 145, 120);">MatGetRowSumAbs</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">`</span><span style="background-color: rgb(30, 30, 30); color: rgb(218, 218, 218); font-family: Consolas, "Courier New", monospace; white-space: pre;"> to obtain the vector for scaling. When I modify the preconditioning matrix in formJacobian</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">[</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(206, 145, 120);">`SNESSetJacobian`</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">]</span><span style="background-color: rgb(30, 30, 30); color: rgb(218, 218, 218); font-family: Consolas, "Courier New", monospace; white-space: pre;"> and modify rhs and the solution variables in preSolve</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">[</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(206, 145, 120);">`KSPSetPreSolve`</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">]</span><span style="background-color: rgb(30, 30, 30); color: rgb(218, 218, 218); font-family: Consolas, "Courier New", monospace; white-space: pre;"> and postSolve</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">[</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(206, 145, 120);">`KSPSetPostSolve`</span><span style="background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; white-space: pre; color: rgb(180, 180, 180);">]</span><span style="background-color: rgb(30, 30, 30); color: rgb(218, 218, 218); font-family: Consolas, "Courier New", monospace; white-space: pre;"> as scaling, I encounter the following questions.</span><div style="color: #dadada;background-color: #1e1e1e;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span style="color: #6796e6;">1.</span><span style="color: #dadada;"> If I need to scale the solution variables, do I need to call </span><span style="color: #b4b4b4;">`</span><span style="color: #ce9178;">SNESGetSolutionUpdate</span><span style="color: #b4b4b4;">`</span><span style="color: #dadada;"> to scale the increment vector instead of the solution vector in </span><span style="color: #b4b4b4;">`</span><span style="color: #ce9178;">postSolve(KSP /*ksp*/, Vec rhs, Vec x, void * ctx)</span><span style="color: #b4b4b4;">`</span><span style="color: #dadada;">?</span></div><div><span style="color: #6796e6;"><br></span></div><div><span style="color: #6796e6;">2.</span><span style="color: #dadada;"> Whether this can achieve the same scaling effect as </span><span style="color: #b4b4b4;">`</span><span style="color: #ce9178;">-pc_jacobi_type rowl1</span><span style="color: #b4b4b4;">`</span><span style="color: #dadada;">, so that the built-in preconditioner scheme of petsc can be applied on the basis of the above modified linear system? Or whether this will affect the residual used to construct the matrix through the finite difference and then lead to the wrong scaling effect?</span></div></div><br></div></div>