@@ -1044,8 +1044,9 @@ function linearize(solver::Solver, body_aero::BodyAerodynamics, y::Vector{T};
10441044 throw (ArgumentError (" Cannot use theta_idxs or delta_idxs when wing has no unrefined sections" ))
10451045 end
10461046
1047- init_va = body_aero. cache[1 ][body_aero. va]
1048- init_va .= body_aero. va
1047+ init_va = body_aero. cache[1 ][body_aero. _va]
1048+ init_va .= body_aero. _va
1049+ init_omega = copy (body_aero. omega)
10491050 last_theta_ref = Ref {Vector{T}} (Vector {T} (undef, 0 ))
10501051 if ! isnothing (theta_idxs)
10511052 @views last_theta_ref[] = body_aero. cache[2 ][y[theta_idxs]]
@@ -1085,15 +1086,10 @@ function linearize(solver::Solver, body_aero::BodyAerodynamics, y::Vector{T};
10851086 end
10861087 end
10871088
1088- if ! isnothing (va_idxs) && isnothing (omega_idxs)
1089- set_va! (body_aero, y[va_idxs])
1090- elseif ! isnothing (va_idxs) && ! isnothing (omega_idxs)
1091- set_va! (body_aero, y[va_idxs], y[omega_idxs])
1092- elseif isnothing (va_idxs) && ! isnothing (omega_idxs)
1093- set_va! (body_aero, init_va, y[omega_idxs])
1094- else
1095- set_va! (body_aero, init_va)
1096- end
1089+ va = isnothing (va_idxs) ? init_va : y[va_idxs]
1090+ om = isnothing (omega_idxs) ? init_omega :
1091+ y[omega_idxs]
1092+ set_va! (body_aero, va, om)
10971093
10981094 solve! (solver, body_aero; kwargs... )
10991095 if ! aero_coeffs
0 commit comments