Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ITime in IMEXAlgorithms and SSPKnoth #360

Merged
merged 2 commits into from
Feb 4, 2025
Merged

Conversation

ph-kev
Copy link
Member

@ph-kev ph-kev commented Jan 31, 2025

This PR adds support for ITime in ARS343 and SSPKnoth. This PR should be merged in after PR#347.

See this issue in ClimaUtilities for the remaining PRs to merge for ITime.

@ph-kev ph-kev force-pushed the kp/itime branch 6 times, most recently from 369265c to 7c39ce3 Compare February 3, 2025 18:37
SciMLBase.allows_arbitrary_number_types(alg::T)
where {T <: ClimaTimeSteppers.IMEXAlgorithm}

Return `true`. Enable ARS343 to run with `ClimaUtilities.ITime`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Return `true`. Enable ARS343 to run with `ClimaUtilities.ITime`.
Return `true`. Enable IMEXAlgorithms to run with `ClimaUtilities.ITime`.

function tstops_and_saveat_heaps(t0, tf, tstops, saveat)
FT = typeof(tf)
function tstops_and_saveat_heaps(t0, tf, tstops, saveat = [])
FT = typeof(first(promote(t0, tf)))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
FT = typeof(first(promote(t0, tf)))
# We promote to a common type to ensure that t0 and tf have the same type
FT = typeof(first(promote(t0, tf)))


dt > zero(dt) || error("dt must be positive")
dt > zero(oneunit(dt)) || error("dt must be positive")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
dt > zero(oneunit(dt)) || error("dt must be positive")
# We need zero(oneunit()) because there's no zerounit
dt > zero(oneunit(dt)) || error("dt must be positive")

@@ -135,6 +135,10 @@ end
T_imp!(residual, U′, p, t_imp)
@. residual = temp + dtγ * residual - U′
end
implicit_equation_jacobian! = (jacobian, Ui) -> begin
Copy link
Member

Choose a reason for hiding this comment

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

Is this block of code maybe result of a missing/incomplete rebase?

@ph-kev ph-kev force-pushed the kp/itime branch 3 times, most recently from 38a52a2 to 53b2e81 Compare February 3, 2025 21:45
@ph-kev ph-kev requested a review from Sbozzolo February 3, 2025 22:23
@Sbozzolo Sbozzolo changed the title Add support for ITime in ARS343 and SSPKnoth Add support for ITime in IMEXAlgorithms and SSPKnoth Feb 3, 2025
NEWS.md Outdated
@@ -7,6 +7,7 @@ v0.8.2
- ![][badge-💥breaking] If saveat is a number, then it does not automatically expand to `tspan[1]:saveat:tspan[2]`. To fix this, update
`saveat`, which is a keyword in the integrator, to be an array. For example, if `saveat` is a scalar, replace it with
`[tspan[1]:saveat:tspan[2]..., tspan[2]]` to achieve the same behavior as before.
- ARS343 and SSPKnoth are compatible with ITime. See ClimaUtilities for more information about ITime.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- ARS343 and SSPKnoth are compatible with ITime. See ClimaUtilities for more information about ITime.
- IMEXAlgorithms and SSPKnoth are compatible with ITime. See ClimaUtilities for more information about ITime.

@ph-kev ph-kev force-pushed the kp/itime branch 3 times, most recently from c8a2f8d to a959b8a Compare February 3, 2025 22:41
@ph-kev ph-kev requested a review from Sbozzolo February 3, 2025 22:41
@ph-kev ph-kev enabled auto-merge February 4, 2025 00:40
@ph-kev ph-kev merged commit ae9a03a into main Feb 4, 2025
9 checks passed
@ph-kev ph-kev deleted the kp/itime branch February 4, 2025 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants