From 3fbda5b1be8f202e64bc5d98ca439030e72b14c3 Mon Sep 17 00:00:00 2001 From: Steven Roberts Date: Wed, 31 Jul 2024 20:16:36 -0700 Subject: [PATCH] Apply formatter --- .../imexgus/sunadaptcontroller_imexgus.c | 5 +++-- .../soderlind/sunadaptcontroller_soderlind.c | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c b/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c index cfb73cb5a0..fbbea251dc 100644 --- a/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c +++ b/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c @@ -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 { diff --git a/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c b/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c index b4286ff011..62c0e823b0 100644 --- a/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c +++ b/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c @@ -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]); }