Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/OrdinaryDiffEqDefault/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OrdinaryDiffEqDefault"
uuid = "50262376-6c5a-4cf5-baba-aaf4f84d72d7"
authors = ["ParamThakkar123 <paramthakkar864@gmail.com>"]
version = "2.4.1"
version = "2.4.2"

[deps]
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
Expand Down Expand Up @@ -55,7 +55,7 @@ PrecompileTools = "1.2.1, 1.3"
EnumX = "1.0.4"
LinearAlgebra = "1.10"
SciMLBase = "3.39"
OrdinaryDiffEqCore = "4.8"
OrdinaryDiffEqCore = "4.11"
SparseArrays = "1.10"
Preferences = "1.5.0"
StaticArrays = "1.9.18"
Expand Down
55 changes: 38 additions & 17 deletions lib/OrdinaryDiffEqDefault/src/OrdinaryDiffEqDefault.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ using OrdinaryDiffEqVerner: Vern7
using OrdinaryDiffEqTsit5: Tsit5
using OrdinaryDiffEqRosenbrock: Rosenbrock23, Rodas5P
using OrdinaryDiffEqBDF: FBDF, DFBDF
import OrdinaryDiffEqCore

import OrdinaryDiffEqCore: is_mass_matrix_alg, default_autoswitch, isdefaultalg
import ADTypes: AutoFiniteDiff
Expand All @@ -20,11 +19,31 @@ using SciMLBase: SciMLBase, ODEProblem, DAEProblem, solve

include("default_alg.jl")

function _lorenz!(du, u, p, t)
du[1] = 10.0(u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
return du[3] = u[1] * u[2] - (8 / 3) * u[3]
end

function _lorenz_p!(du, u, p, t)
du[1] = p.σ * (u[2] - u[1])
du[2] = u[1] * (p.ρ - u[3]) - u[2]
return du[3] = u[1] * u[2] - p.β * u[3]
end

const _lorenz_p_params = (σ = 10.0, ρ = 28.0, β = 8 / 3)

function _lorenz_pref!(du, u, p, t)
du[1] = p[1] * (u[2] - u[1])
du[2] = u[1] * (p[2] - u[3]) - u[2]
return du[3] = u[1] * u[2] - p[3] * u[3]
end

const _lorenz_pref_params = [10.0, 28.0, 8 / 3]

import PrecompileTools
import Preferences
PrecompileTools.@compile_workload begin
lorenz = OrdinaryDiffEqCore.lorenz
lorenz_oop = OrdinaryDiffEqCore.lorenz_oop
solver_list = []
prob_list = []

Expand All @@ -45,22 +64,22 @@ PrecompileTools.@compile_workload begin
end

if Preferences.@load_preference("PrecompileDefaultSpecialize", true)
push!(prob_list, ODEProblem(lorenz, [1.0; 0.0; 0.0], (0.0, 1.0)))
push!(prob_list, ODEProblem(lorenz, [1.0; 0.0; 0.0], (0.0, 1.0), Float64[]))
push!(prob_list, ODEProblem(_lorenz!, [1.0; 0.0; 0.0], (0.0, 1.0)))
push!(prob_list, ODEProblem(_lorenz!, [1.0; 0.0; 0.0], (0.0, 1.0), Float64[]))
end

if Preferences.@load_preference("PrecompileAutoSpecialize", false)
push!(
prob_list,
ODEProblem{true, SciMLBase.AutoSpecialize}(
lorenz, [1.0; 0.0; 0.0],
_lorenz!, [1.0; 0.0; 0.0],
(0.0, 1.0)
)
)
push!(
prob_list,
ODEProblem{true, SciMLBase.AutoSpecialize}(
lorenz, [1.0; 0.0; 0.0],
_lorenz!, [1.0; 0.0; 0.0],
(0.0, 1.0), Float64[]
)
)
Expand All @@ -74,16 +93,16 @@ PrecompileTools.@compile_workload begin
if Preferences.@load_preference("PrecompileAutoDePSpecialize", true)
push!(
depspecialize_prob_list,
ODEProblem{true, OrdinaryDiffEqCore.AutoDePSpecialize}(
OrdinaryDiffEqCore.lorenz_p, [1.0; 0.0; 0.0],
(0.0, 1.0), OrdinaryDiffEqCore.lorenz_p_params
ODEProblem{true, SciMLBase.AutoDePSpecialize}(
_lorenz_p!, [1.0; 0.0; 0.0],
(0.0, 1.0), _lorenz_p_params
)
)
push!(
depspecialize_prob_list,
ODEProblem{true, OrdinaryDiffEqCore.AutoDePSpecialize}(
OrdinaryDiffEqCore.lorenz_pref, [1.0; 0.0; 0.0],
(0.0, 1.0), OrdinaryDiffEqCore.lorenz_pref_params
ODEProblem{true, SciMLBase.AutoDePSpecialize}(
_lorenz_pref!, [1.0; 0.0; 0.0],
(0.0, 1.0), _lorenz_pref_params
)
)
append!(prob_list, depspecialize_prob_list)
Expand All @@ -93,14 +112,14 @@ PrecompileTools.@compile_workload begin
push!(
prob_list,
ODEProblem{true, SciMLBase.FunctionWrapperSpecialize}(
lorenz, [1.0; 0.0; 0.0],
_lorenz!, [1.0; 0.0; 0.0],
(0.0, 1.0)
)
)
push!(
prob_list,
ODEProblem{true, SciMLBase.FunctionWrapperSpecialize}(
lorenz, [1.0; 0.0; 0.0],
_lorenz!, [1.0; 0.0; 0.0],
(0.0, 1.0), Float64[]
)
)
Expand All @@ -109,12 +128,14 @@ PrecompileTools.@compile_workload begin
if Preferences.@load_preference("PrecompileNoSpecialize", false)
push!(
prob_list,
ODEProblem{true, SciMLBase.NoSpecialize}(lorenz, [1.0; 0.0; 0.0], (0.0, 1.0))
ODEProblem{true, SciMLBase.NoSpecialize}(
_lorenz!, [1.0; 0.0; 0.0], (0.0, 1.0)
)
)
push!(
prob_list,
ODEProblem{true, SciMLBase.NoSpecialize}(
lorenz, [1.0; 0.0; 0.0], (0.0, 1.0),
_lorenz!, [1.0; 0.0; 0.0], (0.0, 1.0),
Float64[]
)
)
Expand Down
6 changes: 0 additions & 6 deletions lib/OrdinaryDiffEqDefault/test/qa/qa.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ without_local_project_sources(OrdinaryDiffEqDefault) do
# stale because of the unanalyzable enum submodule above.
ignore = (:Tsit5, :Vern7, :Rosenbrock23, :Rodas5P, :FBDF),
),
all_qualified_accesses_are_public = (;
# `lorenz`/`lorenz_oop` are OrdinaryDiffEqCore precompile-workload
# test problems (defined in `precompilation_setup.jl`), deliberately
# not part of its public extension surface.
ignore = (:lorenz, :lorenz_oop, :lorenz_p, :lorenz_p_params),
),
),
api_docs_kwargs = (;
rendered = false,
Expand Down
Loading