<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> You might consider using the Event feature of TS to manage this. It detects when your "indicator function" changes sign and stops the integration right at that point allowing you to change your ODE or do what ever you need. It allows managing discontinuous changes in the ODE without needing smoothing (that messes up the solution). <div class=""><br class=""></div><div class=""> You would write an indicator function that depends on "<span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">solution of heat equation equal to a given parameter"</span></div><div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class=""><br class=""></span></font></div><div class="">I am including Shri and Emil on this message because they understand the event handling the best (Shri wrote it).</div><div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class=""> <br class=""></span></font><div> Barry</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 30, 2020, at 11:58 AM, Salazar De Troya, Miguel via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 11pt;" class="">Hello,<o:p class=""></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 11pt;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 11pt;" class="">I have a heat equation with a right-hand side coefficient that changes sign when a certain condition is met (solution of heat equation equal to a given parameter). I am thinking of modeling the sign change with a smoothed-out Heaviside approximation and let the solver adjust the time step to capture the sudden transition. Given that it is a heat equation, I am interested in using an implicit solver. Which ones in the TS suite also have adaptive capabilities?<o:p class=""></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 11pt;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 11pt;" class="">Thanks<o:p class=""></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 11pt;" class="">Miguel<o:p class=""></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 11pt;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;" class=""><span lang="ES" style="font-size: 9pt; font-family: Consolas;" class="">Miguel A. Salazar de Troya</span><span lang="ES" style="font-size: 10.5pt;" class=""><o:p class=""></o:p></span></div><div class=""><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9pt; font-family: Consolas;" class="">Postdoctoral Researcher, Lawrence Livermore National Laboratory</span><span style="font-size: 10.5pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9pt; font-family: Consolas;" class="">B141</span><span style="font-size: 10.5pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9pt; font-family: Consolas;" class="">Rm: 1085-5</span><span style="font-size: 10.5pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 9pt; font-family: Consolas;" class="">Ph: 1(925) 422-6411</span></div></div></div></div></blockquote></div><br class=""></div></body></html>