Skip to content

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

Closed

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

  1. self-assigned this
    on Sep 16, 2026
  2. 1-Bort-1 commented on Sep 16, 2026

    @1-Bort-1
    MemberAuthor

    Renaming the 22 *_array locals to _dist (per-panel, 1D or P×3), which matches the struct fields and the _dist convention already stated at the top of solver.jl. calc_norm_array! becomes calc_norm_dist!, and force_array/moment_array (one 3-vector each) become force/moment. Stacked on #338. Leaving every va name other than the _array suffix to #337.

  3. 9 remaining items

  4. 1-Bort-1 commented on Sep 16, 2026

    @1-Bort-1
    MemberAuthor

    The red local CI run on be131ba was not the code. It was killed after 3 min (SIGTERM during test_settings.jl) and then failed with IOError: cd(".../VortexStepMethod.jl-336/test"): no such file or directory, because #341 merged at 22:08Z and the worktree was removed while the run was still going. The same commit passed two full local runs (8 min, exit 0), all 6 checks on #341, and main CI on 246237a. Nothing to change.

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