Skip to content

Commit

Permalink
Apply formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Roberts committed Aug 1, 2024
1 parent 2caec18 commit 3fbda5b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@ SUNErrCode SUNAdaptController_EstimateStep_ImExGus(SUNAdaptController C,
const int ord = p + 1;

/* compute estimated time step size, modifying the first step formula */
if (SACIMEXGUS_FIRSTSTEP(C)) {
if (SACIMEXGUS_FIRSTSTEP(C))
{
// TODO: could this case be handled by setting e1 = e2?
/* set usable time-step adaptivity parameters -- first step */
const sunrealtype k = -SUN_RCONST(1.0) / ord;
const sunrealtype e = SACIMEXGUS_BIAS(C) * dsm;
*hnew = h * SUNRpowerR(e, k);
*hnew = h * SUNRpowerR(e, k);
}
else
{
Expand Down
12 changes: 8 additions & 4 deletions src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,18 @@ SUNErrCode SUNAdaptController_EstimateStep_Soderlind(SUNAdaptController C,
const int ord = p + 1;

/* set usable time-step adaptivity parameters */
const sunrealtype ke[] = {-SODERLIND_K1(C) / ord, -SODERLIND_K2(C) / ord, -SODERLIND_K3(C) / ord};
const sunrealtype ke[] = {-SODERLIND_K1(C) / ord, -SODERLIND_K2(C) / ord,
-SODERLIND_K3(C) / ord};
const sunrealtype kh[] = {SODERLIND_K4(C), SODERLIND_K5(C)};
// TODO: Should e2 and e3 be set to e1 when we don't have enough history yet?
const sunrealtype e[] = {SODERLIND_BIAS(C) * dsm, SODERLIND_EP(C), SODERLIND_EPP(C)};
const sunrealtype hrat[] = {h / SODERLIND_HP(C), SODERLIND_HP(C) / SODERLIND_HPP(C)};
const sunrealtype e[] = {SODERLIND_BIAS(C) * dsm, SODERLIND_EP(C),
SODERLIND_EPP(C)};
const sunrealtype hrat[] = {h / SODERLIND_HP(C),
SODERLIND_HP(C) / SODERLIND_HPP(C)};

*hnew = h * SUNRpowerR(e[0], ke[0]);
for (int i = 0; i < SUNMIN(2, SODERLIND_FIRSTSTEPS(C)); i++) {
for (int i = 0; i < SUNMIN(2, SODERLIND_FIRSTSTEPS(C)); i++)
{
*hnew *= SUNRpowerR(hrat[i], kh[i]) * SUNRpowerR(e[i + 1], ke[i + 1]);
}

Expand Down

0 comments on commit 3fbda5b

Please sign in to comment.