|
93 | 93 | sol = solve(prob, mirk_solver(Val(order)); dt = 0.2) |
94 | 94 | @test norm(diff(first.(sol.u)) .+ 0.2, Inf) + abs(sol.u[1][1] - 5) < affineTol |
95 | 95 | end |
| 96 | + |
| 97 | + @testset "MIRK$(order)I" for order in (6,) |
| 98 | + sol = solve(prob, MIRK6I(); dt = 0.2) |
| 99 | + @test norm(diff(first.(sol.u)) .+ 0.2, Inf) + abs(sol.u[1][1] - 5) < affineTol |
| 100 | + end |
96 | 101 | end |
97 | 102 | end |
98 | 103 |
|
|
109 | 114 | @test_call target_modules=(BoundaryValueDiffEqMIRK,) solve( |
110 | 115 | prob, solver; dt = 0.2) |
111 | 116 | end |
| 117 | + |
| 118 | + @testset "MIRK$(order)I" for order in (6,) |
| 119 | + solver = MIRK6I(; nlsolve = NewtonRaphson(), |
| 120 | + jac_alg = BVPJacobianAlgorithm(AutoForwardDiff(; chunksize = 2))) |
| 121 | + @test_opt target_modules=(BoundaryValueDiffEqMIRK,) solve( |
| 122 | + prob, solver; dt = 0.2) |
| 123 | + @test_call target_modules=(BoundaryValueDiffEqMIRK,) solve( |
| 124 | + prob, solver; dt = 0.2) |
| 125 | + end |
112 | 126 | end |
113 | 127 | end |
114 | 128 |
|
|
122 | 136 | dts, prob, mirk_solver(Val(order)); abstol = 1e-8, reltol = 1e-8) |
123 | 137 | @test sim.𝒪est[:final]≈order atol=testTol |
124 | 138 | end |
| 139 | + |
| 140 | + @testset "MIRK$(order)I" for (_, order) in enumerate((6,)) |
| 141 | + sim = test_convergence(dts, prob, MIRK6I(); abstol = 1e-8, reltol = 1e-8) |
| 142 | + @test sim.𝒪est[:final]≈order atol=testTol |
| 143 | + end |
125 | 144 | end |
126 | 145 | end |
127 | 146 |
|
|
153 | 172 | @test_nowarn solve(bvp1, MIRK4(; jac_alg); dt = 0.05) |
154 | 173 | @test_nowarn solve(bvp1, MIRK5(; jac_alg); dt = 0.05) |
155 | 174 | @test_nowarn solve(bvp1, MIRK6(; jac_alg); dt = 0.05) |
| 175 | + @test_nowarn solve(bvp1, MIRK6I(; jac_alg); dt = 0.05) |
156 | 176 | end |
157 | 177 |
|
158 | 178 | @testitem "Interpolation" begin |
|
219 | 239 | @test sol(0.04, Val{0})≈sol_analytic atol=testTol |
220 | 240 | @test sol(0.04, Val{1})≈dsol_analytic atol=testTol |
221 | 241 | end |
| 242 | + |
| 243 | + @testset "Interpolation for adaptive MIRK$(order)I" for order in (6,) |
| 244 | + sol = solve(prob_bvp_linear, MIRK6I(); dt = 0.001) |
| 245 | + sol_analytic = prob_bvp_linear_analytic(nothing, λ, 0.001) |
| 246 | + |
| 247 | + @test sol(0.001)≈sol_analytic atol=testTol |
| 248 | + @test sol(0.001; idxs = [1, 2])≈sol_analytic atol=testTol |
| 249 | + @test sol(0.001; idxs = 1)≈sol_analytic[1] atol=testTol |
| 250 | + @test sol(0.001; idxs = 2)≈sol_analytic[2] atol=testTol |
| 251 | + end |
| 252 | + |
| 253 | + @testset "Interpolation for non-adaptive MIRK$(order)I" for order in (6,) |
| 254 | + sol = solve(prob_bvp_linear, MIRK6I(); dt = 0.001, adaptive = false) |
| 255 | + |
| 256 | + @test_nowarn sol(0.01) |
| 257 | + @test_nowarn sol(0.01; idxs = [1, 2]) |
| 258 | + @test_nowarn sol(0.01; idxs = 1) |
| 259 | + @test_nowarn sol(0.01; idxs = 2) |
| 260 | + end |
| 261 | + |
| 262 | + @testset "Interpolation for solution derivative" for order in (6,) |
| 263 | + sol = solve(prob_bvp_linear, MIRK6I(); dt = 0.001) |
| 264 | + sol_analytic = prob_bvp_linear_analytic(nothing, λ, 0.04) |
| 265 | + dsol_analytic = prob_bvp_linear_analytic_derivative(nothing, λ, 0.04) |
| 266 | + |
| 267 | + @test sol(0.04, Val{0})≈sol_analytic atol=testTol |
| 268 | + @test sol(0.04, Val{1})≈dsol_analytic atol=testTol |
| 269 | + end |
222 | 270 | end |
223 | 271 |
|
224 | 272 | @testitem "Swirling Flow III" begin |
|
0 commit comments