Skip to content

Commit 4d6bd58

Browse files
committed
Now 346 allocations
1 parent 66f9330 commit 4d6bd58

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/body_aerodynamics.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ function calculate_stall_angle_list(panels::Vector{Panel};
412412
return stall_angles
413413
end
414414

415+
const cache_body = [LazyBufferCache()]
416+
415417
"""
416418
update_effective_angle_of_attack_if_VSM(body_aero::BodyAerodynamics, gamma::Vector{Float64},
417419
core_radius_fraction::Float64,
@@ -442,7 +444,7 @@ function update_effective_angle_of_attack_if_VSM(body_aero::BodyAerodynamics,
442444
AIC_x, AIC_y, AIC_z = @views body_aero.AIC[1, :, :], body_aero.AIC[2, :, :], body_aero.AIC[3, :, :]
443445

444446
# Preallocate and calculate induced velocity directly
445-
induced_velocity = similar(va_array)
447+
induced_velocity = cache_body[1][va_array]
446448
induced_velocity[:, 1] .= AIC_x * gamma
447449
induced_velocity[:, 2] .= AIC_y * gamma
448450
induced_velocity[:, 3] .= AIC_z * gamma

0 commit comments

Comments
 (0)