File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 11using LinearAlgebra
22using VortexStepMethod
33using BenchmarkTools
4+ using Test
45
56using Pkg
67
@@ -42,11 +43,13 @@ set_va!(wa, vel_app)
4243P = length (wa. panels)
4344vsm_solver = Solver {P} (aerodynamic_model_type= VSM)
4445
45- # Step 5: Solve using both methods
46- println (" Rectangular wing, solve_base!:" )
47- @btime solve_base! ($ vsm_solver, $ wa, nothing ) # 51 allocations
48- # time Python: 32.0 ms Ryzen 7950x
49- # time Julia: 0.45 ms Ryzen 7950x
50- println (" Rectangular wing, solve!:" )
51- @btime sol = solve! ($ vsm_solver, $ wa, nothing ) # 85 allocations
46+ @testset " Allocation Tests for solve() and solve!()" begin
47+ # Step 5: Solve using both methods
48+ result = @benchmark solve_base! ($ vsm_solver, $ wa, nothing ) # 51 allocations
49+ @test result. allocs <= 55
50+ # time Python: 32.0 ms Ryzen 7950x
51+ # time Julia: 0.45 ms Ryzen 7950x
52+ result = @benchmark sol = solve! ($ vsm_solver, $ wa, nothing ) # 85 allocations
53+ @test result. allocs <= 89
54+ end
5255nothing
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ println("Running tests...")
2121@testset verbose = true " Testing VortexStepMethod..." begin
2222 if build_is_production_build
2323 include (" bench.jl" )
24+ include (" bench2.jl" )
2425 end
2526 include (" test_bound_filament.jl" )
2627 include (" test_panel.jl" )
You can’t perform that action at this time.
0 commit comments