Skip to content

Commit 4705658

Browse files
committed
Now 112, 600 allocations
1 parent 1cba421 commit 4705658

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/solver.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ Struct for storing the solution of the [solve!](@ref) function. Must contain all
1616
"""
1717
mutable struct VSMSolution{P}
1818
panel_width_array::Vector{Float64}
19+
cl_array::Vector{Float64}
20+
cd_array::Vector{Float64}
21+
cm_array::Vector{Float64}
1922
gamma_distribution::Union{Nothing, Vector{Float64}}
2023
aero_force::MVec3
2124
aero_moments::MVec3
@@ -27,7 +30,8 @@ mutable struct VSMSolution{P}
2730
end
2831

2932
function VSMSolution(P)
30-
VSMSolution{P}(zeros(P), nothing, zeros(MVec3), zeros(MVec3), zeros(MVec3), zeros(MVec3), zeros(3), zeros(3), FAILURE)
33+
VSMSolution{P}(zeros(P), zeros(P), zeros(P), zeros(P), nothing,
34+
zeros(MVec3), zeros(MVec3), zeros(MVec3), zeros(MVec3), zeros(3), zeros(3), FAILURE)
3135
end
3236

3337
"""
@@ -118,9 +122,9 @@ function solve!(solver::Solver, body_aero::BodyAerodynamics, gamma_distribution=
118122

119123
# Initialize arrays
120124
n_panels = length(panels)
121-
cl_array = zeros(n_panels)
122-
cd_array = zeros(n_panels)
123-
cm_array = zeros(n_panels)
125+
cl_array = solver.sol.cl_array
126+
cd_array = solver.sol.cd_array
127+
cm_array = solver.sol.cm_array
124128
panel_width_array = solver.sol.panel_width_array
125129
solver.sol.moment_distribution = zeros(n_panels)
126130
solver.sol.moment_coefficient_distribution = zeros(n_panels)

0 commit comments

Comments
 (0)