Skip to content

Commit 2d1c767

Browse files
Merge pull request #62 from ChrisRackauckas-Claude/fix-master-solver-imports
Fix master CI: import OrdinaryDiffEq sub-packages explicitly
2 parents f5be9a0 + d0cc116 commit 2d1c767

11 files changed

Lines changed: 20 additions & 10 deletions

docs/src/examples.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ Now we solve and plot the solution.
128128
```julia
129129
using OrdinaryDiffEq
130130
using LinearSolve
131-
sol = solve(prob, TRBDF2(linsolve = KLUFactorization()), saveat = 0.001)
131+
sol = solve(prob, TRBDF2(linsolve = KLUFactorization()), saveat = 0.001,
132+
abstol = 1.0e-10, reltol = 1.0e-8)
132133

133134
using CairoMakie
134135
let t_range = LinRange(0.0, final_time, 250)
28.1 KB
Loading
25.9 KB
Loading
30.4 KB
Loading

src/precompilation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using PrecompileTools
1+
using PrecompileTools: @setup_workload, @compile_workload
22

33
@setup_workload begin
44
# Minimal setup - these are lightweight and don't add much to precompilation time

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ MethodOfLines = "94925ecb-adb7-4558-8ed8-f975c56a0bf4"
88
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
99
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
1010
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
11+
OrdinaryDiffEqSDIRK = "2d112036-d095-4a1e-ab9a-08536f3ecdbf"
1112
ReferenceTests = "324d217c-45ce-50fc-942e-d289b448e8cf"
1213
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
1314
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"

test/dirichlet_source.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ using ..FiniteVolumeMethod1D
22
using LinearAlgebra
33
using LinearSolve
44
using OrdinaryDiffEq
5+
using OrdinaryDiffEqSDIRK
56
using CairoMakie
67
using ReferenceTests
78

@@ -32,8 +33,11 @@ prob = FVMProblem(
3233
initial_condition,
3334
final_time
3435
)
35-
sol = solve(prob, TRBDF2(linsolve = KLUFactorization()), saveat = 0.001)
36-
exact_sol = [exact_u.(mesh_points, sol.t[i]) for i in eachindex(sol)]
36+
sol = solve(
37+
prob, TRBDF2(linsolve = KLUFactorization()),
38+
saveat = 0.001, abstol = 1.0e-10, reltol = 1.0e-8
39+
)
40+
exact_sol = [exact_u.(mesh_points, sol.t[i]) for i in eachindex(sol.t)]
3741
@test reduce(hcat, sol.u) reduce(hcat, exact_sol) rtol = 1.0e-1
3842

3943
let t_range = LinRange(0.0, final_time, 250)

test/fisher.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using ..FiniteVolumeMethod1D
22
using MethodOfLines
33
using OrdinaryDiffEq
4+
using OrdinaryDiffEqSDIRK
45
using ReferenceTests
56
using CairoMakie
67
using ModelingToolkit

test/heat.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using ..FiniteVolumeMethod1D
22
using OrdinaryDiffEq
3+
using OrdinaryDiffEqSDIRK
34
using ReferenceTests
45
using CairoMakie
56
using LinearSolve
@@ -27,7 +28,7 @@ prob = FVMProblem(
2728
)
2829

2930
sol = solve(prob, TRBDF2(linsolve = KLUFactorization()))
30-
exact_sol = [exact2.(mesh_points, sol.t[i]) for i in eachindex(sol)]
31+
exact_sol = [exact2.(mesh_points, sol.t[i]) for i in eachindex(sol.t)]
3132
@test reduce(hcat, sol.u) reduce(hcat, exact_sol) rtol = 1.0e-2
3233

3334
let t_range = LinRange(0.0, final_time, 250)

test/porous_medium.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using ..FiniteVolumeMethod1D
22
using OrdinaryDiffEq
3+
using OrdinaryDiffEqSDIRK
34
using CairoMakie
45
using ReferenceTests
56
using SpecialFunctions
@@ -42,7 +43,7 @@ prob = FVMProblem(
4243
reaction_function = (u, x, t, p) -> zero(u)
4344
)
4445
sol = solve(prob, TRBDF2(); saveat = saveat)
45-
exact = [exact_solution.(mesh_points, sol.t[i]) for i in eachindex(sol)]
46+
exact = [exact_solution.(mesh_points, sol.t[i]) for i in eachindex(sol.t)]
4647
@test exact sol.u rtol = 1.0e-1
4748

4849
fig = Figure(size = (2150, 460), fontsize = 34)
@@ -51,14 +52,14 @@ ax = Axis(
5152
titlealign = :left, width = 600, height = 300
5253
)
5354
colors = [:red, :black, :blue, :darkgreen, :magenta, :orange]
54-
[lines!(ax, mesh_points, sol.u[i], color = colors[i]) for i in eachindex(sol)]
55+
[lines!(ax, mesh_points, sol.u[i], color = colors[i]) for i in eachindex(sol.t)]
5556
ylims!(ax, -1.0e-6, 5)
5657
xlims!(ax, -1, 1)
5758
ax = Axis(
5859
fig[1, 2], xlabel = L"x", ylabel = L"u(x)", title = L"(b):$ $ Exact solution",
5960
titlealign = :left, width = 600, height = 300
6061
)
61-
[lines!(ax, mesh_points, exact[i], color = colors[i]) for i in eachindex(sol)]
62+
[lines!(ax, mesh_points, exact[i], color = colors[i]) for i in eachindex(sol.t)]
6263
ylims!(ax, -1.0e-6, 5)
6364
xlims!(ax, -1, 1)
6465
ax = Axis(
@@ -67,7 +68,7 @@ ax = Axis(
6768
)
6869
[
6970
lines!(ax, mesh_points, abs.(exact[i] .- sol.u[i]), color = colors[i])
70-
for i in eachindex(sol)
71+
for i in eachindex(sol.t)
7172
]
7273
ylims!(ax, -1.0e-6, 0.5)
7374
xlims!(ax, -1, 1)

0 commit comments

Comments
 (0)