Skip to content

fix: CableDyn reader reads meshes the static solve refined - #26

Merged
SMI-Lab-Inha merged 1 commit into
devfrom
fix/cabledyn-refined-mesh
Nov 17, 2026
Merged

SMI-Lab-Inha merged 1 commit into
devfrom
fix/cabledyn-refined-mesh

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Problem

When CableDyn's static solve refines the mesh of a finite-EI line (adaptive_mesh, tensile_safety, or the automatic refinement; documented since CableDyn 0.2.0), the output files list every node of the refined mesh, while the node channels <J> still name deck nodes:

File Nodes listed
<root>.out channels (Curv1N8, L1N3Dec, Ten1N9, ...) deck nodes
.static.out, .elements.out, .Line<L>.p.out, .Line<L>.t.out refined mesh (with a DeckNode column / # DeckNode line)

read_cabledyn_sections compared .elements.out with the deck sections and rejected every such run.

Reproduction

The current CableDyn refines the 24 deck elements of the test deck lw24.dat (tensile_safety True) to 43:

$ cabledyn lw24r.dat lw24r        # CableDyn 0.4.2, development build 4b94321
>>> read_cabledyn_sections("lw24r", "lw24r.dat", {"upper": 10.0, "sag": 58.4})
CableSchemaError: lw24r.elements.out: mesh of line 1 differs from the deck sections (44 against 25 nodes)

The same error came from every option (curvature_source, frame, tension_source).

Change

  • The reader determines the mesh of the per-line files and the mesh row of every deck node:
    • from the DeckNode column of .static.out or the # DeckNode line of .Line<L>.p.out;
    • failing both, from the deck-node arc lengths in .elements.out.
  • Node channels are read at the deck nodes, while positions and segment tensions are read on the refined mesh, which .elements.out places. checks["mesh"] records the node counts and where the numbering came from.
  • Consistency checks still reject a deck that does not match the output:
    • every file must list the same number of nodes;
    • every DeckNode numbering must name the deck nodes in order (End A = 1, End B last) and agree with the others;
    • in .elements.out, the deck nodes must lie at the arc lengths of the deck sections;
    • an EI = 0 line, which CableDyn never refines, must not show a refined mesh.
  • When .elements.out is missing (the multibody march writes none), the nodes the refinement added cannot be placed:
    • positions are read at the deck nodes;
    • tension_source="auto" takes the node channels (checks["tension_file_skipped"]);
    • tension_source="segments" and tangent_placement="chord" are refused by name.
  • adaptive_mesh without .elements.out is no longer refused, because the files show whether the mesh was refined. An .elements.out with no rows for an EI = 0 line is skipped for that line.

Validation

tests/data/cabledyn/lw24r.* is real CableDyn 0.4.2 output (build 4b94321) of the lw24 deck, 1 s, with tangent channels (about 60 KB). Ratio of the reconstructed curvature error to the largest Curv value:

Node positions on the refined mesh (44 nodes) positions at the deck nodes only (no .elements.out) deck-node tangents
N2 0.042 0.042 0.093
N3 0.022 0.022 0.040
N4 0.014 0.023 0.032
N8 0.006 0.033 0.051
N10 0.024 0.148 0.044
N12 0.014 0.186 (window not written)

Reading the refined positions is what makes the difference: they meet every Curv channel within the default 5 %, while the deck-node subset misses N10 and N12 by 15 to 19 % (the unrefined 24-element v0.1.0 run lw24 needs 50 %). The tangent and position sources agree on the sag-bend curvature within 1 %. Chords placed on the refined mesh (the 0.4.1 placement) are rejected for this 0.4.2 output, as expected.

New tests:

  • test_real_cabledyn_run_on_a_refined_mesh
  • test_refined_mesh_is_located_without_a_deck_node_numbering (gives a bit-identical result)
  • test_refined_mesh_without_the_element_file
  • test_refined_mesh_of_another_deck_is_rejected (one NumSegs fewer; a section length changed)
  • test_deck_node_numberings_must_agree
  • test_element_file_of_other_lines

Tests updated for the new messages: an obsolete adaptive_mesh refusal, and a dummy CD.static.out replaced by a valid profile, since the static profile is now always read.

Gates

  • ruff check / ruff format --check (CI command), mypy: clean
  • pytest with numba: 4458 passed, 3 skipped
  • pytest with CABLEXSEC_DISABLE_NUMBA=1: 4344 passed, 117 skipped
  • run_validation.py --check: not stale; taxonomy full_scale 32 → 33 (analytical_sanity 1183, independent_method 76 unchanged); registered FAIL rows as before

read_cabledyn_sections rejected every run whose static solve refined
the mesh of a finite-EI line (adaptive_mesh, tensile_safety or the
automatic refinement) with "mesh of line ... differs from the deck
sections". .static.out, .elements.out and the per-line files list every
node of the refined mesh, while the node channels name the deck nodes
(CableDyn 0.2.0 and later). The current CableDyn refines the 24 deck
elements of the test deck lw24.dat to 43, so that run could not be read.

The reader now locates the deck nodes among the mesh nodes by the
DeckNode column of .static.out or the "# DeckNode" line of
.Line<L>.p.out (failing both, by their arc lengths in .elements.out),
reads the node channels at the deck nodes and the positions and segment
tensions on the refined mesh, and records the mesh in checks["mesh"].
A deck that does not match the output is still rejected: every file must
list the same number of nodes, every DeckNode numbering must name the
deck nodes in order and agree with the others, and the deck nodes must
lie at the deck-section arc lengths of .elements.out. Without
.elements.out the positions are read at the deck nodes, the "auto"
tension source takes the node channels, and segment tensions or chord
tangents are refused by name. adaptive_mesh without .elements.out is no
longer refused, and .elements.out without rows of an EI = 0 line is
skipped for that line.

tests/data/cabledyn/lw24r.* is CableDyn 0.4.2 output (development build
4b94321) of the lw24 deck for 1 s with tangent channels: from the
refined positions the curvature meets every Curv channel within the
default 5 %.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T22:18:56.053182Z 23edc4f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 CableXSec | 🛠️ Build #35969199 | 📁 Comparing 23edc4f against latest (240bf9c)

  🔍 Preview build  

19 files changed · ± 19 modified

± Modified

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 23edc4f87a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@SMI-Lab-Inha
SMI-Lab-Inha merged commit 20fc71f into dev Nov 17, 2026
12 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the fix/cabledyn-refined-mesh branch November 18, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant