Repository navigation
perf(capi): read a whole line at once, with section curvature and the EI = 0 azimuth range - #97
Merged
Merged
Conversation
CurvX and CurvY were reachable in-process only as one channel per node, each of which evaluates the whole line. CD_C_LINE_SECTION_CURVATURE and Line.section_curvature() return both at every node of a finite-EI line in one evaluation, and match the channels bit for bit. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
CableDyn_GetLineValues built a text token per node and value and parsed it back, and each EI = 0 or geometric token also rebuilt the whole line, so a read cost O(n) tokens and O(n^2) work. CD_Eval_Aggregate_Line_Values now evaluates position, velocity, acceleration, tension, curvature, bend moment, declination and azimuth for a whole line, on finite-EI cables and EI = 0 lines, on the aggregate and point routes. It shares the per-node rules with the channel evaluator (cable_recovered_value, system_node_tension, line_geom_from_r, cable_global_component, cable_global_azimuth), so every value is the channel's bit for bit. A failed or non-finite value still goes through its channel, which gives the same status and message as before. The line is looked up without building the inventory, and the one scratch array lives on the handle. test_line_values compares every quantity with the channels, value by value, on the point and aggregate routes and at every node of a refined mesh. test_c_api_threads now reads the lines of every handle at each step. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
…copy CD_Copy_Model set the azimuth range on its working copy, but commit_model_copy did not move it to the destination. Every EI = 0 line held by a system is such a copy, so it fell back to [0, 360) whatever its deck chord: a line heading just below +X read 350.5 deg where the standalone EI = 0 route reads -9.5 deg, in the channels and line values of the C API and Python on the point and aggregate routes, on the standalone mixed and multibody routes, and in the aggregate's channels, static profile and initialisation summary, which OpenFAST reports. The move is one line. Only the L<L>N<J>Azi value of an EI = 0 line whose chord heads within 45 deg of +X changes, by -360 deg where it read above 180 deg; no force or state depends on it. test_model checks the copy. test_line_values and test_objects sweep headings on both sides of +X, on EI = 0 and mixed decks and on a body, against the documented range on every route. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
Owner
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three connected changes to reading line values in-process.
CD_C_LINE_SECTION_CURVATUREandLine.section_curvature()returnCurvXandCurvYat every node of a finite-EI line in one evaluation. A channel per node evaluated the whole line each time.CableDyn_GetLineValuesevaluates position, velocity, acceleration, tension, curvature, bend moment, declination and azimuth in one pass, without a text token per node. The per-node rules moved into helpers that the channel evaluator and this path share, so they cannot drift.EI = 0azimuth: a line whose deck chord heads within 45 degrees of +X reported its azimuth in [0, 360) instead of (-180, 180] outside the standaloneEI = 0route, on the C API and Python, the standalone mixed and multibody routes, and OpenFAST.commit_model_copydroppedazimuth_signed. Those values read 360 degrees lower now; nothing else changes.Timings
Per call, 301 nodes, a 4 ms step:
EI = 0tension (was O(n²))Checks
line_values_match_channels: 16,380 values againstCableDyn_EvalChanneland 23,768 against the mesh-node channels, bit for bit, across headings, recoveries, a stiffener, torsion, mixed, point, refined, body and rod decks.EI = 0and mixed decks through line values, channels, the driver's.outand.static.out.OPENBLAS_CORETYPE=Prescott; pytest passes; no new compiler warnings.The CHANGELOG entry lands with the release batch.