From 82a246de6d5cc557cd3fe34da564caf226d8bf99 Mon Sep 17 00:00:00 2001 From: Charles Kawczynski Date: Thu, 28 Sep 2023 13:49:33 -0700 Subject: [PATCH] Unfuse hard-coded ARS updates --- src/time_stepper/hc_ars343.jl | 58 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/src/time_stepper/hc_ars343.jl b/src/time_stepper/hc_ars343.jl index 05493440b7..8df75c06dc 100644 --- a/src/time_stepper/hc_ars343.jl +++ b/src/time_stepper/hc_ars343.jl @@ -32,7 +32,8 @@ function CTS.step_u!( i = 2 t_exp = t + dt * c_exp[i] - @. U = u + dt * a_exp[i, 1] * T_lim[1] + @. U = u + @. U += dt * a_exp[i, 1] * T_lim[1] lim!(U, p, t_exp, u) @. U += dt * a_exp[i, 1] * T_exp[1] dss!(U, p, t_exp) @@ -70,12 +71,13 @@ function CTS.step_u!( i = 3 t_exp = t + dt * c_exp[i] - @. U = u + dt * a_exp[i, 1] * T_lim[1] + dt * a_exp[i, 2] * T_lim[2] + @. U = u + @. U += dt * a_exp[i, 1] * T_lim[1] + @. U += dt * a_exp[i, 2] * T_lim[2] lim!(U, p, t_exp, u) - @. U += - dt * a_exp[i, 1] * T_exp[1] + - dt * a_exp[i, 2] * T_exp[2] + - dt * a_imp[i, 2] * T_imp[2] + @. U += dt * a_exp[i, 1] * T_exp[1] + @. U += dt * a_exp[i, 2] * T_exp[2] + @. U += dt * a_imp[i, 2] * T_imp[2] dss!(U, p, t_exp) post_explicit!(U, p, t_exp) @@ -110,18 +112,16 @@ function CTS.step_u!( T_exp!(T_exp[i], U, p, t_exp) i = 4 t_exp = t + dt - @. U = - u + - dt * a_exp[i, 1] * T_lim[1] + - dt * a_exp[i, 2] * T_lim[2] + - dt * a_exp[i, 3] * T_lim[3] + @. U = u + @. U += dt * a_exp[i, 1] * T_lim[1] + @. U += dt * a_exp[i, 2] * T_lim[2] + @. U += dt * a_exp[i, 3] * T_lim[3] lim!(U, p, t_exp, u) - @. U += - dt * a_exp[i, 1] * T_exp[1] + - dt * a_exp[i, 2] * T_exp[2] + - dt * a_exp[i, 3] * T_exp[3] + - dt * a_imp[i, 2] * T_imp[2] + - dt * a_imp[i, 3] * T_imp[3] + @. U += dt * a_exp[i, 1] * T_exp[1] + @. U += dt * a_exp[i, 2] * T_exp[2] + @. U += dt * a_exp[i, 3] * T_exp[3] + @. U += dt * a_imp[i, 2] * T_imp[2] + @. U += dt * a_imp[i, 3] * T_imp[3] dss!(U, p, t_exp) post_explicit!(U, p, t_exp) @@ -159,20 +159,18 @@ function CTS.step_u!( i = -1 t_final = t + dt - @. temp = - u + - dt * b_exp[2] * T_lim[2] + - dt * b_exp[3] * T_lim[3] + - dt * b_exp[4] * T_lim[4] + @. temp = u + @. temp += dt * b_exp[2] * T_lim[2] + @. temp += dt * b_exp[3] * T_lim[3] + @. temp += dt * b_exp[4] * T_lim[4] lim!(temp, p, t_final, u) - @. u = - temp + - dt * b_exp[2] * T_exp[2] + - dt * b_exp[3] * T_exp[3] + - dt * b_exp[4] * T_exp[4] + - dt * b_imp[2] * T_imp[2] + - dt * b_imp[3] * T_imp[3] + - dt * b_imp[4] * T_imp[4] + @. u = temp + @. u += dt * b_exp[2] * T_exp[2] + @. u += dt * b_exp[3] * T_exp[3] + @. u += dt * b_exp[4] * T_exp[4] + @. u += dt * b_imp[2] * T_imp[2] + @. u += dt * b_imp[3] * T_imp[3] + @. u += dt * b_imp[4] * T_imp[4] dss!(u, p, t_final) post_explicit!(u, p, t_final) return u