<div dir="ltr"><div dir="ltr"><div>On Tue, Mar 23, 2021 at 11:54 AM Salazar De Troya, Miguel <<a href="mailto:salazardetro1@llnl.gov">salazardetro1@llnl.gov</a>> wrote:<br></div></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 lang="EN-US" style="overflow-wrap: break-word;">
<div class="gmail-m_-174082229236822632WordSection1">
<p class="MsoNormal">The calculation of p1 and p2 are done by solving an element-wise local problem using u^n. I guess I could embed this calculation inside of the calculation for G = H(p1, p2). However, I am hoping to be able to solve the problem using firedrake-ts
 so the formulation is all clearly in one place and in variational form. Reading the manual, Section 2.5.2 DAE formulations, the Hessenberg Index-1 DAE case seems to be what I need, although it is not clear to me how one can achieve this with an IMEX scheme.
 If I have:<u></u><u></u></p>
</div></div></blockquote><div><br></div><div>I am almost certain that you do not want to do this. I am guessing the Firedrake guys will agree. Did they tell you to do this?</div><div>If you had a large, nonlinear system for p1/p2, then a DAE would make sense. Since it is just element-wise elimination, you should</div><div>roll it into the easy equation</div><div><br></div><div>  u' = H</div><div><br></div><div>Then you can use any integrator, as Barry says, in particular a nice symplectic integrator. My understand is that SLATE is for exactly</div><div>this kind of thing.</div><div><br></div><div>  Thanks,</div><div><br></div><div>      Matt</div><div> <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_-174082229236822632WordSection1">
<p class="MsoNormal">                F(U', U, t) = G(t,U) <u></u><u></u></p>
<p class="MsoNormal">                p1 = f(u_x)<u></u><u></u></p>
<p class="MsoNormal">                p2 = g(u_x)<u></u><u></u></p>
<p class="MsoNormal">                <span lang="ES">u' - H(p1, p2) =  0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="ES"><u></u> <u></u></span></p>
<p class="MsoNormal">where U = (p1, p2, u), F(U’, U, t) = [p1, p2, u’ - H(p1, p2)],] and G(t, U) = [f(u_x), g(u_x), 0], is there a solver strategy that will solve for p1 and p2 first and then use that to solve the last equation? The jacobian for F in this formulation
 would be<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">dF/dU = [[M, 0, 0], <u></u><u></u></p>
<p class="MsoNormal">                [0, M, 0], <u></u><u></u></p>
<p class="MsoNormal">                [H'(p1), H'(p2), \sigma*M]]<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">where M is a mass matrix, H'(p1) is the jacobian of H(p1, p2) w.r.t. p1 and H'(p2), the jacobian of H(p1, p2) w.r.t. p2. H'(p1) and H'(p2) are unnecessary for the solver strategy I want to implement.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks<u></u><u></u></p>
<p class="MsoNormal">Miguel<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal" style="margin-left:0.5in"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>><br>
<b>Date: </b>Monday, March 22, 2021 at 7:42 PM<br>
<b>To: </b>Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
<b>Cc: </b>"Salazar De Troya, Miguel" <<a href="mailto:salazardetro1@llnl.gov" target="_blank">salazardetro1@llnl.gov</a>>, "Jorti, Zakariae via petsc-users" <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
<b>Subject: </b>Re: [petsc-users] Local Discontinuous Galerkin with PETSc TS<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">   u_t  = G(u)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<p class="MsoNormal" style="margin-left:0.5in">  I don't see why you won't just compute any needed u_x from the given u and then you can use any explicit or implicit TS solver trivially. For implicit methods it can automatically compute the Jacobian of G for
 you or you can provide it directly. Explicit methods will just use the "old" u while implicit methods will use the new.<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">  Barry<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><br>
<br>
<u></u><u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p class="MsoNormal" style="margin-left:0.5in">On Mar 22, 2021, at 7:20 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">On Mon, Mar 22, 2021 at 7:53 PM Salazar De Troya, Miguel via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<u></u><u></u></p>
</div>
<div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">
<span lang="ES">Hello</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">
<span lang="ES"> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">
I am interested in implementing the LDG method in “A local discontinuous Galerkin method for directly solving Hamilton–Jacobi equations”
<a href="https://urldefense.us/v3/__https:/www.sciencedirect.com/science/article/pii/S0021999110005255__;!!G2kpM7uM-TzIFchu!nue-xIlrKIjtG6dGeWKiWVhSxLIOor_uLXP0UEel7pqB4YUy0y-YTHDqVX9IQCHtstz33g$" target="_blank">
https://www.sciencedirect.com/science/article/pii/S0021999110005255</a>. The equation is more or less of the form (for 1D case):<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">
                <span lang="ES">p1 = f(u_x)</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">
<span lang="ES">                p2 = g(u_x)</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">
<span lang="ES">                u_t  = H(p1, p2)</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">
<span lang="ES"> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">
where typically one solves for p1 and p2 using the previous time step solution “u” and then plugs them into the third equation to obtain the next step solution. I am wondering if the TS infrastructure could be used to implement this solution scheme. Looking
 at the manual, I think one could set G(t, U) to the right-hand side in the above equations and F(t, u, u’) = 0 to the left-hand side, although the first two equations would not have time derivative. In that case, how could one take advantage of the operator
 split scheme I mentioned? Maybe using some block preconditioners?<u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">Hi Miguel,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">I have a simple-minded way of understanding these TS things. My heuristic is that you put things in F that you expect to want<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">at u^{n+1}, and things in G that you expect to want at u^n. It is not that simple, since you could for instance move F and G<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">to the LHS and have Backward Euler, but it is my rule of thumb.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">So, were you looking for an IMEX scheme? If so, which terms should be lagged? Also, from the equations above, it is hard to<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">see why you need a solve to calculate p1/p2. It looks like just a forward application of an operator.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">  Thanks,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">     Matt<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"> <u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">
I am trying to solve the Hamilton-Jacobi equation u_t – H(u_x) = 0. I welcome any suggestion for better methods.<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">
 <u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">
Thanks<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">
Miguel<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">
 <u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">
<span lang="ES" style="font-size:9pt;font-family:Consolas">Miguel A. Salazar de Troya</span><u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:0.5in">
<span style="font-size:9pt;font-family:Consolas">Postdoctoral Researcher, Lawrence Livermore National Laboratory</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">
<span style="font-size:9pt;font-family:Consolas">B141</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">
<span style="font-size:9pt;font-family:Consolas">Rm: 1085-5</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">
<span style="font-size:9pt;font-family:Consolas">Ph: 1(925) 422-6411</span><u></u><u></u></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-left:0.5in"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<p class="MsoNormal" style="margin-left:0.5in">-- <u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:0.5in">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<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:0.5in"><a href="https://urldefense.us/v3/__http:/www.cse.buffalo.edu/*knepley/__;fg!!G2kpM7uM-TzIFchu!nue-xIlrKIjtG6dGeWKiWVhSxLIOor_uLXP0UEel7pqB4YUy0y-YTHDqVX9IQCFFohVy9g$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-left:0.5in"><u></u> <u></u></p>
</div>
</div>
</div>
</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>