Skip to content

Commit ee23598

Browse files
ranochaJoshuaLampertgithub-actions[bot]
authored
remove restriction of DiffEqBase.jl (used as hotfix) (#2264)
* remove restriction of DiffEqBase.jl (used as hotfix) * ODE_DEFAULT_NORM moved * use ADTypes * fix another depwarn * bump DiffEqCallbacks * format * allow older version of ADTypes * Update test/Project.toml Co-authored-by: Joshua Lampert <[email protected]> * restrict to ADTypes v1 * bump ADTypes for NonlinearSolve.jl * fix compat bounds for Downgrade action * fix Aqua.jl issue * add DiffEqBase extension to fix callback issues with custom integrators * ignore several run folders * sort alphabetically * format * import fix * allow v3 of DiffEqCallbacks * require Static.jl v1 for DiffEqBase.jl v6.154 (required for new DiffEqCallbacks stuff) * require StaticArrayInterface 1.5.1 for Static.jl v1 * fix Aqua tests * fix test values * fix restart_file * require Octavian.jl v0.3.28 for Static.jl * require LoopVectorization.jl v0.12.171 for Static.jl * require StrideArrays.jl v0.1.29 for Static.jl * require Polyester.jl v0.7.15 for Static.jl * fix typo * require OrdinaryDiffEq.jl v6.88 for FastBroadcast.jl version required by Static.jl v1 * require Polyester.jl v0.7.16 for OrdinaryDiffEqPRK.jl * require MuladdMacro v0.2.4 for OrdinaryDiffEqPRK.jl * require Static.jl v1.1.1 for OrdinaryDiffEqHighOrderRK.jl * require ADTypes.jl v1.7.1 for OrdinaryDiffEqNonlinearSolve.jl * fix documentation about PERK methods * fix some more test values and tolerances * remove extras that are not required anymore since Julia v1.9 * make DiffEqBase a regular dep instead of a weakdep Trixi.jl depends on DiffEqBase.jl already via DiffEqCallbacks.jl. Making DiffEqBase.jl a regular dep instead of a weakdep fixes a cyclic dependency issue with extensions. * format Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * add NLsolve to docs/Project.toml --------- Co-authored-by: Joshua Lampert <[email protected]> Co-authored-by: Joshua Lampert <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent ce4f75d commit ee23598

21 files changed

+126
-105
lines changed

.github/workflows/Downgrade.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
- uses: julia-actions/cache@v2
7373
- uses: julia-actions/julia-downgrade-compat@v1
7474
with:
75-
skip: LinearAlgebra,Printf,SparseArrays,UUIDs,DiffEqBase,DelimitedFiles,Test,Downloads,Random
75+
skip: LinearAlgebra,Printf,SparseArrays,UUIDs,DelimitedFiles,Test,Downloads,Random
7676
projects: ., test
7777
- uses: julia-actions/julia-buildpkg@v1
7878
env:

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ coverage_report/
2828

2929
.DS_Store
3030

31-
run
32-
run/*
31+
run*/
32+
run*/*
3333

3434
LocalPreferences.toml

Project.toml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,54 +69,48 @@ ConstructionBase = "1.5"
6969
Convex = "0.16"
7070
DataStructures = "0.18.15"
7171
DelimitedFiles = "1"
72-
DiffEqBase = "6 - 6.143"
73-
DiffEqCallbacks = "2.35"
72+
DiffEqBase = "6.154"
73+
DiffEqCallbacks = "2.35, 3, 4"
7474
Downloads = "1.6"
7575
ECOS = "1.1.2"
7676
EllipsisNotation = "1.0"
7777
FillArrays = "1.9"
78-
ForwardDiff = "0.10.24"
78+
ForwardDiff = "0.10.36"
7979
HDF5 = "0.16.10, 0.17"
8080
LinearAlgebra = "1"
8181
LinearMaps = "2.7, 3.0"
82-
LoopVectorization = "0.12.151"
82+
LoopVectorization = "0.12.171"
8383
MPI = "0.20.6"
8484
Makie = "0.21, 0.22"
85-
MuladdMacro = "0.2.2"
85+
MuladdMacro = "0.2.4"
8686
NLsolve = "4.5.1"
87-
Octavian = "0.3.21"
87+
Octavian = "0.3.28"
8888
OffsetArrays = "1.13"
8989
P4est = "0.4.12"
90-
Polyester = "0.7.10"
90+
Polyester = "0.7.16"
9191
PrecompileTools = "1.2"
92-
Preferences = "1.3"
92+
Preferences = "1.4"
9393
Printf = "1"
9494
RecipesBase = "1.3.4"
9595
RecursiveArrayTools = "3.29"
96-
Reexport = "1.0"
96+
Reexport = "1.2"
9797
Requires = "1.1"
9898
SciMLBase = "2.67.0"
9999
SimpleUnPack = "1.1"
100100
SparseArrays = "1"
101101
StableRNGs = "1.0.2"
102102
StartUpDG = "1.1.5"
103-
Static = "0.8.7, 1"
104-
StaticArrayInterface = "1.4"
105-
StaticArrays = "1.7"
106-
StrideArrays = "0.1.26"
103+
Static = "1.1.1"
104+
StaticArrayInterface = "1.5.1"
105+
StaticArrays = "1.9"
106+
StrideArrays = "0.1.29"
107107
StructArrays = "0.6.18"
108108
SummationByPartsOperators = "0.5.52"
109109
T8code = "0.7.4"
110-
TimerOutputs = "0.5.7"
110+
TimerOutputs = "0.5.23"
111111
Triangulate = "2.2"
112112
TriplotBase = "0.1"
113113
TriplotRecipes = "0.1"
114114
TrixiBase = "0.1.3"
115115
UUIDs = "1.6"
116116
julia = "1.10"
117-
118-
[extras]
119-
Convex = "f65535da-76fb-5f13-bab9-19810c17039a"
120-
ECOS = "e2685f51-7e38-5353-a97d-a921fd2c8199"
121-
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
122-
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ HOHQMesh = "e4f4c7b8-17cb-445a-93c5-f69190ed6c8c"
99
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
1010
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
1111
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
12+
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
1213
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
1314
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1415
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
@@ -26,6 +27,7 @@ HOHQMesh = "0.1, 0.2"
2627
LaTeXStrings = "1.2"
2728
Literate = "2.9"
2829
Measurements = "2.5"
30+
NLsolve = "4.5.1"
2931
OrdinaryDiffEq = "6.49.1"
3032
Plots = "1.9"
3133
Test = "1"

docs/src/time_integration.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Some common options for `solve` from [OrdinaryDiffEq.jl](https://github.com/SciM
1313
are the following. Further documentation can be found in the
1414
[SciML docs](https://diffeq.sciml.ai/v6.8/basics/common_solver_opts/).
1515
- If you use a fixed time step method like `CarpenterKennedy2N54`, you need to pass
16-
a time step as `dt=...`. If you use a [`StepsizeCallback`](@ref), the value passed
16+
a time step as `dt=...`. If you use a [`StepsizeCallback`](@ref), the value passed
1717
as `dt=...` is irrelevant since it will be overwritten by the [`StepsizeCallback`](@ref).
1818
If you want to use an adaptive time step method such as `SSPRK43` or `RDPK3SpFSAL49`
1919
and still want to use CFL-based step size control via the [`StepsizeCallback`](@ref),
@@ -25,12 +25,12 @@ are the following. Further documentation can be found in the
2525
- SSP methods and many low-storage methods from OrdinaryDiffEq.jl support
2626
`stage_limiter!`s and `step_limiter!`s, e.g., [`PositivityPreservingLimiterZhangShu`](@ref) and [`EntropyBoundedLimiter`](@ref)
2727
from Trixi.jl.
28-
- If you start Julia with multiple threads and want to use them also in the time
28+
- If you start Julia with multiple threads and want to use them also in the time
2929
integration method from OrdinaryDiffEq.jl, you need to pass the keyword argument
30-
`thread=OrdinaryDiffEq.True()` to the algorithm, e.g.,
31-
`RDPK3SpFSAL49(thread=OrdinaryDiffEq.True())` or
30+
`thread=OrdinaryDiffEq.True()` to the algorithm, e.g.,
31+
`RDPK3SpFSAL49(thread=OrdinaryDiffEq.True())` or
3232
`CarpenterKennedy2N54(thread=OrdinaryDiffEq.True(), williamson_condition=false)`.
33-
For more information on using thread-based parallelism in Trixi.jl, please refer to
33+
For more information on using thread-based parallelism in Trixi.jl, please refer to
3434
[Shared-memory parallelization with threads](@ref).
3535
- If you use error-based step size control (see also the section on
3636
[error-based adaptive step sizes](@ref adaptive_step_sizes)) together with MPI, you need to
@@ -50,7 +50,7 @@ are the following. Further documentation can be found in the
5050
### Stabilized Explicit Runge-Kutta Methods
5151

5252
Optimized explicit schemes aim to maximize the timestep $\Delta t$ for a given simulation setup.
53-
Formally, this boils down to an optimization problem of the form
53+
Formally, this boils down to an optimization problem of the form
5454
```math
5555
\underset{P_{p;S} \, \in \, \mathcal{P}_{p;S}}{\max} \Delta t \text{ such that } \big \vert P_{p;S}(\Delta t \lambda_m) \big \vert \leq 1, \quad m = 1 , \dots , M \tag{1}
5656
```
@@ -79,12 +79,12 @@ Nevertheless, due to their optimized stability properties and low-storage nature
7979

8080
#### Tutorial: Using `PairedExplicitRK2`
8181

82-
In this tutorial, we will demonstrate how you can use the second-order PERK time integrator. You need the packages `Convex.jl` and `ECOS.jl`, so be sure they are added to your environment.
82+
In this tutorial, we will demonstrate how you can use the second-order PERK time integrator. You need the packages `Convex.jl`, `ECOS.jl`, and `NLsolve.jl`, so be sure they are added to your environment.
8383

8484
First, you need to load the necessary packages:
8585

8686
```@example PERK-example-1
87-
using Convex, ECOS
87+
using Convex, ECOS, NLsolve
8888
using OrdinaryDiffEq
8989
using Trixi
9090
```
@@ -96,7 +96,7 @@ Then, define the ODE problem and the semidiscretization setup. For this example,
9696
cells_per_dimension = 100
9797
coordinates_min = 0.0
9898
coordinates_max = 1.0
99-
mesh = StructuredMesh(cells_per_dimension,
99+
mesh = StructuredMesh(cells_per_dimension,
100100
coordinates_min, coordinates_max)
101101
102102
# Define the equation and initial condition
@@ -109,8 +109,8 @@ initial_condition = initial_condition_convergence_test
109109
solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs)
110110
111111
# Define the semidiscretization
112-
semi = SemidiscretizationHyperbolic(mesh,
113-
equations, initial_condition,
112+
semi = SemidiscretizationHyperbolic(mesh,
113+
equations, initial_condition,
114114
solver)
115115
```
116116

@@ -125,14 +125,14 @@ analysis_callback = AnalysisCallback(semi, interval = 200)
125125
stepsize_callback = StepsizeCallback(cfl = 2.5)
126126
127127
# Create a CallbackSet to collect all callbacks
128-
callbacks = CallbackSet(summary_callback,
129-
alive_callback,
130-
analysis_callback,
128+
callbacks = CallbackSet(summary_callback,
129+
alive_callback,
130+
analysis_callback,
131131
stepsize_callback)
132132
```
133133

134-
Now, we define the ODE problem by specifying the time span over which the ODE will be solved.
135-
The `tspan` parameter is a tuple `(t_start, t_end)` that defines the start and end times for the simulation.
134+
Now, we define the ODE problem by specifying the time span over which the ODE will be solved.
135+
The `tspan` parameter is a tuple `(t_start, t_end)` that defines the start and end times for the simulation.
136136
The `semidiscretize` function is used to create the ODE problem from the simulation setup.
137137

138138
```@example PERK-example-1
@@ -145,10 +145,10 @@ ode = semidiscretize(semi, tspan)
145145

146146
Next, we will construct the time integrator. In order to do this, you need the following components:
147147

148-
- Number of stages: The number of stages $S$ in the Runge-Kutta method.
148+
- Number of stages: The number of stages $S$ in the Runge-Kutta method.
149149
In this example, we use `6` stages.
150-
- Time span (`tspan`): A tuple `(t_start, t_end)` that defines the time span over which the ODE will be solved.
151-
This defines the bounds for the bisection routine for the optimal timestep $\Delta t$ used in calculating the polynomial coefficients at optimization stage.
150+
- Time span (`tspan`): A tuple `(t_start, t_end)` that defines the time span over which the ODE will be solved.
151+
This defines the bounds for the bisection routine for the optimal timestep $\Delta t$ used in calculating the polynomial coefficients at optimization stage.
152152
This variable is already defined in step 5.
153153
- Semidiscretization (`semi`): The semidiscretization setup that includes the mesh, equations, initial condition, and solver. In this example, this variable is already defined in step 3.
154154
In the background, we compute from `semi` the Jacobian $J$ evaluated at the initial condition using [`jacobian_ad_forward`](https://trixi-framework.github.io/Trixi.jl/stable/reference-trixi/#Trixi.jacobian_ad_forward-Tuple{Trixi.AbstractSemidiscretization}).
@@ -182,9 +182,9 @@ There are two additional constructors for the `PairedExplicitRK2` method besides
182182

183183
In the previous tutorial the CFL number was set manually to $2.5$.
184184
To avoid the manual trial-and-error process behind this, instantiations of `AbstractPairedExplicitRK` methods can automatically compute the stable CFL number for a given simulation setup using the [`Trixi.calculate_cfl`](@ref) function.
185-
When constructing the time integrator from a semidiscretization `semi`,
185+
When constructing the time integrator from a semidiscretization `semi`,
186186
```@example PERK-example-1
187-
# Construct third-order paired-explicit Runge-Kutta method with 8 stages for given simulation setup.
187+
# Construct third-order paired-explicit Runge-Kutta method with 8 stages for given simulation setup.
188188
ode_algorithm = Trixi.PairedExplicitRK3(8, tspan, semi)
189189
```
190190
the maximum timestep `dt` is stored by the `ode_algorithm`.

examples/tree_1d_dgsem/elixir_advection_diffusion.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using OrdinaryDiffEq
1+
using OrdinaryDiffEq, ADTypes
22
using Trixi
33

44
###############################################################################
@@ -87,7 +87,8 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, sav
8787
# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed callbacks
8888
time_int_tol = 1.0e-10
8989
time_abs_tol = 1.0e-10
90-
sol = solve(ode, KenCarp4(autodiff = false), abstol = time_abs_tol, reltol = time_int_tol,
90+
sol = solve(ode, KenCarp4(autodiff = AutoFiniteDiff()),
91+
abstol = time_abs_tol, reltol = time_int_tol,
9192
save_everystep = false, callback = callbacks)
9293

9394
# Print the timer summary

examples/tree_1d_dgsem/elixir_advection_diffusion_restart.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using OrdinaryDiffEq
1+
using OrdinaryDiffEq, ADTypes
22
using Trixi
33

44
###############################################################################
@@ -10,7 +10,7 @@ trixi_include(@__MODULE__, joinpath(@__DIR__, elixir_file))
1010
###############################################################################
1111
# initialize the ODE
1212

13-
restart_file = "restart_000000018.h5"
13+
restart_file = "restart_000000012.h5"
1414
restart_filename = joinpath("out", restart_file)
1515
tspan = (load_time(restart_filename), 2.0)
1616

@@ -22,7 +22,8 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)
2222
###############################################################################
2323
# run the simulation
2424

25-
sol = solve(ode, KenCarp4(autodiff = false), abstol = time_abs_tol, reltol = time_int_tol,
25+
sol = solve(ode, KenCarp4(autodiff = AutoFiniteDiff()),
26+
abstol = time_abs_tol, reltol = time_int_tol,
2627
save_everystep = false, callback = callbacks)
2728

2829
# Print the timer summary

examples/tree_3d_dgsem/elixir_lbm_taylor_green_vortex.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ callbacks = CallbackSet(summary_callback,
7373
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),
7474
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
7575
save_everystep = false, callback = callbacks,
76-
save_start = false, alias_u0 = true);
76+
save_start = false, alias = ODEAliasSpecifier(alias_u0 = true));
7777
summary_callback() # print the timer summary

src/Trixi.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ using DelimitedFiles: readdlm
4545
using Downloads: Downloads
4646
using CodeTracking: CodeTracking
4747
using ConstructionBase: ConstructionBase
48+
using DiffEqBase: DiffEqBase, get_tstops, get_tstops_array
4849
using DiffEqCallbacks: PeriodicCallback, PeriodicCallbackAffect
4950
@reexport using EllipsisNotation # ..
5051
using FillArrays: Ones, Zeros

src/time_integration/methods_2N.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ abstract type SimpleAlgorithm2N end
1414
The following structures and methods provide a minimal implementation of
1515
the low-storage explicit Runge-Kutta method of
1616
17-
- Carpenter, Kennedy (1994)
17+
- Carpenter, Kennedy (1994)
1818
Fourth-order 2N-storage Runge-Kutta schemes (Solution 3)
1919
URL: https://ntrs.nasa.gov/citations/19940028444
2020
File: https://ntrs.nasa.gov/api/citations/19940028444/downloads/19940028444.pdf
@@ -53,7 +53,7 @@ end
5353
The following structures and methods provide a minimal implementation of
5454
the low-storage explicit Runge-Kutta method of
5555
56-
- Carpenter, Kennedy (1994)
56+
- Carpenter, Kennedy (1994)
5757
Third-order 2N-storage Runge-Kutta schemes with error control
5858
URL: https://ntrs.nasa.gov/citations/19940028444
5959
File: https://ntrs.nasa.gov/api/citations/19940028444/downloads/19940028444.pdf
@@ -91,7 +91,7 @@ end
9191
# https://diffeq.sciml.ai/v6.8/basics/integrator/#Handing-Integrators-1
9292
# which are used in Trixi.jl.
9393
mutable struct SimpleIntegrator2N{RealT <: Real, uType, Params, Sol, F, Alg,
94-
SimpleIntegrator2NOptions}
94+
SimpleIntegrator2NOptions} <: AbstractTimeIntegrator
9595
u::uType #
9696
du::uType
9797
u_tmp::uType
@@ -232,7 +232,7 @@ function set_proposed_dt!(integrator::SimpleIntegrator2N, dt)
232232
integrator.dt = dt
233233
end
234234

235-
# Required e.g. for `glm_speed_callback`
235+
# Required e.g. for `glm_speed_callback`
236236
function get_proposed_dt(integrator::SimpleIntegrator2N)
237237
return integrator.dt
238238
end

0 commit comments

Comments
 (0)