From 7d89bd2fa2c518b5f54b181d2717b57b3c646d0f Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Sun, 8 Nov 2026 16:57:51 +0900 Subject: [PATCH 1/3] perf(multibody): full Newton for cables in the monolithic step With OPTIONS modified_newton True every finite-EI cable reused its tangent within a step. A cable in the monolithic step of the multibody march is restored and stepped again from the same start at every coupling iteration, and there the reuse cost more than it saved: mixed_body_rods_points.dat ran in 7.0 s with the option against 5.8 s without (5.7-6.3 s with the cables alone kept on full Newton). Such a cable now keeps full Newton; the other solvers of the deck keep the option. The deck runs in 5.6 s with it. The documented trade-off of the option is measured again on the examples (one thread): 4-20 % faster on finite-EI cables, free-hanging or with a touchdown; 12 % slower on an EI = 0 cable laid on a frictional seabed in a current (a 600 s march), within a few per cent elsewhere on EI = 0 systems. The former "about 1.5 times slower on finite-EI lines on the seabed" no longer holds: the touchdown decks run 4-12 % faster with it. Results without the option are unchanged. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 6 ++++++ doc/options.rst | 12 ++++++++---- src/CableDyn_DeckDriver.f90 | 8 ++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3549554..97cda7fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,12 @@ All notable changes to CableDyn are recorded in this file. The format follows The touchdown element now takes the reaction of its grounded stretch, from the grounded node to the touchdown point located from the two nodes' clearances: the error falls at the second order (2.1, 0.7, 0.2 N) and the outputs vary continuously. +### Changed + +- With `modified_newton True`, a finite-EI cable in the monolithic step of the multibody march + keeps full Newton: it is stepped again from the same start at every coupling iteration, where + reuse cost more than it saved (`mixed_body_rods_points.dat` with the option: 7.0 s, now 5.6 s). + The documented speed trade-off of the option is measured again on the examples. ## [0.4.1] - 2026-11-08 diff --git a/doc/options.rst b/doc/options.rst index ca74bbde..e9223ba2 100644 --- a/doc/options.rst +++ b/doc/options.rst @@ -355,10 +355,14 @@ rejected as unknown. The dynamic Newton controls are set with ``dynamic_solver`` - ``False`` - ``True`` enables guarded within-step tangent reuse on every dynamic solver the deck builds. It does not relax convergence tolerances and should be qualified against full Newton. - Measured against full Newton: 8-12 % faster on free-hanging finite-EI cables (lazy wave, - buoyed cable), about 1.5 times slower on finite-EI lines on the seabed (contact fails the - reuse contraction test and rebuilds the tangent), 3 % slower to 5 % faster on ``EI = 0`` - systems; + Measured against full Newton on the example decks (one thread): 4 to 20 % faster on + finite-EI cables, free-hanging or with a touchdown (lazy waves in waves, current and vessel + motion, a buoyed cable, rods on a spar); 12 % slower on an ``EI = 0`` cable laid on a + frictional seabed in a current, whose stick-slip friction makes a reused tangent take more + iterations; within a few per cent elsewhere on ``EI = 0`` systems. A finite-EI cable in + the monolithic step of the multibody march keeps full Newton, as it is stepped again from + the same start at every coupling iteration (reuse there made ``mixed_body_rods_points.dat`` + 7.0 s against 5.8 s); results move at the solver tolerance (Bergdahl mean cycle maxima within 0.16 %) - both - ``False modified_newton`` diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index bb3317d5..3350668b 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -22586,6 +22586,14 @@ SUBROUTINE write_multibody_dynamic_out(deck_path, out_root, channels, types, bod mb%cab_imp(c) = mb%cab_imp(c) .OR. attachment_moves(mb%cab_kind_b(c), mb%cab_obj_b(c)) IF (mb%cab_imp(c)) mb%cables(c)%tol = MIN(mb%cables(c)%tol, CLAMPED_CABLE_TOL) END IF + ! A cable in the monolithic step is restored and stepped again from the same start at every + ! coupling iteration; within-step tangent reuse (OPTIONS modified_newton) made each of those + ! steps dearer than a full Newton one (mixed_body_rods_points.dat: 7.0 s against 5.8 s), so + ! such a cable keeps full Newton; the other solvers of the deck keep the option. + IF (mb%cab_imp(c) .AND. opts%dynamic_modified_newton) THEN + CALL CD_HFMF_Set_ModifiedNewton(mb%cables(c), .FALSE., ErrStat, ErrMsg) + IF (ErrStat /= CD_HFMF_OK) GOTO 900 + END IF END DO ALLOCATE (mb%cable_points(2, SIZE(cab_lines))) DO c = 1, SIZE(cab_lines) From d8e361bec8b924b729ee3fac0fe6972e28a5637e Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Sun, 8 Nov 2026 19:34:19 +0900 Subject: [PATCH 2/3] chore(changelog): the entry moves to the batch changelog change The [Unreleased] entries of the open changes are added together in one change, so that they do not conflict with each other. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97cda7fb..e3549554 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,12 +18,6 @@ All notable changes to CableDyn are recorded in this file. The format follows The touchdown element now takes the reaction of its grounded stretch, from the grounded node to the touchdown point located from the two nodes' clearances: the error falls at the second order (2.1, 0.7, 0.2 N) and the outputs vary continuously. -### Changed - -- With `modified_newton True`, a finite-EI cable in the monolithic step of the multibody march - keeps full Newton: it is stepped again from the same start at every coupling iteration, where - reuse cost more than it saved (`mixed_body_rods_points.dat` with the option: 7.0 s, now 5.6 s). - The documented speed trade-off of the option is measured again on the examples. ## [0.4.1] - 2026-11-08 From 3e1c3c4b651f7904ca828cd42a5752c51dad4599 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Sun, 8 Nov 2026 22:22:42 +0900 Subject: [PATCH 3/3] perf(multibody): the full-Newton override only on the monolithic march The staggered march (bodyScheme staggered) steps each cable once per step, without the repeated coupling iterations that make tangent reuse dearer, so a cable attached to a moving object keeps OPTIONS modified_newton there. Signed-off-by: Jae Hoon Seo --- src/CableDyn_DeckDriver.f90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index 3350668b..f620ab90 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -22589,8 +22589,9 @@ SUBROUTINE write_multibody_dynamic_out(deck_path, out_root, channels, types, bod ! A cable in the monolithic step is restored and stepped again from the same start at every ! coupling iteration; within-step tangent reuse (OPTIONS modified_newton) made each of those ! steps dearer than a full Newton one (mixed_body_rods_points.dat: 7.0 s against 5.8 s), so - ! such a cable keeps full Newton; the other solvers of the deck keep the option. - IF (mb%cab_imp(c) .AND. opts%dynamic_modified_newton) THEN + ! such a cable keeps full Newton; the other solvers of the deck keep the option. The + ! staggered march (bodyScheme staggered) steps each cable once per step and keeps it. + IF (mb%implicit .AND. mb%cab_imp(c) .AND. opts%dynamic_modified_newton) THEN CALL CD_HFMF_Set_ModifiedNewton(mb%cables(c), .FALSE., ErrStat, ErrMsg) IF (ErrStat /= CD_HFMF_OK) GOTO 900 END IF