diff --git a/.github/workflows/Downgrade.yml b/.github/workflows/Downgrade.yml index 78492151a67..85f4625d275 100644 --- a/.github/workflows/Downgrade.yml +++ b/.github/workflows/Downgrade.yml @@ -72,7 +72,7 @@ jobs: - uses: julia-actions/cache@v2 - uses: julia-actions/julia-downgrade-compat@v1 with: - skip: LinearAlgebra,Printf,SparseArrays,UUIDs,DiffEqBase,DelimitedFiles,Test,Downloads,Random + skip: LinearAlgebra,Printf,SparseArrays,UUIDs,DelimitedFiles,Test,Downloads,Random projects: ., test - uses: julia-actions/julia-buildpkg@v1 env: diff --git a/.gitignore b/.gitignore index b4f1cf6bb47..4c4206151e1 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,7 @@ coverage_report/ .DS_Store -run -run/* +run*/ +run*/* LocalPreferences.toml diff --git a/Project.toml b/Project.toml index 95d3c42d395..4690cdd6908 100644 --- a/Project.toml +++ b/Project.toml @@ -69,54 +69,48 @@ ConstructionBase = "1.5" Convex = "0.16" DataStructures = "0.18.15" DelimitedFiles = "1" -DiffEqBase = "6 - 6.143" -DiffEqCallbacks = "2.35" +DiffEqBase = "6.154" +DiffEqCallbacks = "2.35, 3, 4" Downloads = "1.6" ECOS = "1.1.2" EllipsisNotation = "1.0" FillArrays = "1.9" -ForwardDiff = "0.10.24" +ForwardDiff = "0.10.36" HDF5 = "0.16.10, 0.17" LinearAlgebra = "1" LinearMaps = "2.7, 3.0" -LoopVectorization = "0.12.151" +LoopVectorization = "0.12.171" MPI = "0.20.6" Makie = "0.21, 0.22" -MuladdMacro = "0.2.2" +MuladdMacro = "0.2.4" NLsolve = "4.5.1" -Octavian = "0.3.21" +Octavian = "0.3.28" OffsetArrays = "1.13" P4est = "0.4.12" -Polyester = "0.7.10" +Polyester = "0.7.16" PrecompileTools = "1.2" -Preferences = "1.3" +Preferences = "1.4" Printf = "1" RecipesBase = "1.3.4" RecursiveArrayTools = "3.29" -Reexport = "1.0" +Reexport = "1.2" Requires = "1.1" SciMLBase = "2.67.0" SimpleUnPack = "1.1" SparseArrays = "1" StableRNGs = "1.0.2" StartUpDG = "1.1.5" -Static = "0.8.7, 1" -StaticArrayInterface = "1.4" -StaticArrays = "1.7" -StrideArrays = "0.1.26" +Static = "1.1.1" +StaticArrayInterface = "1.5.1" +StaticArrays = "1.9" +StrideArrays = "0.1.29" StructArrays = "0.6.18" SummationByPartsOperators = "0.5.52" T8code = "0.7.4" -TimerOutputs = "0.5.7" +TimerOutputs = "0.5.23" Triangulate = "2.2" TriplotBase = "0.1" TriplotRecipes = "0.1" TrixiBase = "0.1.3" UUIDs = "1.6" julia = "1.10" - -[extras] -Convex = "f65535da-76fb-5f13-bab9-19810c17039a" -ECOS = "e2685f51-7e38-5353-a97d-a921fd2c8199" -Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" -NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" diff --git a/docs/Project.toml b/docs/Project.toml index 5d63e239e0b..01bde4897e8 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -9,6 +9,7 @@ HOHQMesh = "e4f4c7b8-17cb-445a-93c5-f69190ed6c8c" LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306" Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" +NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" @@ -26,6 +27,7 @@ HOHQMesh = "0.1, 0.2" LaTeXStrings = "1.2" Literate = "2.9" Measurements = "2.5" +NLsolve = "4.5.1" OrdinaryDiffEq = "6.49.1" Plots = "1.9" Test = "1" diff --git a/docs/src/time_integration.md b/docs/src/time_integration.md index 3cdb7fa75ae..504db03b3c3 100644 --- a/docs/src/time_integration.md +++ b/docs/src/time_integration.md @@ -13,7 +13,7 @@ Some common options for `solve` from [OrdinaryDiffEq.jl](https://github.com/SciM are the following. Further documentation can be found in the [SciML docs](https://diffeq.sciml.ai/v6.8/basics/common_solver_opts/). - If you use a fixed time step method like `CarpenterKennedy2N54`, you need to pass - a time step as `dt=...`. If you use a [`StepsizeCallback`](@ref), the value passed + a time step as `dt=...`. If you use a [`StepsizeCallback`](@ref), the value passed as `dt=...` is irrelevant since it will be overwritten by the [`StepsizeCallback`](@ref). If you want to use an adaptive time step method such as `SSPRK43` or `RDPK3SpFSAL49` 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 - SSP methods and many low-storage methods from OrdinaryDiffEq.jl support `stage_limiter!`s and `step_limiter!`s, e.g., [`PositivityPreservingLimiterZhangShu`](@ref) and [`EntropyBoundedLimiter`](@ref) from Trixi.jl. -- If you start Julia with multiple threads and want to use them also in the time +- If you start Julia with multiple threads and want to use them also in the time integration method from OrdinaryDiffEq.jl, you need to pass the keyword argument - `thread=OrdinaryDiffEq.True()` to the algorithm, e.g., - `RDPK3SpFSAL49(thread=OrdinaryDiffEq.True())` or + `thread=OrdinaryDiffEq.True()` to the algorithm, e.g., + `RDPK3SpFSAL49(thread=OrdinaryDiffEq.True())` or `CarpenterKennedy2N54(thread=OrdinaryDiffEq.True(), williamson_condition=false)`. - For more information on using thread-based parallelism in Trixi.jl, please refer to + For more information on using thread-based parallelism in Trixi.jl, please refer to [Shared-memory parallelization with threads](@ref). - If you use error-based step size control (see also the section on [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 ### Stabilized Explicit Runge-Kutta Methods Optimized explicit schemes aim to maximize the timestep $\Delta t$ for a given simulation setup. -Formally, this boils down to an optimization problem of the form +Formally, this boils down to an optimization problem of the form ```math \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} ``` @@ -79,12 +79,12 @@ Nevertheless, due to their optimized stability properties and low-storage nature #### Tutorial: Using `PairedExplicitRK2` -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. +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. First, you need to load the necessary packages: ```@example PERK-example-1 -using Convex, ECOS +using Convex, ECOS, NLsolve using OrdinaryDiffEq using Trixi ``` @@ -96,7 +96,7 @@ Then, define the ODE problem and the semidiscretization setup. For this example, cells_per_dimension = 100 coordinates_min = 0.0 coordinates_max = 1.0 -mesh = StructuredMesh(cells_per_dimension, +mesh = StructuredMesh(cells_per_dimension, coordinates_min, coordinates_max) # Define the equation and initial condition @@ -109,8 +109,8 @@ initial_condition = initial_condition_convergence_test solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs) # Define the semidiscretization -semi = SemidiscretizationHyperbolic(mesh, - equations, initial_condition, +semi = SemidiscretizationHyperbolic(mesh, + equations, initial_condition, solver) ``` @@ -125,14 +125,14 @@ analysis_callback = AnalysisCallback(semi, interval = 200) stepsize_callback = StepsizeCallback(cfl = 2.5) # Create a CallbackSet to collect all callbacks -callbacks = CallbackSet(summary_callback, - alive_callback, - analysis_callback, +callbacks = CallbackSet(summary_callback, + alive_callback, + analysis_callback, stepsize_callback) ``` -Now, we define the ODE problem by specifying the time span over which the ODE will be solved. -The `tspan` parameter is a tuple `(t_start, t_end)` that defines the start and end times for the simulation. +Now, we define the ODE problem by specifying the time span over which the ODE will be solved. +The `tspan` parameter is a tuple `(t_start, t_end)` that defines the start and end times for the simulation. The `semidiscretize` function is used to create the ODE problem from the simulation setup. ```@example PERK-example-1 @@ -145,10 +145,10 @@ ode = semidiscretize(semi, tspan) Next, we will construct the time integrator. In order to do this, you need the following components: - - Number of stages: The number of stages $S$ in the Runge-Kutta method. + - Number of stages: The number of stages $S$ in the Runge-Kutta method. In this example, we use `6` stages. - - Time span (`tspan`): A tuple `(t_start, t_end)` that defines the time span over which the ODE will be solved. - This defines the bounds for the bisection routine for the optimal timestep $\Delta t$ used in calculating the polynomial coefficients at optimization stage. + - Time span (`tspan`): A tuple `(t_start, t_end)` that defines the time span over which the ODE will be solved. + This defines the bounds for the bisection routine for the optimal timestep $\Delta t$ used in calculating the polynomial coefficients at optimization stage. This variable is already defined in step 5. - 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. 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 In the previous tutorial the CFL number was set manually to $2.5$. 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. -When constructing the time integrator from a semidiscretization `semi`, +When constructing the time integrator from a semidiscretization `semi`, ```@example PERK-example-1 -# Construct third-order paired-explicit Runge-Kutta method with 8 stages for given simulation setup. +# Construct third-order paired-explicit Runge-Kutta method with 8 stages for given simulation setup. ode_algorithm = Trixi.PairedExplicitRK3(8, tspan, semi) ``` the maximum timestep `dt` is stored by the `ode_algorithm`. diff --git a/examples/tree_1d_dgsem/elixir_advection_diffusion.jl b/examples/tree_1d_dgsem/elixir_advection_diffusion.jl index 94d1da9132b..95e94ca21f1 100644 --- a/examples/tree_1d_dgsem/elixir_advection_diffusion.jl +++ b/examples/tree_1d_dgsem/elixir_advection_diffusion.jl @@ -1,4 +1,4 @@ -using OrdinaryDiffEq +using OrdinaryDiffEq, ADTypes using Trixi ############################################################################### @@ -87,7 +87,8 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, sav # OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed callbacks time_int_tol = 1.0e-10 time_abs_tol = 1.0e-10 -sol = solve(ode, KenCarp4(autodiff = false), abstol = time_abs_tol, reltol = time_int_tol, +sol = solve(ode, KenCarp4(autodiff = AutoFiniteDiff()), + abstol = time_abs_tol, reltol = time_int_tol, save_everystep = false, callback = callbacks) # Print the timer summary diff --git a/examples/tree_1d_dgsem/elixir_advection_diffusion_restart.jl b/examples/tree_1d_dgsem/elixir_advection_diffusion_restart.jl index 1aab3308fab..a4c495e7f28 100644 --- a/examples/tree_1d_dgsem/elixir_advection_diffusion_restart.jl +++ b/examples/tree_1d_dgsem/elixir_advection_diffusion_restart.jl @@ -1,4 +1,4 @@ -using OrdinaryDiffEq +using OrdinaryDiffEq, ADTypes using Trixi ############################################################################### @@ -10,7 +10,7 @@ trixi_include(@__MODULE__, joinpath(@__DIR__, elixir_file)) ############################################################################### # initialize the ODE -restart_file = "restart_000000018.h5" +restart_file = "restart_000000012.h5" restart_filename = joinpath("out", restart_file) tspan = (load_time(restart_filename), 2.0) @@ -22,7 +22,8 @@ callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback) ############################################################################### # run the simulation -sol = solve(ode, KenCarp4(autodiff = false), abstol = time_abs_tol, reltol = time_int_tol, +sol = solve(ode, KenCarp4(autodiff = AutoFiniteDiff()), + abstol = time_abs_tol, reltol = time_int_tol, save_everystep = false, callback = callbacks) # Print the timer summary diff --git a/examples/tree_3d_dgsem/elixir_lbm_taylor_green_vortex.jl b/examples/tree_3d_dgsem/elixir_lbm_taylor_green_vortex.jl index df034af1bc9..56d2bc01491 100644 --- a/examples/tree_3d_dgsem/elixir_lbm_taylor_green_vortex.jl +++ b/examples/tree_3d_dgsem/elixir_lbm_taylor_green_vortex.jl @@ -73,5 +73,5 @@ callbacks = CallbackSet(summary_callback, sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false), dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback save_everystep = false, callback = callbacks, - save_start = false, alias_u0 = true); + save_start = false, alias = ODEAliasSpecifier(alias_u0 = true)); summary_callback() # print the timer summary diff --git a/src/Trixi.jl b/src/Trixi.jl index ffe759d0750..162954ef515 100644 --- a/src/Trixi.jl +++ b/src/Trixi.jl @@ -45,6 +45,7 @@ using DelimitedFiles: readdlm using Downloads: Downloads using CodeTracking: CodeTracking using ConstructionBase: ConstructionBase +using DiffEqBase: DiffEqBase, get_tstops, get_tstops_array using DiffEqCallbacks: PeriodicCallback, PeriodicCallbackAffect @reexport using EllipsisNotation # .. using FillArrays: Ones, Zeros diff --git a/src/time_integration/methods_2N.jl b/src/time_integration/methods_2N.jl index 71343b246fa..514b0bcfb99 100644 --- a/src/time_integration/methods_2N.jl +++ b/src/time_integration/methods_2N.jl @@ -14,7 +14,7 @@ abstract type SimpleAlgorithm2N end The following structures and methods provide a minimal implementation of the low-storage explicit Runge-Kutta method of -- Carpenter, Kennedy (1994) +- Carpenter, Kennedy (1994) Fourth-order 2N-storage Runge-Kutta schemes (Solution 3) URL: https://ntrs.nasa.gov/citations/19940028444 File: https://ntrs.nasa.gov/api/citations/19940028444/downloads/19940028444.pdf @@ -53,7 +53,7 @@ end The following structures and methods provide a minimal implementation of the low-storage explicit Runge-Kutta method of -- Carpenter, Kennedy (1994) +- Carpenter, Kennedy (1994) Third-order 2N-storage Runge-Kutta schemes with error control URL: https://ntrs.nasa.gov/citations/19940028444 File: https://ntrs.nasa.gov/api/citations/19940028444/downloads/19940028444.pdf @@ -91,7 +91,7 @@ end # https://diffeq.sciml.ai/v6.8/basics/integrator/#Handing-Integrators-1 # which are used in Trixi.jl. mutable struct SimpleIntegrator2N{RealT <: Real, uType, Params, Sol, F, Alg, - SimpleIntegrator2NOptions} + SimpleIntegrator2NOptions} <: AbstractTimeIntegrator u::uType # du::uType u_tmp::uType @@ -232,7 +232,7 @@ function set_proposed_dt!(integrator::SimpleIntegrator2N, dt) integrator.dt = dt end -# Required e.g. for `glm_speed_callback` +# Required e.g. for `glm_speed_callback` function get_proposed_dt(integrator::SimpleIntegrator2N) return integrator.dt end diff --git a/src/time_integration/methods_3Sstar.jl b/src/time_integration/methods_3Sstar.jl index 51501c6189e..30889d2aa17 100644 --- a/src/time_integration/methods_3Sstar.jl +++ b/src/time_integration/methods_3Sstar.jl @@ -145,7 +145,8 @@ function SimpleIntegrator3SstarOptions(callback, tspan; maxiters = typemax(Int), end mutable struct SimpleIntegrator3Sstar{RealT <: Real, uType, Params, Sol, F, Alg, - SimpleIntegrator3SstarOptions} + SimpleIntegrator3SstarOptions} <: + AbstractTimeIntegrator u::uType # du::uType u_tmp1::uType @@ -298,7 +299,7 @@ function set_proposed_dt!(integrator::SimpleIntegrator3Sstar, dt) integrator.dt = dt end -# Required e.g. for `glm_speed_callback` +# Required e.g. for `glm_speed_callback` function get_proposed_dt(integrator::SimpleIntegrator3Sstar) return integrator.dt end diff --git a/src/time_integration/methods_SSP.jl b/src/time_integration/methods_SSP.jl index 33d1f164138..ee01ae58589 100644 --- a/src/time_integration/methods_SSP.jl +++ b/src/time_integration/methods_SSP.jl @@ -78,7 +78,7 @@ end # https://diffeq.sciml.ai/v6.8/basics/integrator/#Handing-Integrators-1 # which are used in Trixi. mutable struct SimpleIntegratorSSP{RealT <: Real, uType, Params, Sol, F, Alg, - SimpleIntegratorSSPOptions} + SimpleIntegratorSSPOptions} <: AbstractTimeIntegrator u::uType du::uType r0::uType diff --git a/src/time_integration/paired_explicit_runge_kutta/paired_explicit_runge_kutta.jl b/src/time_integration/paired_explicit_runge_kutta/paired_explicit_runge_kutta.jl index 87f067fc39d..ddf6827c010 100644 --- a/src/time_integration/paired_explicit_runge_kutta/paired_explicit_runge_kutta.jl +++ b/src/time_integration/paired_explicit_runge_kutta/paired_explicit_runge_kutta.jl @@ -8,7 +8,7 @@ # Define all of the functions necessary for polynomial optimizations include("polynomial_optimizer.jl") -# Abstract base type for both single/standalone and multi-level +# Abstract base type for both single/standalone and multi-level # PERK (Paired-Explicit Runge-Kutta) time integration schemes abstract type AbstractPairedExplicitRK end # Abstract base type for single/standalone PERK time integration schemes @@ -36,7 +36,7 @@ function PairedExplicitRKOptions(callback, tspan; maxiters = typemax(Int), kwarg tstops_internal) end -abstract type AbstractPairedExplicitRKIntegrator end +abstract type AbstractPairedExplicitRKIntegrator <: AbstractTimeIntegrator end abstract type AbstractPairedExplicitRKSingleIntegrator <: AbstractPairedExplicitRKIntegrator end @@ -176,7 +176,7 @@ end """ modify_dt_for_tstops!(integrator::PairedExplicitRK) - + Modify the time-step size to match the time stops specified in integrator.opts.tstops. To avoid adding OrdinaryDiffEq to Trixi's dependencies, this routine is a copy of https://github.com/SciML/OrdinaryDiffEq.jl/blob/d76335281c540ee5a6d1bd8bb634713e004f62ee/src/integrators/integrator_utils.jl#L38-L54 diff --git a/src/time_integration/time_integration.jl b/src/time_integration/time_integration.jl index d19a1fcc37c..609526da5aa 100644 --- a/src/time_integration/time_integration.jl +++ b/src/time_integration/time_integration.jl @@ -13,6 +13,20 @@ struct TimeIntegratorSolution{tType, uType, P} prob::P end +# Abstract supertype of Trixi.jl's own time integrators for dispatch +abstract type AbstractTimeIntegrator end + +# Interface required by DiffEqCallbacks.jl +function DiffEqBase.get_tstops(integrator::AbstractTimeIntegrator) + return integrator.opts.tstops +end +function DiffEqBase.get_tstops_array(integrator::AbstractTimeIntegrator) + return get_tstops(integrator).valtree +end +function DiffEqBase.get_tstops_max(integrator::AbstractTimeIntegrator) + return maximum(get_tstops_array(integrator)) +end + include("methods_2N.jl") include("methods_3Sstar.jl") include("methods_SSP.jl") diff --git a/test/Project.toml b/test/Project.toml index fb7eeb1a80c..1612dde3d26 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,4 +1,5 @@ [deps] +ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" Convex = "f65535da-76fb-5f13-bab9-19810c17039a" @@ -21,6 +22,7 @@ StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] +ADTypes = "1.7.1" Aqua = "0.8" CairoMakie = "0.12, 0.13" Convex = "0.16" @@ -30,12 +32,12 @@ Downloads = "1" ECOS = "1.1.2" ExplicitImports = "1.0.1" FFMPEG = "0.4" -ForwardDiff = "0.10.24" +ForwardDiff = "0.10.36" LinearAlgebra = "1" MPI = "0.20.6" NLsolve = "4.5.1" -OrdinaryDiffEq = "6.66" -Plots = "1.19" +OrdinaryDiffEq = "6.88" +Plots = "1.26" Printf = "1" Quadmath = "0.5.10" Random = "1" diff --git a/test/test_aqua.jl b/test/test_aqua.jl index 04c4a533d26..9b3f2d67903 100644 --- a/test/test_aqua.jl +++ b/test/test_aqua.jl @@ -13,7 +13,9 @@ include("test_trixi.jl") # exceptions necessary for adding a new method `StartUpDG.estimate_h` # in src/solvers/dgmulti/sbp.jl piracies = (treat_as_own = [Trixi.StartUpDG.RefElemData, - Trixi.StartUpDG.MeshData],)) + Trixi.StartUpDG.MeshData],), + # exception necessary because StableRNGs.jl is only used in an extension + stale_deps = (ignore = [:StableRNGs],)) @test isnothing(check_no_implicit_imports(Trixi, skip = (Core, Base, Trixi.P4est, Trixi.T8code, Trixi.EllipsisNotation))) diff --git a/test/test_mpi.jl b/test/test_mpi.jl index 001d9bff86e..66c5281089a 100644 --- a/test/test_mpi.jl +++ b/test/test_mpi.jl @@ -34,13 +34,13 @@ end # MPI t = 0.5 let u = 1.0 - @test ode_norm(u, t) ≈ OrdinaryDiffEq.ODE_DEFAULT_NORM(u, t) + @test ode_norm(u, t) ≈ OrdinaryDiffEq.DiffEqBase.ODE_DEFAULT_NORM(u, t) end let u = [1.0, -2.0] - @test ode_norm(u, t) ≈ OrdinaryDiffEq.ODE_DEFAULT_NORM(u, t) + @test ode_norm(u, t) ≈ OrdinaryDiffEq.DiffEqBase.ODE_DEFAULT_NORM(u, t) end let u = [SVector(1.0, -2.0), SVector(0.5, -0.1)] - @test ode_norm(u, t) ≈ OrdinaryDiffEq.ODE_DEFAULT_NORM(u, t) + @test ode_norm(u, t) ≈ OrdinaryDiffEq.DiffEqBase.ODE_DEFAULT_NORM(u, t) end end # MPI supporting functionality diff --git a/test/test_parabolic_1d.jl b/test/test_parabolic_1d.jl index 49cf359c51d..ee645819fc0 100644 --- a/test/test_parabolic_1d.jl +++ b/test/test_parabolic_1d.jl @@ -16,8 +16,8 @@ isdir(outdir) && rm(outdir, recursive = true) @test_trixi_include(joinpath(examples_dir(), "tree_1d_dgsem", "elixir_advection_diffusion.jl"), initial_refinement_level=4, tspan=(0.0, 0.4), polydeg=3, - l2=[8.389498188525518e-06], - linf=[2.847421658558336e-05]) + l2=[8.40483031802723e-6], + linf=[2.8990878868540015e-5]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -31,8 +31,8 @@ end @trixi_testset "TreeMesh1D: elixir_advection_diffusion_restart.jl" begin @test_trixi_include(joinpath(examples_dir(), "tree_1d_dgsem", "elixir_advection_diffusion_restart.jl"), - l2=[1.0671615777620987e-5], - linf=[3.861509422325993e-5]) + l2=[1.0679933947301556e-5], + linf=[3.910500545667439e-5]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -60,12 +60,12 @@ end # Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, amr_callback) - sol = solve(ode, KenCarp4(autodiff = false), abstol = time_abs_tol, - reltol = time_int_tol, + sol = solve(ode, KenCarp4(autodiff = AutoFiniteDiff()), + abstol = time_abs_tol, reltol = time_int_tol, save_everystep = false, callback = callbacks) l2_error, linf_error = analysis_callback(sol) - @test l2_error ≈ [6.4878111416468355e-6] - @test linf_error ≈ [3.258075790424364e-5] + @test l2_error ≈ [6.487940740394583e-6] + @test linf_error ≈ [3.262867898701227e-5] # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let diff --git a/test/test_tree_1d_fdsbp.jl b/test/test_tree_1d_fdsbp.jl index 71e77eeb389..5034ab2ca4a 100644 --- a/test/test_tree_1d_fdsbp.jl +++ b/test/test_tree_1d_fdsbp.jl @@ -116,14 +116,14 @@ end @trixi_testset "elixir_euler_convergence.jl with splitting_vanleer_haenel" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_convergence.jl"), l2=[ - 3.413790589105506e-6, - 4.243957977156001e-6, - 8.667369423676437e-6 + 3.4137906030996366e-6, + 4.24395804622208e-6, + 8.667369559486434e-6 ], linf=[ - 1.4228079689537765e-5, - 1.3249887941046978e-5, - 3.201552933251861e-5 + 1.4228079725286946e-5, + 1.324988815953887e-5, + 3.20155297650615e-5 ], tspan=(0.0, 0.5), flux_splitting=splitting_vanleer_haenel) @@ -141,14 +141,14 @@ end @trixi_testset "elixir_euler_convergence.jl with VolumeIntegralStrongForm" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_convergence.jl"), l2=[ - 8.6126767518378e-6, - 7.670897071480729e-6, - 1.4972772284191368e-5 + 8.612676636826464e-6, + 7.670896994006107e-6, + 1.4972772137651304e-5 ], linf=[ - 6.707982777909294e-5, - 3.487256699541419e-5, - 0.00010170331350556339 + 6.707982749043495e-5, + 3.48725672254524e-5, + 0.00010170331503767116 ], tspan=(0.0, 0.5), solver=DG(D_upw.central, nothing, SurfaceIntegralStrongForm(), diff --git a/test/test_tree_1d_hypdiff.jl b/test/test_tree_1d_hypdiff.jl index cd570c16708..2f253d30615 100644 --- a/test/test_tree_1d_hypdiff.jl +++ b/test/test_tree_1d_hypdiff.jl @@ -12,9 +12,8 @@ EXAMPLES_DIR = pkgdir(Trixi, "examples", "tree_1d_dgsem") @trixi_testset "elixir_hypdiff_nonperiodic.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hypdiff_nonperiodic.jl"), - l2=[1.3655114954641076e-7, 1.0200345025539218e-6], - linf=[7.173286515893551e-7, 4.507116363683394e-6], - atol=2.5e-13) + l2=[1.3655114953278825e-7, 1.0200345026471077e-6], + linf=[7.173285075379177e-7, 4.507116828644797e-6]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -37,8 +36,8 @@ end t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) - # Larger values for allowed allocations due to usage of custom - # integrator which are not *recorded* for the methods from + # Larger values for allowed allocations due to usage of custom + # integrator which are not *recorded* for the methods from # OrdinaryDiffEq.jl # Corresponding issue: https://github.com/trixi-framework/Trixi.jl/issues/1877 @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 10000 diff --git a/test/test_unstructured_2d.jl b/test/test_unstructured_2d.jl index cec7152f4fc..259eb39c545 100644 --- a/test/test_unstructured_2d.jl +++ b/test/test_unstructured_2d.jl @@ -17,12 +17,12 @@ isdir(outdir) && rm(outdir, recursive = true) @trixi_testset "elixir_euler_periodic.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_periodic.jl"), l2=[ - 0.0001099216141882387, 0.0001303795774982892, - 0.00013037957749794242, 0.0002993727892598759 + 0.00010992161458946449, 0.00013037957831794187, + 0.0001303795783182231, 0.00029937279106433015 ], linf=[ - 0.006407280810928562, 0.009836067015418948, - 0.009836067015398076, 0.021903519038095176 + 0.006407280909098478, 0.009836067162309448, + 0.009836067162292128, 0.021903519372712843 ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) @@ -692,17 +692,21 @@ end @trixi_testset "FDSBP (upwind): elixir_euler_source_terms_upwind.jl with LF splitting" begin @test_trixi_include(joinpath(pkgdir(Trixi, "examples", "unstructured_2d_fdsbp"), "elixir_euler_source_terms_upwind.jl"), - l2=[3.8300267071890586e-5, - 5.295846741663533e-5, - 5.295846741663526e-5, - 0.00017564759295593478], - linf=[0.00018810716496542312, - 0.0003794187430412599, - 0.0003794187430412599, - 0.0009632958510650269], + l2=[ + 3.8300274213823844e-5, + 5.295847308063744e-5, + 5.295847308066259e-5, + 0.00017564760044077823 + ], + linf=[ + 0.0001881071653406785, + 0.00037941874324110003, + 0.0003794187432419882, + 0.0009632958467822306 + ], tspan=(0.0, 0.025), flux_splitting=splitting_lax_friedrichs, - atol=1.0e-10) + atol=2e-10) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let