Skip to content

Commit 0b0ba2e

Browse files
committed
minor simplifcation
1 parent 17c43c6 commit 0b0ba2e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/OrdinaryDiffEqStabilizedIRK/src/irkc_perform_step.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function perform_step!(integrator, cache::IRKCConstantCache, repeat_step = false
2626
#maxm = max(2,Int(floor(sqrt(integrator.opts.internalnorm(integrator.opts.reltol,t)/(10 *eps(integrator.opts.internalnorm(uprev,t)))))))
2727
maxm = 50
2828
mdeg = 1 + floor(Int, sqrt(1.54 * abs(dt) * integrator.eigen_est + 1))
29-
mdeg = min(maxm, max(minm, mdeg))
29+
mdeg = clamp(mdeg, minm, maxm)
3030

3131
ω₀ = 1 + 2 / (13 * (mdeg^2))
3232
temp₁ = ω₀^2 - 1
@@ -156,9 +156,8 @@ function perform_step!(integrator, cache::IRKCCache, repeat_step = false)
156156
# The the number of degree for Chebyshev polynomial
157157
#maxm = max(2,int(floor(sqrt(integrator.opts.internalnorm(integrator.opts.reltol,t)/(10 *eps(integrator.opts.internalnorm(uprev,t)))))))
158158
maxm = 50
159-
mdeg = 1 + Int(floor(sqrt(1.54 * abs(dt) * integrator.eigen_est + 1)))
160-
mdeg = (mdeg < minm) ? minm : mdeg
161-
mdeg = (mdeg >= maxm) ? maxm : mdeg
159+
mdeg = 1 + floor(Int, sqrt(1.54 * abs(dt) * integrator.eigen_est + 1))
160+
mdeg = clamp(mdeg, minm, maxm)
162161

163162
ω₀ = 1 + 2 / (13 * (mdeg^2))
164163
temp₁ = ω₀^2 - 1

0 commit comments

Comments
 (0)