|
1 | 1 | using OrdinaryDiffEqAdamsBashforthMoulton, ODEProblemLibrary |
| 2 | +import OrdinaryDiffEqCore: OrdinaryDiffEqAdaptiveAlgorithm |
2 | 3 | using Test |
3 | 4 | using Static |
4 | 5 |
|
5 | | -free_timestep_algorithms = [VCAB3, VCAB4, VCAB5, VCABM3, VCABM4, VCABM5, VCABM] |
6 | | - |
7 | | -fixed_timestep_algorithms = [AB3, AB4, AB5, ABM32, ABM43, ABM54] |
| 6 | +algorithms = [ |
| 7 | + AB3, AB4, AB5, ABM32, ABM43, ABM54, VCAB3, VCAB4, VCAB5, VCABM3, VCABM4, VCABM5, VCABM] |
8 | 8 |
|
9 | 9 | problem = ODEProblemLibrary.prob_ode_linear |
10 | 10 |
|
11 | | -function test_alg(ALG; kwargs...) |
12 | | - sol_thread = solve(problem, ALG(Static.True()); kwargs...) |
13 | | - sol_nothread = solve(problem, ALG(Static.False()); kwargs...) |
14 | | - |
15 | | - @test all(sol_nothread .== sol_thread) |
16 | | -end |
17 | | - |
18 | 11 | @testset "Regression test for threading versions vs non threading versions" begin |
19 | | - @testset "$ALG" for ALG in fixed_timestep_algorithms |
20 | | - test_alg(ALG, dt = 1 // 2^9) |
21 | | - end |
22 | | - @testset "$ALG" for ALG in free_timestep_algorithms |
23 | | - test_alg(ALG) |
| 12 | + @testset "$ALG" for ALG in algorithms |
| 13 | + if ALG isa OrdinaryDiffEqAdaptiveAlgorithm |
| 14 | + sol_thread = solve(problem, ALG(Static.True())) |
| 15 | + sol_nothread = solve(problem, ALG(Static.False())) |
| 16 | + else |
| 17 | + sol_thread = solve(problem, ALG(Static.True()), dt = 1 // 2^9) |
| 18 | + sol_nothread = solve(problem, ALG(Static.False()), dt = 1 // 2^9) |
| 19 | + end |
| 20 | + @test all(sol_nothread .== sol_thread) |
24 | 21 | end |
25 | 22 | end |
0 commit comments