<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="">
<pre width="80" style="font-variant-ligatures: normal; orphans: 2; widows: 2;" class=""><br class=""></pre>
<div>
<blockquote type="cite" class="">
<div class="">On Oct 20, 2017, at 11:34 AM, Jed Brown <<a href="mailto:jed@jedbrown.org" class="">jed@jedbrown.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">Matthew
 Knepley <</span><a href="mailto:knepley@gmail.com" style="font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">knepley@gmail.com</a><span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">>
 writes:</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<br style="font-family: Verdana; font-size: 12px; 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;" class="">
<blockquote type="cite" style="font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">
On Fri, Oct 20, 2017 at 11:58 AM, Emil Constantinescu <<a href="mailto:emconsta@mcs.anl.gov" class="">emconsta@mcs.anl.gov</a>><br class="">
wrote:<br class="">
<br class="">
<blockquote type="cite" class="">On 10/20/17 10:43 AM, Matthew Knepley wrote:<br class="">
<br class="">
<blockquote type="cite" class="">On Fri, Oct 20, 2017 at 11:22 AM, Emil Constantinescu <<br class="">
<a href="mailto:emconsta@mcs.anl.gov" class="">emconsta@mcs.anl.gov</a> <<a href="mailto:emconsta@mcs.anl.gov" class="">mailto:emconsta@mcs.anl.gov</a>>> wrote:<br class="">
<br class="">
   On 10/20/17 9:11 AM, Matthew Knepley wrote:<br class="">
<br class="">
       On Fri, Oct 20, 2017 at 9:23 AM, Emil Constantinescu<br class="">
       <<a href="mailto:emconsta@mcs.anl.gov" class="">emconsta@mcs.anl.gov</a> <<a href="mailto:emconsta@mcs.anl.gov" class="">mailto:emconsta@mcs.anl.gov</a>><br class="">
       <<a href="mailto:emconsta@mcs.anl.gov" class="">mailto:emconsta@mcs.anl.gov</a> <<a href="mailto:emconsta@mcs.anl.gov" class="">mailto:emconsta@mcs.anl.gov</a>>>><br class="">
wrote:<br class="">
<br class="">
            On 10/20/17 7:57 AM, Matthew Knepley wrote:<br class="">
<br class="">
                I am confused by some of the terminology in TS. At the<br class="">
top<br class="">
                level, IFunction appears to mean the entire equation<br class="">
<br class="">
                    F(u, u_t, x) = 0<br class="">
<br class="">
<br class="">
            Matt, page 141 of the manual: F(t, u, u_t) = G(t, u), and<br class="">
       not zero<br class="">
            on the RHS side. To make the interface general we allow<br class="">
       internally<br class="">
            for F:= F(t, u, u_t) - G(t, u) and then F=0.<br class="">
<br class="">
<br class="">
       This is not "internal". Its the toplevel interface:<br class="">
<br class="">
       <a href="https://bitbucket.org/petsc/petsc/src/63ae3ecac3af8ce782273a" class="">https://bitbucket.org/petsc/petsc/src/63ae3ecac3af8ce782273a</a><br class="">
76ad4152cddc2fd80a/src/ts/interface/ts.c?at=master&<br class="">
fileviewer=file-view-default#ts.c-884<br class="">
       <<a href="https://bitbucket.org/petsc/petsc/src/63ae3ecac3af8ce782273" class="">https://bitbucket.org/petsc/petsc/src/63ae3ecac3af8ce782273</a><br class="">
a76ad4152cddc2fd80a/src/ts/interface/ts.c?at=master&<br class="">
fileviewer=file-view-default#ts.c-884><br class="">
<br class="">
       It computes F - G.<br class="">
<br class="">
<br class="">
   That's what it should do in some cases. The user provides either<br class="">
   ifunction or rhs funtion or both. The api to the solvers can take<br class="">
   care of this stuff automatically - that's what I meant by internal.<br class="">
   Different TS solvers can take different definitions of the funtions;<br class="">
   e.g., imex need both, beuler can take ifuntion and/or rhs function<br class="">
   but instead of writing beuler for both we choose the most general<br class="">
   case (ifunction) and compose the functions accordingly. The F - G is<br class="">
   transparent to the user. But somewhere the sausage needs to be made<br class="">
   and I think that is the right level because that is least likely to<br class="">
   change and least maintenance.<br class="">
<br class="">
<br class="">
I know what it does. I looked at the code. You are missing the point here.<br class="">
<br class="">
We cannot use the same word, IFunction, for two different things, F and<br class="">
F-G. The argument that is is not user facing is complete bullshit.<br class="">
The user inputs the points for ifunction, and can also call the toplevel<br class="">
interface.<br class="">
<br class="">
</blockquote>
<br class="">
Matt, we do not. IFunction is F(t,u_t,u), RHS function is G(t,u). What we<br class="">
solve is F=G and not F=0. Do you doubt that?<br class="">
<br class="">
When the user specifies IFunction it is that F; when the user specifies<br class="">
RHS it is that G.<br class="">
<br class="">
</blockquote>
<br class="">
Nope. We use the word IFunction, specifically in the ifunction function<br class="">
pointer to mean<br class="">
<br class="">
 F<br class="">
<br class="">
but we use the word IFunction, specifically in TSComputeIFunction, to mean<br class="">
<br class="">
 F - G<br class="">
<br class="">
And, no its visible to everyone, not just "TS developers".<br class="">
</blockquote>
<br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">The
 "imex" flag is part of the TSComputeIFunction interface.  If that</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">flag
 is TRUE, then IFunction is exactly what the user provides.  If</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">FALSE,
 then the RHSFunction is subtracted off.  Should that be better</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">documented?</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
</div>
</blockquote>
<div><br class="">
</div>
<div>I think the confusion really comes from the following description in the comments:</div>
<div>
<pre width="80" style="font-variant-ligatures: normal; orphans: 2; widows: 2;" class=""><font face="Verdana" class=""><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSComputeIFunction.html#TSComputeIFunction" class="">TSComputeIFunction</a> - Evaluates the DAE residual written in implicit form F(t,U,Udot)=0</font></pre>
</div>
<div>It would be easier to understand if we say </div>
<pre width="80" style="font-variant-ligatures: normal; orphans: 2; widows: 2;" class=""><font face="Verdana" class=""><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSComputeIFunction.html#TSComputeIFunction" class="">TSComputeIFunction</a> - Evaluates F or F-G, depending on the "imex" flag</font></pre>
<div>since it is stated in the manual that PETSc addresses the general form F(t,u,udot) = G(t,u).</div>
<div>And normally users do not need to be aware of anything about the fully implicit form that some internal TS solvers work with, but developers do.</div>
<div><br class="">
</div>
<div>Another confusion which is not related to this topic is the usage of the word "DAE". </div>
<div>I disagree with the statement "In general, this (the general form) is a differential algebraic equation (DAE)" on page 141 of the manual.</div>
<div>The word "DAE" has been abused in the comments of many TS functions (including TSComputeIFunction), where it actually should mean "DAE or ODE".</div>
<div>PETSc uses the same interfaces for both DAE and ODE, but it is wrong to consider ODE as a special case of DAE.</div>
<div>They are fundamentally different from each other and should be distinguished explicitly in the manual and the source code.</div>
<div><br class="">
</div>
<div>Hong (Mr.)</div>
<br class="">
<blockquote type="cite" class="">
<div class=""><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">We
 could make a new interface TSComputeIFunctionMaybeMinusRHSFunction()</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">but
 I don't think it's necessary.  Without any such interface, the TS</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">implementations
 would each need to reproduce a bunch of vector and</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">matrix
 wrangling.</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">Note
 that TSComputeIFunction is very much like SNESComputeFunction,</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">which
 includes</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class=""> if
 (snes->vec_rhs) {</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">   ierr
 = VecAXPY(y,-1.0,snes->vec_rhs);CHKERRQ(ierr);</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class=""> }</span><br style="font-family: Verdana; font-size: 12px; 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;" class="">
<br style="font-family: Verdana; font-size: 12px; 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;" class="">
<span style="font-family: Verdana; font-size: 12px; 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; float: none; display: inline !important;" class="">Why
 haven't you complained about that?</span></div>
</blockquote>
</div>
<br class="">
</body>
</html>