<div dir="ltr">You could add a <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSMonitorSet.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSMonitorSet.html</a> method, compute the time derived and decide how to declare converged.<div><br></div><div>Then set converged (<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetConvergedReason.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetConvergedReason.html</a>) with TS_CONVERGED_USER</div><div><br></div><div>That should cause TS to wrap up the solve and exit cleanly.</div><div><br></div><div>Mark</div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 29, 2021 at 3:27 PM Salazar De Troya, Miguel via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</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 lang="EN-US" style="overflow-wrap: break-word;">
<div class="gmail-m_-4452959108532021702WordSection1">
<p class="MsoNormal"><span style="font-size:11pt">I am solving the signed distance equation<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">\frac{\partial \phi}{\partial t} + sign (\phi_{0})(|\nabla \phi| - 1) = 0<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">using a Local Discontinuous Galerkin (LDG) method as described in
<a href="https://www.sciencedirect.com/science/article/pii/S0021999110005255" target="_blank">https://www.sciencedirect.com/science/article/pii/S0021999110005255</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">I am interested in solving it close to steady state. I was hoping I could measure how close to steady state the solution is by using the TSSetEventHandler infrastructure, but the handler does not have information
 on the time derivative. I looked at TSPSEUDO, but it forces me to use an implicit method, which I cannot provide because how the LDG method works (it calculates the fluxes solving additional equations). This makes me wonder if the LDG method is the best choice,
 so I am open to suggestions.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">Given my current progress with the LDG approach, I am wondering if there is a way to solve to steady state using explicit algorithms such as Runge-Kutta.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">Thanks<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">Miguel<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="ES" style="font-size:9pt;font-family:Consolas;color:black">Miguel A. Salazar de Troya</span><span lang="ES" style="font-size:10.5pt;color:black"><u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Consolas;color:black">Postdoctoral Researcher, Lawrence Livermore National Laboratory</span><span style="font-size:10.5pt;color:black"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Consolas;color:black">B141</span><span style="font-size:10.5pt;color:black"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Consolas;color:black">Rm: 1085-5</span><span style="font-size:10.5pt;color:black"><u></u><u></u></span></p>
</div>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Consolas;color:black">Ph: 1(925) 422-6411</span><u></u><u></u></p>
</div>
</div>

</blockquote></div>