Skip to content

Rename the *_array locals to say whether they are a vector or a... #336

Description

@1-Bort-1

Rename the *_array locals to say whether they are a vector or a matrix

Second of the three parts of #147 (Refactoring part III). Stack it on the pull request from branch agent/147-refactoring-part-iii (typed empty containers). The va naming is the third part and comes after this one.

#147 asks to replace every array in a name with vector (1D) or matrix (2D). ufechner7 suggested the suffix _vec for a 1D vector on that thread, and Bart agreed as long as the naming is consistent everywhere. A survey of main at 2b312ea found 22 identifiers and 241 occurrences, all of them locals, positional arguments, or the private calc_norm_array!. None is exported, a struct field, or a keyword, so no public API moves.

  • 2D (P×3): va_array, va_unit_array, x_airf_array, y_airf_array, z_airf_array, relative_velocity_array, v_acrossz_array
  • 1D: va_norm_array, chord_array, v_normal_array, v_tangential_array, va_magw_array, mu_array, cl_array, cd_array, cm_array, panel_width_array, force_array, moment_array (length 3), v_a_array, alpha_array
  • Files: src/solver.jl, src/body_aerodynamics.jl, test/bench.jl, test/body_aerodynamics/test_body_aerodynamics.jl, test/solver/test_solver.jl

The struct fields holding the same data already use _dist (VSMSolution._x_airf_dist, _va_dist, _chord_dist). Decide whether the locals follow the fields or the suffix. A per-panel quantity reads as _dist whether it is 1D or 2D, and that decision belongs in the PR card. There are no 3D names; AIC and SectionAero.cp/cf are Array{T,3} fields and keep their names.

Also noticed: test/body_aerodynamics/test_body_aerodynamics.jl:66-67 and :101-102 size va_norm_array/va_unit_array with length(coord) on a matrix, which counts elements rather than rows.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions