Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
drreynolds committed Sep 25, 2024
1 parent 42e99d9 commit 1376c18
Show file tree
Hide file tree
Showing 25 changed files with 77 additions and 75 deletions.
22 changes: 11 additions & 11 deletions examples/arkode/CXX_serial/ark_analytic_sys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,18 +294,18 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
sunrealtype yd0, yd1, yd2;

// fill in the RHS function: f(t,y) = V*D*Vi*y
yd0 = 0.25 * (5.0 * y0 + 1.0 * y1 - 3.0 * y2); // yd = Vi*y
yd1 = 0.25 * (2.0 * y0 + 2.0 * y1 - 2.0 * y2);
yd2 = 0.25 * (1.0 * y0 + 1.0 * y1 + 1.0 * y2);
y0 = -0.5 * yd0; // y = D*yd
y1 = -0.1 * yd1;
y2 = lam * yd2;
yd0 = 1.0 * y0 - 1.0 * y1 + 1.0 * y2; // yd = V*y
yd1 = -1.0 * y0 + 2.0 * y1 + 1.0 * y2;
yd2 = 0.0 * y0 - 1.0 * y1 + 2.0 * y2;
yd0 = 0.25 * (5.0 * y0 + 1.0 * y1 - 3.0 * y2); // yd = Vi*y
yd1 = 0.25 * (2.0 * y0 + 2.0 * y1 - 2.0 * y2);
yd2 = 0.25 * (1.0 * y0 + 1.0 * y1 + 1.0 * y2);
y0 = -0.5 * yd0; // y = D*yd
y1 = -0.1 * yd1;
y2 = lam * yd2;
yd0 = 1.0 * y0 - 1.0 * y1 + 1.0 * y2; // yd = V*y
yd1 = -1.0 * y0 + 2.0 * y1 + 1.0 * y2;
yd2 = 0.0 * y0 - 1.0 * y1 + 2.0 * y2;
N_VGetArrayPointer(ydot)[0] = yd0;
NV_Ith_S(ydot, 1) = yd1;
NV_Ith_S(ydot, 2) = yd2;
NV_Ith_S(ydot, 1) = yd1;
NV_Ith_S(ydot, 2) = yd2;

return 0; // Return with success
}
Expand Down
6 changes: 3 additions & 3 deletions examples/arkode/CXX_serial/ark_kpr_Mt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
tmp1 = rdot(t) / (TWO * u);
tmp2 = sdot(t) / (TWO * v);
N_VGetArrayPointer(ydot)[0] = gcos * tmp1 + gsin * tmp2;
NV_Ith_S(ydot, 1) = -gsin * tmp1 + gcos * tmp2;
NV_Ith_S(ydot, 1) = -gsin * tmp1 + gcos * tmp2;

// Return with success
return 0;
Expand All @@ -388,7 +388,7 @@ static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
tmp3 = udata->G * tmp1 + udata->e * tmp2;
tmp4 = udata->e * tmp1 - tmp2;
N_VGetArrayPointer(ydot)[0] = gcos * tmp3 + gsin * tmp4;
NV_Ith_S(ydot, 1) = -gsin * tmp3 + gcos * tmp4;
NV_Ith_S(ydot, 1) = -gsin * tmp3 + gcos * tmp4;

// Return with success
return 0;
Expand All @@ -411,7 +411,7 @@ static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
tmp3 = udata->G * tmp1 + udata->e * tmp2 + rdot(t) / (TWO * u);
tmp4 = udata->e * tmp1 - tmp2 + sdot(t) / (TWO * v);
N_VGetArrayPointer(ydot)[0] = gcos * tmp3 + gsin * tmp4;
NV_Ith_S(ydot, 1) = -gsin * tmp3 + gcos * tmp4;
NV_Ith_S(ydot, 1) = -gsin * tmp3 + gcos * tmp4;

// Return with success
return 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/arkode/C_serial/ark_analytic.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */

/* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */
N_VGetArrayPointer(ydot)[0] = lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) -
lambda * atan(t);
N_VGetArrayPointer(ydot)[0] =
lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - lambda * atan(t);

return 0; /* return with success */
}
Expand Down
4 changes: 2 additions & 2 deletions examples/arkode/C_serial/ark_analytic_lsrk.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */

/* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */
N_VGetArrayPointer(ydot)[0] = lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) -
lambda * ATAN(t);
N_VGetArrayPointer(ydot)[0] =
lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - lambda * ATAN(t);

return 0; /* return with success */
}
Expand Down
7 changes: 4 additions & 3 deletions examples/arkode/C_serial/ark_analytic_lsrk_varjac.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,10 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */

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

return 0; /* return with success */
}
Expand Down
4 changes: 2 additions & 2 deletions examples/arkode/C_serial/ark_analytic_mels.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */

/* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */
N_VGetArrayPointer(ydot)[0] = lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) -
lambda * atan(t);
N_VGetArrayPointer(ydot)[0] =
lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - lambda * atan(t);

return 0; /* return with success */
}
Expand Down
4 changes: 2 additions & 2 deletions examples/arkode/C_serial/ark_analytic_ssprk.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */

/* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */
N_VGetArrayPointer(ydot)[0] = lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) -
lambda * ATAN(t);
N_VGetArrayPointer(ydot)[0] =
lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - lambda * ATAN(t);

return 0; /* return with success */
}
Expand Down
4 changes: 2 additions & 2 deletions examples/arkode/C_serial/ark_brusselator.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

/* fill in the RHS function */
N_VGetArrayPointer(ydot)[0] = a - (w + 1.0) * u + v * u * u;
NV_Ith_S(ydot, 1) = w * u - v * u * u;
NV_Ith_S(ydot, 2) = (b - w) / ep - w * u;
NV_Ith_S(ydot, 1) = w * u - v * u * u;
NV_Ith_S(ydot, 2) = (b - w) / ep - w * u;

return 0; /* Return with success */
}
Expand Down
8 changes: 4 additions & 4 deletions examples/arkode/C_serial/ark_brusselator_fp.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

/* fill in the RHS function */
N_VGetArrayPointer(ydot)[0] = 0.0;
NV_Ith_S(ydot, 1) = 0.0;
NV_Ith_S(ydot, 2) = (b - w) / ep;
NV_Ith_S(ydot, 1) = 0.0;
NV_Ith_S(ydot, 2) = (b - w) / ep;

return 0; /* Return with success */
}
Expand All @@ -307,8 +307,8 @@ static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

/* fill in the RHS function */
N_VGetArrayPointer(ydot)[0] = a - (w + 1.0) * u + v * u * u;
NV_Ith_S(ydot, 1) = w * u - v * u * u;
NV_Ith_S(ydot, 2) = -w * u;
NV_Ith_S(ydot, 1) = w * u - v * u * u;
NV_Ith_S(ydot, 2) = -w * u;

return 0; /* Return with success */
}
Expand Down
8 changes: 4 additions & 4 deletions examples/arkode/C_serial/ark_brusselator_mri.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

/* fill in the RHS function */
N_VGetArrayPointer(ydot)[0] = 0.0;
NV_Ith_S(ydot, 1) = 0.0;
NV_Ith_S(ydot, 2) = (b - w) / ep;
NV_Ith_S(ydot, 1) = 0.0;
NV_Ith_S(ydot, 2) = (b - w) / ep;

/* Return with success */
return 0;
Expand All @@ -275,8 +275,8 @@ static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

/* fill in the RHS function */
N_VGetArrayPointer(ydot)[0] = a - (w + 1.0) * u + v * u * u;
NV_Ith_S(ydot, 1) = w * u - v * u * u;
NV_Ith_S(ydot, 2) = -w * u;
NV_Ith_S(ydot, 1) = w * u - v * u * u;
NV_Ith_S(ydot, 2) = -w * u;

/* Return with success */
return 0;
Expand Down
22 changes: 11 additions & 11 deletions examples/arkode/C_serial/ark_kpr_mri.c
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
/* fill in the RHS function:
[0 0]*[(-1+u^2-r(t))/(2*u)] + [ 0 ]
[e -1] [(-2+v^2-s(t))/(2*v)] [sdot(t)/(2*vtrue(t))] */
tmp1 = (-ONE + u * u - r(t, rpar)) / (TWO * u);
tmp2 = (-TWO + v * v - s(t, rpar)) / (TWO * v);
tmp1 = (-ONE + u * u - r(t, rpar)) / (TWO * u);
tmp2 = (-TWO + v * v - s(t, rpar)) / (TWO * v);
N_VGetArrayPointer(ydot)[0] = ZERO;
NV_Ith_S(ydot, 1) = e * tmp1 - tmp2 + sdot(t, rpar) / (TWO * vtrue(t, rpar));

Expand All @@ -730,10 +730,10 @@ static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
/* fill in the RHS function:
[G e]*[(-1+u^2-r(t))/(2*u))] + [rdot(t)/(2*u)]
[0 0] [(-2+v^2-s(t))/(2*v)] [ 0 ] */
tmp1 = (-ONE + u * u - r(t, rpar)) / (TWO * u);
tmp2 = (-TWO + v * v - s(t, rpar)) / (TWO * v);
tmp1 = (-ONE + u * u - r(t, rpar)) / (TWO * u);
tmp2 = (-TWO + v * v - s(t, rpar)) / (TWO * v);
N_VGetArrayPointer(ydot)[0] = G * tmp1 + e * tmp2 + rdot(t, rpar) / (TWO * u);
NV_Ith_S(ydot, 1) = ZERO;
NV_Ith_S(ydot, 1) = ZERO;

/* Return with success */
return 0;
Expand All @@ -749,7 +749,7 @@ static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
[rdot(t)/(2*u)]
[ 0 ] */
N_VGetArrayPointer(ydot)[0] = rdot(t, rpar) / (TWO * u);
NV_Ith_S(ydot, 1) = ZERO;
NV_Ith_S(ydot, 1) = ZERO;

/* Return with success */
return 0;
Expand All @@ -768,10 +768,10 @@ static int fsi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
/* fill in the slow implicit RHS function:
[G e]*[(-1+u^2-r(t))/(2*u))]
[0 0] [(-2+v^2-s(t))/(2*v)] */
tmp1 = (-ONE + u * u - r(t, rpar)) / (TWO * u);
tmp2 = (-TWO + v * v - s(t, rpar)) / (TWO * v);
tmp1 = (-ONE + u * u - r(t, rpar)) / (TWO * u);
tmp2 = (-TWO + v * v - s(t, rpar)) / (TWO * v);
N_VGetArrayPointer(ydot)[0] = G * tmp1 + e * tmp2;
NV_Ith_S(ydot, 1) = ZERO;
NV_Ith_S(ydot, 1) = ZERO;

/* Return with success */
return 0;
Expand All @@ -789,8 +789,8 @@ static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
/* fill in the RHS function:
[G e]*[(-1+u^2-r(t))/(2*u))] + [rdot(t)/(2*u)]
[e -1] [(-2+v^2-s(t))/(2*v)] [sdot(t)/(2*vtrue(t))] */
tmp1 = (-ONE + u * u - r(t, rpar)) / (TWO * u);
tmp2 = (-TWO + v * v - s(t, rpar)) / (TWO * v);
tmp1 = (-ONE + u * u - r(t, rpar)) / (TWO * u);
tmp2 = (-TWO + v * v - s(t, rpar)) / (TWO * v);
N_VGetArrayPointer(ydot)[0] = G * tmp1 + e * tmp2 + rdot(t, rpar) / (TWO * u);
NV_Ith_S(ydot, 1) = e * tmp1 - tmp2 + sdot(t, rpar) / (TWO * vtrue(t, rpar));

Expand Down
8 changes: 4 additions & 4 deletions examples/arkode/C_serial/ark_onewaycouple_mri.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

/* fill in the RHS function */
N_VGetArrayPointer(ydot)[0] = SUN_RCONST(0.0);
NV_Ith_S(ydot, 1) = SUN_RCONST(0.0);
NV_Ith_S(ydot, 2) = -w;
NV_Ith_S(ydot, 1) = SUN_RCONST(0.0);
NV_Ith_S(ydot, 2) = -w;

/* Return with success */
return 0;
Expand All @@ -280,8 +280,8 @@ static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

/* fill in the RHS function */
N_VGetArrayPointer(ydot)[0] = -c1 * v;
NV_Ith_S(ydot, 1) = c1 * u;
NV_Ith_S(ydot, 2) = u + v;
NV_Ith_S(ydot, 1) = c1 * u;
NV_Ith_S(ydot, 2) = u + v;

/* Return with success */
return 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/arkode/C_serial/ark_robertson.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

/* Fill in ODE RHS function */
N_VGetArrayPointer(ydot)[0] = -0.04 * u + 1.e4 * v * w;
NV_Ith_S(ydot, 1) = 0.04 * u - 1.e4 * v * w - 3.e7 * v * v;
NV_Ith_S(ydot, 2) = 3.e7 * v * v;
NV_Ith_S(ydot, 1) = 0.04 * u - 1.e4 * v * w - 3.e7 * v * v;
NV_Ith_S(ydot, 2) = 3.e7 * v * v;

return 0; /* Return with success */
}
Expand Down
4 changes: 2 additions & 2 deletions examples/arkode/C_serial/ark_robertson_constraints.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

/* Fill in ODE RHS function */
N_VGetArrayPointer(ydot)[0] = -0.04 * u + 1.e4 * v * w;
NV_Ith_S(ydot, 1) = 0.04 * u - 1.e4 * v * w - 3.e7 * v * v;
NV_Ith_S(ydot, 2) = 3.e7 * v * v;
NV_Ith_S(ydot, 1) = 0.04 * u - 1.e4 * v * w - 3.e7 * v * v;
NV_Ith_S(ydot, 2) = 3.e7 * v * v;

return 0; /* Return with success */
}
Expand Down
4 changes: 2 additions & 2 deletions examples/arkode/C_serial/ark_robertson_root.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

/* Fill in ODE RHS function */
N_VGetArrayPointer(ydot)[0] = -0.04 * u + 1.e4 * v * w;
NV_Ith_S(ydot, 1) = 0.04 * u - 1.e4 * v * w - 3.e7 * v * v;
NV_Ith_S(ydot, 2) = 3.e7 * v * v;
NV_Ith_S(ydot, 1) = 0.04 * u - 1.e4 * v * w - 3.e7 * v * v;
NV_Ith_S(ydot, 2) = 3.e7 * v * v;

return 0; /* Return with success */
}
Expand Down
8 changes: 4 additions & 4 deletions examples/arkode/C_serial/ark_twowaycouple_mri.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

/* fill in the RHS function */
N_VGetArrayPointer(ydot)[0] = c1 * v;
NV_Ith_S(ydot, 1) = -c1 * u;
NV_Ith_S(ydot, 2) = u;
NV_Ith_S(ydot, 1) = -c1 * u;
NV_Ith_S(ydot, 2) = u;

/* Return with success */
return 0;
Expand All @@ -246,8 +246,8 @@ static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

/* fill in the RHS function */
N_VGetArrayPointer(ydot)[0] = w;
NV_Ith_S(ydot, 1) = SUN_RCONST(0.0);
NV_Ith_S(ydot, 2) = -w;
NV_Ith_S(ydot, 1) = SUN_RCONST(0.0);
NV_Ith_S(ydot, 2) = -w;

/* Return with success */
return 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/cvode/serial/cvAnalytic_mels.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */

/* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */
N_VGetArrayPointer(ydot)[0] = lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) -
lambda * atan(t);
N_VGetArrayPointer(ydot)[0] =
lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - lambda * atan(t);

return 0; /* return with success */
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cvode/serial/cvDirectDemo_ls.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ static int f1(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
y1 = NV_Ith_S(y, 1);

N_VGetArrayPointer(ydot)[0] = y1;
NV_Ith_S(ydot, 1) = (ONE - SQR(y0)) * P1_ETA * y1 - y0;
NV_Ith_S(ydot, 1) = (ONE - SQR(y0)) * P1_ETA * y1 - y0;

return (0);
}
Expand Down
3 changes: 2 additions & 1 deletion examples/cvode/serial/cvRoberts_dns_negsol.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)

if (*check_negative && (y1 < 0 || y2 < 0 || y3 < 0)) { return (1); }

yd1 = N_VGetArrayPointer(ydot)[0] = SUN_RCONST(-0.04) * y1 + SUN_RCONST(1.0e4) * y2 * y3;
yd1 = N_VGetArrayPointer(ydot)[0] = SUN_RCONST(-0.04) * y1 +
SUN_RCONST(1.0e4) * y2 * y3;
yd3 = NV_Ith_S(ydot, 2) = SUN_RCONST(3.0e7) * y2 * y2;
NV_Ith_S(ydot, 1) = -yd1 - yd3;

Expand Down
4 changes: 2 additions & 2 deletions examples/cvodes/serial/cvsAnalytic_mels.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */

/* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */
N_VGetArrayPointer(ydot)[0] = lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) -
lambda * atan(t);
N_VGetArrayPointer(ydot)[0] =
lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - lambda * atan(t);

return 0; /* return with success */
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cvodes/serial/cvsDirectDemo_ls.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ static int f1(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
y1 = NV_Ith_S(y, 1);

N_VGetArrayPointer(ydot)[0] = y1;
NV_Ith_S(ydot, 1) = (ONE - SQR(y0)) * P1_ETA * y1 - y0;
NV_Ith_S(ydot, 1) = (ONE - SQR(y0)) * P1_ETA * y1 - y0;

return (0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/arkode/arkode_lsrkstep_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ int lsrkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt

/* compute the average number of stages */
sunrealtype avg_stage = ((sunrealtype)step_mem->nfe) /
((sunrealtype)ark_mem->nst_attempts);
((sunrealtype)ark_mem->nst_attempts);

switch (fmt)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
yd1 = -SUN_RCONST(1.0) * y0 + SUN_RCONST(2.0) * y1 + SUN_RCONST(1.0) * y2;
yd2 = SUN_RCONST(0.0) * y0 - SUN_RCONST(1.0) * y1 + SUN_RCONST(2.0) * y2;
N_VGetArrayPointer(ydot)[0] = yd0;
NV_Ith_S(ydot, 1) = yd1;
NV_Ith_S(ydot, 2) = yd2;
NV_Ith_S(ydot, 1) = yd1;
NV_Ith_S(ydot, 2) = yd2;

return 0; // Return with success
}
Expand Down
6 changes: 3 additions & 3 deletions test/unit_tests/arkode/C_serial/ark_test_interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,9 @@ int main(int argc, char* argv[])
static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
{
sunrealtype* lambda = (sunrealtype*)user_data;
N_VGetArrayPointer(ydot)[0] = (*lambda) * (NV_Ith_S(y, 0) - SIN(SUN_RCONST(2.0) * t)) +
NV_Ith_S(y, 1) - COS(SUN_RCONST(3.0) * t) +
SUN_RCONST(2.0) * COS(SUN_RCONST(2.0) * t);
N_VGetArrayPointer(ydot)[0] =
(*lambda) * (NV_Ith_S(y, 0) - SIN(SUN_RCONST(2.0) * t)) + NV_Ith_S(y, 1) -
COS(SUN_RCONST(3.0) * t) + SUN_RCONST(2.0) * COS(SUN_RCONST(2.0) * t);
NV_Ith_S(ydot, 1) = NV_Ith_S(y, 0) - NV_Ith_S(y, 1) -
SIN(SUN_RCONST(2.0) * t) + COS(SUN_RCONST(3.0) * t) -
SUN_RCONST(3.0) * SIN(SUN_RCONST(3.0) * t);
Expand Down
4 changes: 2 additions & 2 deletions test/unit_tests/arkode/C_serial/ark_test_reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data)
sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */

/* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */
N_VGetArrayPointer(ydot)[0] = lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) -
lambda * atan(t);
N_VGetArrayPointer(ydot)[0] =
lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - lambda * atan(t);

return 0; /* return with success */
}
Expand Down

0 comments on commit 1376c18

Please sign in to comment.