<div dir="ltr"><div dir="ltr">On Wed, May 6, 2020 at 10:25 AM Yingjie Wu <<a href="mailto:yjwu16@gmail.com">yjwu16@gmail.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 dir="ltr">Hi,<div><br></div><div><p style="margin:0px;white-space:pre-wrap">I think my residual functions are piecewise but discontinuous functions.
</p><p style="margin:0px;white-space:pre-wrap">Although the residual function is discontinuous, there is little difference between the residuals in different segments at the piecewise point. This is the first time I have encountered such a problem, as I described before, I solve the two-phase problem of water, which involves the disappearance and generation of phases, so the conservation equation is piecewised. I looked at some of the papers about the piecewise residual function in Newton method, which refers to the peiecewise smooth function, I do not really understand the different treatment in Newton method between the two kinds of functions.</p><p style="margin:0px;white-space:pre-wrap"><br></p><p style="margin:0px;white-space:pre-wrap">Thank you very much for your reply, I know little about this field and hope to get some suggestions.</p></div></div></blockquote><div><br></div><div>I have no idea what to do for discontinuous functions. The value near the discontinuity is not even computable, since within error you cannot tell</div><div>which side of the jump you might be on.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><p style="margin:0px;white-space:pre-wrap">Thanks,</p><p style="margin:0px;white-space:pre-wrap">Yingjie</p></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> 于2020年5月6日周三 下午6:38写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Do you mean a piecewise smooth function, with a discontinuous derivative, or a piecewise function which is itself discontinuous?<div><br></div><div> Thanks,</div><div><br></div><div> Matt</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 5, 2020 at 11:05 PM Yingjie Wu <<a href="mailto:yjwu16@gmail.com" target="_blank">yjwu16@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear PETSc developers <div>Hi, </div><div><br></div><div><p style="margin:0px;white-space:pre-wrap"> I have been using SNES to solve a nonlinear problem recently, but this nonlinear problem is different from the ordinary problem, in which its residual function is a piecewise function. I have the following questions during calculation:</p><p style="margin:0px"></p><ol style="white-space:pre-wrap"><li>As I am not very familiar with the jacobian matrix construction of this piecewise function, I used the - snes_fd. However, the result is not converged in process of calculation. I don't know if it's the piecewise function problem or other errors.</li><li> For this piecewise function problem, it is actually determination of the residual function according to the current solution vector. Should I determine the piecewise function before each Newton step begins, or add judgment directly to the evaluation function to form the piecewise function? Now I'm adding judgment directly to the evaluation function to form a piecewise function.</li><li>Are there some special treatment for piecewise residual functions in the SNES?<br></li></ol><p></p><p style="margin:0px;white-space:pre-wrap">I'm dealing with a water two-phase flow problem, which is difficult to describe in detail because the model is relatively complex. For the first time I have encountered this problem and hope to get some advice or information.</p><p style="margin:0px;white-space:pre-wrap"><br></p><p style="margin:0px;white-space:pre-wrap">Thanks,</p><p style="margin:0px;white-space:pre-wrap">Yingjie</p></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><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>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <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>