<div dir="ltr"><div dir="ltr">On Tue, Oct 3, 2023 at 1:51 PM Gong Ding <<a href="mailto:gongding@cn.cogenda.com">gongding@cn.cogenda.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Hi all,</p>
<p>I'd like to do a special jacobian precondition during the snes
iteration, for which jacobian matrix and RHS vector must be
modified explicitly.</p>
<p>In the SNESComputeJacobian, the preconditioner P is built after
assembly of jacobian matrix.</p>
<p>I need to multiply P to J and RHS vector explicitly as left
precondition before the solve stage of J*dx = rhs. <br>
</p>
<pre id="m_-9121832340409894909codecell0"><span></span><span></span></pre></div></blockquote><div>What you are proposing is exactly what PETSc does with left preconditioning, multiplies both sides by the preconditioner. What do you want to change?</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><pre id="m_-9121832340409894909codecell0"><span>However, I find that petsc evaluates function before jacobian, so P*</span>RHS vector can not be processed at SNESComputeFunction.
As a result, I must find a hook function after SNESComputeJacobian and before the solve stage.
Any suggest?
Gong Ding
<span></span></pre>
</div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>