Skip to content

fix(statics): refine locally; robust attachment polish - #29

Merged
SMI-Lab-Inha merged 7 commits into
devfrom
fix/statics-refine-attach
Oct 20, 2026
Merged

SMI-Lab-Inha merged 7 commits into
devfrom
fix/statics-refine-attach

Conversation

@SMI-Lab-Inha

@SMI-Lab-Inha SMI-Lab-Inha commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Finite-EI statics refine the mesh only where it is needed, and a lazy wave with discrete buoyancy modules in a cross current on a frictional seabed solves.

  • Local refinement. A mesh that cannot resolve its static curvature (L0*kappa above 0.7), or a fragile mesh under adaptive_mesh True, was refined as a whole: every element was split by the power of two the worst one needed, up to 16. A 462-element lazy wave whose 180 m top section had two elements was solved on 7392 elements in 10.0 s.
    • A pass now splits into 2, 4, 8 or 16 only the elements that need it:

      • L0*kappa above 0.12, or the stricter adaptive_mesh target;
      • longer than half their bending length;
      • at a line end, longer than the boundary layer sqrt(EI/T);
      • the elements about an isolated seabed-contact change.

      It then grades the mesh so that no element is more than twice as long as the next.

    • The cap of 16 per deck element, the element limit, the acceptance checks and the fail-closed messages are unchanged. A refinement that stops short of its target names what stopped it.

    • The deck above now solves on 492 elements in 0.33 s, with end tensions within 4e-7 of the whole-line refinement.

    • In the statics matrix, 61 of 123 decks refine: CPU time falls from 65 s to 33 s, end tensions move by at most 0.21 % of the peak end tension, and nodes by at most 6.4e-4 of the line length.

    • Every deck node stays a node of the refined mesh, so the node output channels still name deck nodes.

    • Decks that do not refine, including every shipped example, give identical output.

  • Attachment polish in a cross current. tests/data/lazy_wave_touchdown_planar_refined_att.dat (25 modules) in a 0.3 m/s cross current failed at load fraction 0.125. The damped Newton update for the module drag overshot on the frictional seabed.
    • A step that does not converge is repeated with pseudo-transient continuation, then with a residual-merit line search, and halved (down to 1/1024) when neither converges.
    • A state reached this way must pass the same checks as the smeared state (kink limit away from the modules, tensile contract, physical-branch audit, stability), or the solve fails closed naming the check.
    • The deck now solves in 1.8 s, within 0.04 % (fairlead) and 0.2 % (anchor) of its smeared-buoyancy twin. A polish whose Newton steps all converge takes the same solves as before.
  • Test update for active tension. The refined-cable CONTROL test from feat(control): active tension of finite-EI cables; committed lengths under the force blend #26 assumed every deck segment splits into the same number of elements. It now checks that the controlled span is exactly the trailing elements of the 40/13 m fairlead-side segment (2 of 100 elements under local refinement).

Tests

  • test_hermite_automesh: local against whole-line refinement (fewer elements, equilibrium within 1e-3 of the line length, rest length kept), power-of-two children within the cap, grading (at most 2x between neighbours), the end layer, the element limit, and a resolved mesh kept bit-identical; the element h*kappa metrics. The element-limit case uses the new optional max_elements argument (a lower limit than 8192; callers unchanged) on a 60-element line, because reaching 8192 needed a string-like line whose polish settled on a platform-dependent folded state on Linux.
  • attachment_cross_current: the four cross-current cases against their smeared twins.
  • test_line_attachments: the fallback attachment verdicts (a slope jump beside a module accepted, a bend away from it rejected by the kink limit, compression under tensile_safety True); test_deck_hermite_cable: refinement keeps the declared element partition.
  • Full suite (Windows, gfortran, Release, slow tier included): 293/293. Python: 2036 passed. pre-commit run --all-files and the Sphinx build with -W pass.

Checklist

  • pre-commit run --all-files passes
  • ctest --test-dir build --output-on-failure passes
  • python -m pytest tests python/tests passes (if Python or validation records changed)
  • VALIDATION.md updated if a validation result changed (none changed)
  • CHANGELOG.md updated under [Unreleased] (heading added if missing) for user-visible changes
  • Documentation in doc/ updated for changed inputs, options, or outputs
  • Conventional Commit title (feat:, fix:, docs:, ...)
  • Commits are signed off (git commit -s) under the
    Developer Certificate of Origin

- A finite-EI static solve whose resolution check failed refined the
  whole line uniformly, up to 16x, even when one region was coarse: two
  decks went from 462 to 7392 elements and took 6-13 s. AutoMesh now
  refines locally (option local_refinement, on for every deck route):
  only the elements whose curvature resolution, bending length,
  boundary layer or contact change requires it are split into 2-16
  equal children, graded so neighbours differ by at most a factor of
  two. The pass starts under exactly the old conditions, the caps and
  audits are unchanged. R6: 6.6 s / 7392 elements -> 0.30 s / 492
  (end tensions within 3.5e-7, nodes 0.7 mm); the statics matrix
  refining decks 76 -> 31 s CPU, results within 0.21 % of peak end
  tension of the uniform refinement. Decks that do not refine are
  byte-identical.
- The attachment polish of a lazy wave with 25 discrete buoyancy
  modules on a refined mesh in a 0.3 m/s cross current failed at load
  fraction 0.125 (seabed friction: the first Newton update raised the
  residual 300-fold). A failed step is now retried from the last
  converged state with pseudo-transient continuation, the merit line
  search and halved load steps down to 1/1024; the case solves within
  0.04 % (fairlead) / 0.2 % (anchor) of its smeared twin. Decks whose
  steps converge take the unchanged path.

Tests: attachment_cross_current (four discrete-module decks against
smeared twins), local-mode AutoMesh cases.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
A discrete attachment equilibrium that the damped Newton solves did not
reach alone (pseudo-transient continuation, line search or smaller load
steps) is now put through the checks the smeared state passed: the kink
limit, the tensile contract under tensile_safety True, the
physical-branch audit and the stability test with the static
constraints. The solve fails closed naming the failed check. A polish
whose Newton solves all converge is not checked again, so its output is
unchanged.

The attachment polish allows at most 32 failed load steps in all; a
step that converged at one size and failed at twice it could otherwise
cycle about a thousand times. Its failure message names the load
fraction of the first failed solve and the load fraction the homotopy
reached; a failure of the drag fixed point names that solve.

Local refinement: where a pass would exceed the element limit, the
bending-length levels give way first (a level at a time, graded), then
the grading, and only then the h*kappa, end-layer and contact needs. The
pass cap of 12 now bounds the local resolution passes (the cumulative
factor no longer keeps them going), and in the local mode an axial pass
is bounded by its own pass cap. applied_scale in the local mode is the
largest factor of any element after axial passes too, so the "adaptive
refinement stopped at Nx" note is truthful.

Documentation: node output channels on a refined line number the nodes
of the refined mesh while names are validated against the deck node
count, and .static.out or .elements.out give the node arc positions;
the "refined to ... elements" note also follows the uniform refinement
of a coarse deck mesh whose continuation or polish failed; the
attachment failure message and its checks are described.

Tests: the local refinement case checks that new neighbour length jumps
stay within 2x (the deck's own jump excepted), and a new case checks
that the element limit keeps the h*kappa levels and gives up a
bending-length level (it fails with the former uniform reduction).

Decks that do not refine, and attachment decks whose polish converges
without its fallbacks, give identical output.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The acceptance checks of a discrete attachment state reached with the
polish fallbacks applied the kink limit to every element. A lumped load
turns the line by a slope jump at its node, which the C1 elements beside
the node carry as h*kappa of about twice the jump at any mesh size, so a
heavy module on a slack stretch failed closed on the fallback path while
the same equilibrium was accepted when Newton converged plainly. The
kink limit now applies away from the attachment nodes; the tensile
contract, the fold, loop and self-contact audit (its own kink test left
to that check) and the stability test are unchanged. The checks moved
into CD_Attachment_Discrete_Verdict, public for its unit test, and a
state that passes them is reported in a note.

The polish step controller doubled a halved step after a single
converged step, so a homotopy converging steadily at 1/32 or 1/64 of the
load ran into the 32-failure budget at a load fraction of 0.94 or 0.45.
A halved step now doubles after two consecutive converged steps of its
size, and each time a doubled step fails the number of converged steps a
doubling waits for doubles; such a homotopy keeps advancing and tries
the larger size about ten times at most. At most 64 load steps may fail
in all, a backstop with at most 1024 converged steps.

In the local mode, a refinement that stops short of its target names
what stopped it (the element limit, the 12-pass or 16-axial-pass limit)
instead of "refinement cap exhausted", which remains for the per-element
cap.

Documentation: the node channels note in outputs.rst names the silent
refinements (adaptive_mesh, torsion, the axial passes of tensile_safety
True), gives the End B node by ReferenceArcEnd, and says that node
counts and arc positions follow the static state (for example an
OpenFAST start with PtfmInit against the deck positions). The iteration
budget comment of the polish counts the first failed step correctly, and
the comment on the friction pull test names the arcs of N26 and N28 in
the 1-based channel convention.

Tests: a unit case of the verdict (a slope jump beside the module
accepted; the same bend away from it, a compressed state under
tensile_safety and an unstable state rejected by name), and the
cross-current test requires the fallback note on its fallback case.

Decks that do not refine and attachment decks whose polish converges
without its fallbacks give identical output.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
After the rebase onto the deck-node channel mapping, the local refinement
keeps every deck node (it only bisects deck elements), so the node
channels still name deck nodes. The CHANGELOG and the troubleshooting
note said they number the refined nodes; they now point to the
node-channel section instead, which names both refinement kinds.

Re-measured on the rebased build: the two headline decks take 10.0 s and
9.2 s with whole-line refinement and 0.33 s and 0.28 s now; the statics
matrix CPU time of its 61 refining decks falls from 65 s to 33 s (the
accuracy figures are unchanged). The lazy wave of the node-channel entry
now refines to 269 elements instead of 1136, its node tensions within
0.9 N of the same line on 1560 elements.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The active-tension test of a refined cable, merged from dev, assumed
that static refinement splits every deck segment into the same number
of cable elements. With local refinement the fairlead-side segment of
the test deck becomes 2 of 100 elements, so the count check failed
although the span was right. The test now checks that the span is the
trailing elements that make up the 40/13 m segment and that it stops
at that segment.

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 Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T08:19:59.797683Z 01d6411 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

read-the-docs-community Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 CableDyn | 🛠️ Build #35263725 | 📁 Comparing 01d6411 against latest (f27c5e3)

  🔍 Preview build  

29 files changed · ± 29 modified

± Modified

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: d66c256d00

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

The local-refinement case at the element limit polishes a near-cable
line (EI = 1e-2) on about 7000 elements. It converged in 106 Newton
iterations on Windows but not within the cap of 120 on the Linux
Release runner (residual 3.6). The case checks how the refinement
levels are allocated at the limit, not the iteration count, so the cap
is now 400, and the test prints the element count, the iterations and
the residual of the solve.

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

Copy link
Copy Markdown

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

Reviewed commit: 84f9096832

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

The element-limit case of the local refinement needed a string-like
line (EI = 1e-2) on about 7000 elements to reach the limit of 8192. Its
polish has nearly free folding modes, so the equilibrium it settles on
depends on round-off: Windows found the smooth one in 106 Newton
iterations, while the Linux Release runner first ran past the cap and,
with a larger cap, settled on a folded state that the kink check
correctly rejected.

CD_HermiteCable_Static_Solve_AutoMesh takes an optional max_elements, a
lower element limit than 8192 (the default and every caller are
unchanged). The case now refines 60 elements of 1.67 m with EI = 5
under a limit of 900: the bending-length rule asks for 16 children
everywhere (960 elements), the elements about the sag keep their 16 by
h*kappa and the rest take 8, giving 768 elements in 85 Newton
iterations against a cap of 300.

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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 01d6411b00

ℹ️ 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 cd1aaa5 into dev Oct 20, 2026
15 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the fix/statics-refine-attach branch October 20, 2026 09:46
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