<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-07-24 11:26 GMT+03:00 Lisandro Dalcin <span dir="ltr"><<a href="mailto:dalcinl@gmail.com" target="_blank">dalcinl@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 23 July 2017 at 21:42, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
><br>
>    Then explicit methods could automatically use a solve to apply the mass matrix inverse for each "right hand side" application and implicit methods could automatically "drop in" the mass matrix with the shift when a right hand side Jacobian is given also. Instead of requiring the user to handle this themselves. Are there any gotcha's that I am missing or is this relatively straightforward?<br>
><br>
<br></span></blockquote><div><br></div><div>IMHO I think that it is not worth the complication. I value the generality of the current API, that already is somewhat cumbersome to maintain.</div><div>Users providing the RHS function + mass matrix already know that they should do M^-1 * rhsvec to compute the rhs function.</div><div>Same for the RHS jacobian.</div><div><br></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"><span class="gmail-"><br>
>    Why wouldn't we have this interface?<br>
><br>
<br></span></blockquote><div><br></div><div><div>What if the user provides MassMatrix + IFunction/IJacobian + RHSFunction/RHSJacobian? Are you going to handle all the possible scenarios? Error? dump a warning with PetscInfo? Users that will need such a new API usually don't read PetscInfo output</div></div><div><br></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"><span class="gmail-">
</span>As usual, the problem is on defining the interface and the trade on<br>
performance and generality. But I'm definitely +1 on this.<br>
<span class="gmail-"><br>
>     Almost for sure MFEM must have this type of API.<br>
><br>
<br></span></blockquote><div><br></div><div>No. AFAIK, sundials has it, not MFEM.</div><div>Natively in MFEM, they just suppors explicit or SDIRK. They also have interface to TS and Sundials.</div><div><br></div><div>See <a href="https://github.com/mfem/mfem/blob/master/examples/ex9.cpp#L329">https://github.com/mfem/mfem/blob/master/examples/ex9.cpp#L329</a> for native explicit ode solvers in MFEM.<br></div><div>See here for the virtual method that allows using SDIRK <a href="https://github.com/mfem/mfem/blob/master/examples/ex10.cpp#L91">https://github.com/mfem/mfem/blob/master/examples/ex10.cpp#L91</a></div><div>Here for sundials <a href="https://github.com/mfem/mfem/tree/master/examples/sundials">https://github.com/mfem/mfem/tree/master/examples/sundials</a><br></div><div><br></div><div>With that said, if you want to use TS through MFEM, here you have an example <a href="https://github.com/mfem/mfem/blob/master/examples/petsc/ex9p.cpp">https://github.com/mfem/mfem/blob/master/examples/petsc/ex9p.cpp</a>, which is meant to be illustrative of the capabilities of the IFunction/RHSFunction (and jacobians) API in PETSc, not efficiency.</div><div><br></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"><span class="gmail-">
</span>Stefano will love it for sure...<br>
<br>
<br>
--<br>
Lisandro Dalcin<br>
============<br>
Research Scientist<br>
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)<br>
Extreme Computing Research Center (ECRC)<br>
King Abdullah University of Science and Technology (KAUST)<br>
<a href="http://ecrc.kaust.edu.sa/" rel="noreferrer" target="_blank">http://ecrc.kaust.edu.sa/</a><br>
<br>
4700 King Abdullah University of Science and Technology<br>
al-Khawarizmi Bldg (Bldg 1), Office # 0109<br>
Thuwal 23955-6900, Kingdom of Saudi Arabia<br>
<a href="http://www.kaust.edu.sa" rel="noreferrer" target="_blank">http://www.kaust.edu.sa</a><br>
<br>
Office Phone: +966 12 808-0459<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Stefano</div>
</div></div>