Skip to content

Commit

Permalink
Merge pull request #207 from CliMA/ck/allow_specialize
Browse files Browse the repository at this point in the history
Allow for specializing on the algorithm name (type)
  • Loading branch information
charleskawczynski authored Sep 14, 2023
2 parents 289aeb8 + 914f95e commit a58fb82
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ClimaTimeSteppers"
uuid = "595c0a79-7f3d-439a-bc5a-b232dc3bde79"
authors = ["Climate Modeling Alliance"]
version = "0.7.8"
version = "0.7.9"

[deps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Expand Down
6 changes: 4 additions & 2 deletions src/solvers/imex_ark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ function init_cache(prob::DiffEqBase.AbstractODEProblem, alg::IMEXAlgorithm{Unco
return IMEXARKCache(U, T_lim, T_exp, T_imp, temp, γ, newtons_method_cache)
end

function step_u!(integrator, cache::IMEXARKCache)
step_u!(integrator, cache::IMEXARKCache) = step_u!(integrator, cache, integrator.alg.name)

function step_u!(integrator, cache::IMEXARKCache, name)
(; u, p, t, dt, sol, alg) = integrator
(; f) = sol.prob
(; T_lim!, T_exp!, T_imp!, lim!, dss!) = f
(; name, tableau, newtons_method) = alg
(; tableau, newtons_method) = alg
(; a_exp, b_exp, a_imp, b_imp, c_exp, c_imp) = tableau
(; U, T_lim, T_exp, T_imp, temp, γ, newtons_method_cache) = cache
s = length(b_exp)
Expand Down
6 changes: 4 additions & 2 deletions src/solvers/imex_ssprk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ function init_cache(prob::DiffEqBase.AbstractODEProblem, alg::IMEXAlgorithm{SSP}
return IMEXSSPRKCache(U, U_exp, U_lim, T_lim, T_exp, T_imp, temp, β, γ, newtons_method_cache)
end

function step_u!(integrator, cache::IMEXSSPRKCache)
step_u!(integrator, cache::IMEXSSPRKCache) = step_u!(integrator, cache, integrator.alg.name)

function step_u!(integrator, cache::IMEXSSPRKCache, name)
(; u, p, t, dt, sol, alg) = integrator
(; f) = sol.prob
(; T_lim!, T_exp!, T_imp!, lim!, dss!) = f
(; name, tableau, newtons_method) = alg
(; tableau, newtons_method) = alg
(; a_imp, b_imp, c_exp, c_imp) = tableau
(; U, U_lim, U_exp, T_lim, T_exp, T_imp, temp, β, γ, newtons_method_cache) = cache
s = length(b_imp)
Expand Down

2 comments on commit a58fb82

@charleskawczynski
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/91462

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.9 -m "<description of version>" a58fb82f2d9e68033107b1d960a10f870ff6af74
git push origin v0.7.9

Also, note the warning: Version 0.7.9 skips over 0.7.8
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

Please sign in to comment.