@@ -450,17 +450,35 @@ function update_effective_angle_of_attack!(alpha_corrected,
450450 # induced_velocity[:, 2] .= AIC_y * gamma
451451 # induced_velocity[:, 3] .= AIC_z * gamma
452452
453- # Get views of AIC matrices without copying
454- AIC_views = (@view (body_aero. AIC[1 , :, :]),
455- @view (body_aero. AIC[2 , :, :]),
456- @view (body_aero. AIC[3 , :, :]))
453+ # # Get views of AIC matrices without copying
454+ # AIC_views = (@view(body_aero.AIC[1, :, :]),
455+ # @view(body_aero.AIC[2, :, :]),
456+ # @view(body_aero.AIC[3, :, :]))
457+
458+ # # Preallocate induced velocity array
459+ # induced_velocity = cache_body[1][va_array]
460+
461+ # # Calculate induced velocity components in-place
462+ # for (j, aic) in enumerate(AIC_views) # 384 allocated
463+ # mul!(@view(induced_velocity[:, j]), aic, gamma)
464+ # end
465+
466+ # Get dimensions from existing data
467+ n_rows = size (body_aero. AIC, 2 )
468+ n_cols = size (body_aero. AIC, 3 )
457469
458470 # Preallocate induced velocity array
459471 induced_velocity = cache_body[1 ][va_array]
460472
461- # Calculate induced velocity components in-place
462- for (j, aic) in enumerate (AIC_views) # 384 allocated
463- mul! (@view (induced_velocity[:, j]), aic, gamma)
473+ # Calculate each component with explicit loops
474+ for j in 1 : 3 # For each x/y/z component
475+ for i in 1 : n_rows
476+ acc = zero (eltype (induced_velocity)) # Type-stable accumulator
477+ for k in 1 : n_cols
478+ acc += body_aero. AIC[j, i, k] * gamma[k]
479+ end
480+ induced_velocity[i, j] = acc
481+ end
464482 end
465483
466484 # In-place relative velocity calculation
0 commit comments