11using .. FiniteVolumeMethod1D
22using OrdinaryDiffEq
3+ using OrdinaryDiffEqSDIRK
34using CairoMakie
45using ReferenceTests
56using SpecialFunctions
@@ -42,7 +43,7 @@ prob = FVMProblem(
4243 reaction_function = (u, x, t, p) -> zero (u)
4344)
4445sol = 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
4849fig = Figure (size = (2150 , 460 ), fontsize = 34 )
@@ -51,14 +52,14 @@ ax = Axis(
5152 titlealign = :left , width = 600 , height = 300
5253)
5354colors = [: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 )]
5556ylims! (ax, - 1.0e-6 , 5 )
5657xlims! (ax, - 1 , 1 )
5758ax = 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 )]
6263ylims! (ax, - 1.0e-6 , 5 )
6364xlims! (ax, - 1 , 1 )
6465ax = 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]
7273ylims! (ax, - 1.0e-6 , 0.5 )
7374xlims! (ax, - 1 , 1 )
0 commit comments