You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two common situations in which we are doing unnecessary calls to dss! and lim!:
If the tableaus a_exp and a_imp start with a row that is all 0s, the value of the first stage is just u. Since u was already DSS-ed at the end of the previous timestep, it does not need to be DSS-ed again. More generally, if the tableaus are such that, on stage i, a_exp[i, 1:i-1] and a_imp[i, 1:i-1] are all 0s, then either there is no implicit solve and the value of stage i is u, or the input to the implicit solve on stage i is u; in both cases, we do not need to DSS u. Note that this reasoning is not valid if users are allowed add callbacks that modify u in ways that require it to be DSS-ed again. So, if we want to optimize out these unnecessary calls to dss!, we should clearly document that users should not add such callbacks. In addition, this reasoning is not valid if users can make the effect of dss! depend on the time at which it was called, which means that we should not pass t as an argument to dss!.
If the weights b_exp and b_imp are identical to the last rows of the tableaus a_exp and a_imp (i.e., if the algorithm is FSAL), the value of the last stage is also the final value of u. So, instead of incrementing u with previously-evaluated tendencies and applying lim! and dss!, we can just set u .= U[s]. Once again, this reasoning is not valid if users can make the effects of lim! and dss! depend on the time at which they were called, so we should not pass t as an argument to lim! and dss!. Also, if users can filter U[s] through stage_callback! before evaluating the last explicit tendency, we will need to copy U[s] before it gets filtered so that we can set u .= U[s] afterward (or we could just drop support for filtering through stage_callback! in order to avoid unnecessarily complicated code, in which case users will still be able to filter copies of their state vector "under the hood").
The text was updated successfully, but these errors were encountered:
There are two common situations in which we are doing unnecessary calls to
dss!
andlim!
:a_exp
anda_imp
start with a row that is all 0s, the value of the first stage is justu
. Sinceu
was already DSS-ed at the end of the previous timestep, it does not need to be DSS-ed again. More generally, if the tableaus are such that, on stagei
,a_exp[i, 1:i-1]
anda_imp[i, 1:i-1]
are all 0s, then either there is no implicit solve and the value of stagei
isu
, or the input to the implicit solve on stagei
isu
; in both cases, we do not need to DSSu
. Note that this reasoning is not valid if users are allowed add callbacks that modifyu
in ways that require it to be DSS-ed again. So, if we want to optimize out these unnecessary calls todss!
, we should clearly document that users should not add such callbacks. In addition, this reasoning is not valid if users can make the effect ofdss!
depend on the time at which it was called, which means that we should not passt
as an argument todss!
.b_exp
andb_imp
are identical to the last rows of the tableausa_exp
anda_imp
(i.e., if the algorithm is FSAL), the value of the last stage is also the final value ofu
. So, instead of incrementingu
with previously-evaluated tendencies and applyinglim!
anddss!
, we can just setu .= U[s]
. Once again, this reasoning is not valid if users can make the effects oflim!
anddss!
depend on the time at which they were called, so we should not passt
as an argument tolim!
anddss!
. Also, if users can filterU[s]
throughstage_callback!
before evaluating the last explicit tendency, we will need to copyU[s]
before it gets filtered so that we can setu .= U[s]
afterward (or we could just drop support for filtering throughstage_callback!
in order to avoid unnecessarily complicated code, in which case users will still be able to filter copies of their state vector "under the hood").The text was updated successfully, but these errors were encountered: