Skip to content

Commit 70666b4

Browse files
committed
revision
1 parent 5a7abdb commit 70666b4

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

doc/arkode/guide/source/Mathematics.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ The SSPRK methods in ARKODE use the following Shu--Osher representation :cite:p:
780780
y_{n+1} &= z_s.
781781
:label: ARKODE_SSP
782782
783+
The coefficients of Shu--Osher representation is not uniquely determined by Butcher table :cite:p:`SR:02`.
783784
In particular, the methods SSP(s,2), SSP(s,3), and SSP(10,4) implemented herein and presented in
784785
:cite:p:`K:08` have "almost" all zero coefficients appearing in :math:`\alpha_{i,i-1}` and
785786
:math:`\beta_{i,i-1}`. This feature facilitates their implementation in a low-storage manner. The

doc/shared/sundials.bib

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2421,3 +2421,14 @@ @article{SO:88
24212421
publisher={Elsevier},
24222422
doi={10.1016/0021-9991(88)90177-5},
24232423
author={Shu, Chi-Wang and Osher, Stanley}}
2424+
2425+
@article{SR:02,
2426+
title={A new class of optimal high-order strong-stability-preserving time discretization methods},
2427+
journal={SIAM Journal on Numerical Analysis},
2428+
volume={40},
2429+
number={2},
2430+
pages={469--491},
2431+
year={2002},
2432+
publisher={SIAM},
2433+
doi={10.1137/S0036142901389025},
2434+
author={Spiteri, Raymond J and Ruuth, Steven J}}

examples/arkode/C_serial/ark_analytic_lsrk_varjac.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* the value of alpha determines the radius of the interval in which
2929
* the stiffness parameter lies.
3030
*
31-
* The value of "lambda - alpha*cos((10 - t)/10*pi)" should
31+
* The value of lambda - alpha*cos((10 - t)/10*pi) should
3232
* be negative to result in a well-posed ODE; for values with magnitude
3333
* larger than 100 the problem becomes quite stiff.
3434
*
@@ -97,8 +97,8 @@ int main(void)
9797
sunindextype NEQ = 1; /* number of dependent vars. */
9898
sunrealtype reltol = SUN_RCONST(1.0e-8); /* tolerances */
9999
sunrealtype abstol = SUN_RCONST(1.0e-8);
100-
sunrealtype lambda = SUN_RCONST(-1.0e+6); /* stiffness parameter 1*/
101-
sunrealtype alpha = SUN_RCONST(1.0e+2); /* stiffness parameter 2*/
100+
sunrealtype lambda = SUN_RCONST(-1.0e+6); /* stiffness parameter 1 */
101+
sunrealtype alpha = SUN_RCONST(1.0e+2); /* stiffness parameter 2 */
102102
sunrealtype UserData[2];
103103
UserData[0] = lambda;
104104
UserData[1] = alpha;
@@ -237,9 +237,9 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
237237

238238
/* fill in the RHS function: "N_VGetArrayPointer" accesses the 0th entry of ydot */
239239
N_VGetArrayPointer(ydot)[0] =
240-
(lambda - alpha * COS((10 - t) / 10 * ACOS(-1))) * u +
240+
(lambda - alpha * COS((SUN_RCONST(10.0) - t) / SUN_RCONST(10.0) * ACOS(SUN_RCONST(-1.0)))) * u +
241241
SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) -
242-
(lambda - alpha * COS((10 - t) / 10 * ACOS(-1))) * ATAN(t);
242+
(lambda - alpha * COS((SUN_RCONST(10.0) - t) / SUN_RCONST(10.0) * ACOS(SUN_RCONST(-1.0)))) * ATAN(t);
243243

244244
return 0; /* return with success */
245245
}
@@ -252,8 +252,8 @@ static int dom_eig(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype* lambdaR,
252252
sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */
253253
sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter 1 */
254254
sunrealtype alpha = rdata[1]; /* set shortcut for stiffness parameter 2 */
255-
*lambdaR = (lambda - alpha * COS((10 - t) / 10 *
256-
ACOS(-1))); /* access current solution value */
255+
*lambdaR = (lambda - alpha * COS((SUN_RCONST(10.0) - t) / SUN_RCONST(10.0) *
256+
ACOS(SUN_RCONST(-1.0)))); /* access current solution value */
257257
*lambdaI = SUN_RCONST(0.0);
258258

259259
return 0; /* return with success */

0 commit comments

Comments
 (0)