|
1 | | -@testitem "MIRK Loss Function Allocations" tags=[:allocs] begin |
| 1 | +@testitem "MIRK Loss Function Allocations" tags = [:allocs] begin |
2 | 2 | using BoundaryValueDiffEq, BoundaryValueDiffEqMIRK, BoundaryValueDiffEqCore, LinearAlgebra |
3 | 3 |
|
4 | 4 | function f!(du, u, p, t) |
|
28 | 28 |
|
29 | 29 | bvp = BVProblem(BVPFunction{true}(f!, bc!; bcresid_prototype = zeros(2)), u0, tspan) |
30 | 30 | tpbvp = BVProblem( |
31 | | - BVPFunction{true}(f!, (tpbc_a!, tpbc_b!); |
32 | | - bcresid_prototype = (zeros(1), zeros(1)), twopoint = Val(true)), |
33 | | - u0, tspan) |
| 31 | + BVPFunction{true}( |
| 32 | + f!, (tpbc_a!, tpbc_b!); |
| 33 | + bcresid_prototype = (zeros(1), zeros(1)), twopoint = Val(true) |
| 34 | + ), |
| 35 | + u0, tspan |
| 36 | + ) |
34 | 37 |
|
35 | 38 | # Test that the loss function allocations scale sub-linearly with mesh size |
36 | 39 | # (i.e., per-step allocations are bounded, not proportional to mesh points) |
37 | 40 | for (name, prob) in [("StandardBVP", bvp), ("TwoPointBVP", tpbvp)] |
38 | 41 | for alg in [MIRK4(), MIRK5(), MIRK6()] |
39 | 42 | cache = SciMLBase.__init(prob, alg; dt = 0.1, adaptive = false) |
40 | 43 | nlprob = BoundaryValueDiffEqMIRK.__construct_problem( |
41 | | - cache, vec(cache.y₀), copy(cache.y₀)) |
| 44 | + cache, vec(cache.y₀), copy(cache.y₀) |
| 45 | + ) |
42 | 46 |
|
43 | 47 | u_test = copy(nlprob.u0) |
44 | 48 | resid_test = zeros(length(nlprob.u0)) |
|
0 commit comments