Skip to content

Commit 703ed84

Browse files
Harsh SinghHarsh Singh
authored andcommitted
Add initial IMEX Runge-Kutta solvers (SSP and BHR schemes)
1 parent ed254c3 commit 703ed84

6 files changed

Lines changed: 1269 additions & 1 deletion

File tree

lib/OrdinaryDiffEqSDIRK/src/OrdinaryDiffEqSDIRK.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export ImplicitEuler, ImplicitMidpoint, Trapezoid, TRBDF2, SDIRK2, SDIRK22,
4343
Kvaerno5, KenCarp4, KenCarp47, KenCarp5, KenCarp58, ESDIRK54I8L2SA, SFSDIRK4,
4444
SFSDIRK5, CFNLIRK3, SFSDIRK6, SFSDIRK7, SFSDIRK8, Kvaerno5, KenCarp4, KenCarp5,
4545
SFSDIRK4, SFSDIRK5, CFNLIRK3, SFSDIRK6,
46-
SFSDIRK7, SFSDIRK8, ESDIRK436L2SA2, ESDIRK437L2SA, ESDIRK547L2SA2, ESDIRK659L2SA
46+
SFSDIRK7, SFSDIRK8, ESDIRK436L2SA2, ESDIRK437L2SA, ESDIRK547L2SA2, ESDIRK659L2SA,
47+
IMEXSSP222, IMEXSSP2322, IMEXSSP3332, IMEXSSP3433
4748

4849
import PrecompileTools
4950
import Preferences

lib/OrdinaryDiffEqSDIRK/src/alg_utils.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,12 @@ issplit(alg::KenCarp47) = true
5757
issplit(alg::KenCarp5) = true
5858
issplit(alg::KenCarp58) = true
5959
issplit(alg::CFNLIRK3) = true
60+
issplit(alg::IMEXSSP222) = true
61+
issplit(alg::IMEXSSP2322) = true
62+
issplit(alg::IMEXSSP3332) = true
63+
issplit(alg::IMEXSSP3433) = true
64+
65+
alg_order(alg::IMEXSSP222) = 2
66+
alg_order(alg::IMEXSSP2322) = 2
67+
alg_order(alg::IMEXSSP3332) = 2
68+
alg_order(alg::IMEXSSP3433) = 3

lib/OrdinaryDiffEqSDIRK/src/algorithms.jl

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,3 +1593,183 @@ function ESDIRK659L2SA(;
15931593
controller, AD_choice
15941594
)
15951595
end
1596+
1597+
@doc SDIRK_docstring(
1598+
"2-stage 2nd-order L-stable SSP IMEX-SDIRK method for split (implicit+explicit) ODEs. From Pareschi & Russo (2005), Table 2.",
1599+
"IMEXSSP222";
1600+
references = "@article{pareschi2005implicit,
1601+
title={Implicit-explicit Runge-Kutta schemes and applications to hyperbolic systems with relaxation},
1602+
author={Pareschi, Lorenzo and Russo, Giovanni},
1603+
journal={Journal of Scientific Computing},
1604+
volume={25},
1605+
number={1},
1606+
pages={129--155},
1607+
year={2005},
1608+
publisher={Springer}}",
1609+
extra_keyword_description = """
1610+
- `extrapolant`: TBD
1611+
- `step_limiter!`: function of the form `limiter!(u, integrator, p, t)`
1612+
""",
1613+
extra_keyword_default = """
1614+
extrapolant = :linear,
1615+
step_limiter! = trivial_limiter!,
1616+
"""
1617+
)
1618+
struct IMEXSSP222{CS, AD, F, F2, P, FDT, ST, CJ, StepLimiter} <:
1619+
OrdinaryDiffEqNewtonAlgorithm{CS, AD, FDT, ST, CJ}
1620+
linsolve::F
1621+
nlsolve::F2
1622+
precs::P
1623+
extrapolant::Symbol
1624+
step_limiter!::StepLimiter
1625+
autodiff::AD
1626+
end
1627+
function IMEXSSP222(;
1628+
chunk_size = Val{0}(), autodiff = AutoForwardDiff(),
1629+
standardtag = Val{true}(), concrete_jac = nothing,
1630+
diff_type = Val{:forward}(),
1631+
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
1632+
extrapolant = :linear, step_limiter! = trivial_limiter!
1633+
)
1634+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
1635+
return IMEXSSP222{
1636+
_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
1637+
typeof(nlsolve), typeof(precs), diff_type, _unwrap_val(standardtag),
1638+
_unwrap_val(concrete_jac), typeof(step_limiter!),
1639+
}(linsolve, nlsolve, precs, extrapolant, step_limiter!, AD_choice)
1640+
end
1641+
1642+
@doc SDIRK_docstring(
1643+
"3-stage 2nd-order stiffly-accurate SSP IMEX-SDIRK method for split ODEs. From Pareschi & Russo (2005), Table 3.",
1644+
"IMEXSSP2322";
1645+
references = "@article{pareschi2005implicit,
1646+
title={Implicit-explicit Runge-Kutta schemes and applications to hyperbolic systems with relaxation},
1647+
author={Pareschi, Lorenzo and Russo, Giovanni},
1648+
journal={Journal of Scientific Computing},
1649+
volume={25},
1650+
number={1},
1651+
pages={129--155},
1652+
year={2005},
1653+
publisher={Springer}}",
1654+
extra_keyword_description = """
1655+
- `extrapolant`: TBD
1656+
- `step_limiter!`: function of the form `limiter!(u, integrator, p, t)`
1657+
""",
1658+
extra_keyword_default = """
1659+
extrapolant = :linear,
1660+
step_limiter! = trivial_limiter!,
1661+
"""
1662+
)
1663+
struct IMEXSSP2322{CS, AD, F, F2, P, FDT, ST, CJ, StepLimiter} <:
1664+
OrdinaryDiffEqNewtonAlgorithm{CS, AD, FDT, ST, CJ}
1665+
linsolve::F
1666+
nlsolve::F2
1667+
precs::P
1668+
extrapolant::Symbol
1669+
step_limiter!::StepLimiter
1670+
autodiff::AD
1671+
end
1672+
function IMEXSSP2322(;
1673+
chunk_size = Val{0}(), autodiff = AutoForwardDiff(),
1674+
standardtag = Val{true}(), concrete_jac = nothing,
1675+
diff_type = Val{:forward}(),
1676+
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
1677+
extrapolant = :linear, step_limiter! = trivial_limiter!
1678+
)
1679+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
1680+
return IMEXSSP2322{
1681+
_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
1682+
typeof(nlsolve), typeof(precs), diff_type, _unwrap_val(standardtag),
1683+
_unwrap_val(concrete_jac), typeof(step_limiter!),
1684+
}(linsolve, nlsolve, precs, extrapolant, step_limiter!, AD_choice)
1685+
end
1686+
1687+
@doc SDIRK_docstring(
1688+
"3-stage 2nd-order L-stable SSP IMEX-SDIRK method (3rd order SSP explicit part) for split ODEs. From Pareschi & Russo (2005), Table 6.",
1689+
"IMEXSSP3332";
1690+
references = "@article{pareschi2005implicit,
1691+
title={Implicit-explicit Runge-Kutta schemes and applications to hyperbolic systems with relaxation},
1692+
author={Pareschi, Lorenzo and Russo, Giovanni},
1693+
journal={Journal of Scientific Computing},
1694+
volume={25},
1695+
number={1},
1696+
pages={129--155},
1697+
year={2005},
1698+
publisher={Springer}}",
1699+
extra_keyword_description = """
1700+
- `extrapolant`: TBD
1701+
- `step_limiter!`: function of the form `limiter!(u, integrator, p, t)`
1702+
""",
1703+
extra_keyword_default = """
1704+
extrapolant = :linear,
1705+
step_limiter! = trivial_limiter!,
1706+
"""
1707+
)
1708+
struct IMEXSSP3332{CS, AD, F, F2, P, FDT, ST, CJ, StepLimiter} <:
1709+
OrdinaryDiffEqNewtonAlgorithm{CS, AD, FDT, ST, CJ}
1710+
linsolve::F
1711+
nlsolve::F2
1712+
precs::P
1713+
extrapolant::Symbol
1714+
step_limiter!::StepLimiter
1715+
autodiff::AD
1716+
end
1717+
function IMEXSSP3332(;
1718+
chunk_size = Val{0}(), autodiff = AutoForwardDiff(),
1719+
standardtag = Val{true}(), concrete_jac = nothing,
1720+
diff_type = Val{:forward}(),
1721+
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
1722+
extrapolant = :linear, step_limiter! = trivial_limiter!
1723+
)
1724+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
1725+
return IMEXSSP3332{
1726+
_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
1727+
typeof(nlsolve), typeof(precs), diff_type, _unwrap_val(standardtag),
1728+
_unwrap_val(concrete_jac), typeof(step_limiter!),
1729+
}(linsolve, nlsolve, precs, extrapolant, step_limiter!, AD_choice)
1730+
end
1731+
1732+
@doc SDIRK_docstring(
1733+
"4-stage 3rd-order L-stable SSP IMEX-SDIRK method for split ODEs. From Pareschi & Russo (2005), Table 7.",
1734+
"IMEXSSP3433";
1735+
references = "@article{pareschi2005implicit,
1736+
title={Implicit-explicit Runge-Kutta schemes and applications to hyperbolic systems with relaxation},
1737+
author={Pareschi, Lorenzo and Russo, Giovanni},
1738+
journal={Journal of Scientific Computing},
1739+
volume={25},
1740+
number={1},
1741+
pages={129--155},
1742+
year={2005},
1743+
publisher={Springer}}",
1744+
extra_keyword_description = """
1745+
- `extrapolant`: TBD
1746+
- `step_limiter!`: function of the form `limiter!(u, integrator, p, t)`
1747+
""",
1748+
extra_keyword_default = """
1749+
extrapolant = :linear,
1750+
step_limiter! = trivial_limiter!,
1751+
"""
1752+
)
1753+
struct IMEXSSP3433{CS, AD, F, F2, P, FDT, ST, CJ, StepLimiter} <:
1754+
OrdinaryDiffEqNewtonAlgorithm{CS, AD, FDT, ST, CJ}
1755+
linsolve::F
1756+
nlsolve::F2
1757+
precs::P
1758+
extrapolant::Symbol
1759+
step_limiter!::StepLimiter
1760+
autodiff::AD
1761+
end
1762+
function IMEXSSP3433(;
1763+
chunk_size = Val{0}(), autodiff = AutoForwardDiff(),
1764+
standardtag = Val{true}(), concrete_jac = nothing,
1765+
diff_type = Val{:forward}(),
1766+
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
1767+
extrapolant = :linear, step_limiter! = trivial_limiter!
1768+
)
1769+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
1770+
return IMEXSSP3433{
1771+
_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
1772+
typeof(nlsolve), typeof(precs), diff_type, _unwrap_val(standardtag),
1773+
_unwrap_val(concrete_jac), typeof(step_limiter!),
1774+
}(linsolve, nlsolve, precs, extrapolant, step_limiter!, AD_choice)
1775+
end

0 commit comments

Comments
 (0)