Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,48 @@ All notable changes to CableDyn are recorded in this file. The format follows
turning by 2.3° per step and paid out at 0.05 m/s, the sub-stepped march equals one taken as
given at a quarter of the step to 3e-8 N; applying the whole change in the first sub-step
departs from it by 22 N.
- Failure messages are no longer cut off by fixed-size buffers. The tensile qualification
failure of a dynamic step ended mid-advice (`... at element 64, xi= 0.5000; increase`) because
the buffers that carried it from the Hermite cable through the OpenFAST module and the deck
driver held 200, 300 and 256 characters. Every message buffer of the solver chain, the
C API handle (now 4096 characters; `CableDyn_GetLastError` still truncates to the caller's
buffer, and the Python binding reads 4097 bytes), the standalone driver and the OpenFAST
glue is now long enough for the longest diagnostic. A list that can outgrow its buffer (the
seed notes of a failed `EI = 0` static solve, the initialisation notes of a line) ends with
"further ... notes omitted" instead of stopping mid-note. Results do not change.
- A neutrally buoyant line is named as such. A finite-EI line whose net weight is zero and that
is longer than its span was reported as "the net-heavy line is too long for its span to hang
as a catenary", which is not the cause; the message now says the line is weightless, has no
catenary, and could only bow under axial compression, and advises shortening it to its span
or giving it weight or tension. An `EI = 0` line type rejected as net-buoyant (dry mass not
above the displaced water mass, the unchanged rule) whose mass lies within a relative 1e-6 below
the displaced mass is now named neutrally buoyant, "weightless and slack: its static shape is
indeterminate", with the advice to give it weight or a finite EI and a tension. The Python deck
reader words it the same way. No line type is accepted or rejected differently.
- A line stretched far beyond its elastic range now says so. A line 50 % shorter than its span
converged at 100 % strain and 1.2 GN with no message, because `maxStrain` guards only the
dynamics. The initialisation report notes the static fairlead strain (tension over the EA of
the End A section) of every line, `EI = 0` or finite-EI, above `maxStrain` when the option
is given and positive, and above 10 % otherwise (`0 maxStrain` disables only the dynamic
guard). Only a note: the equilibrium and the outputs are unchanged.
- A section too coarse for its line is warned about. The coarse-mesh warning fired only for a line
with fewer than three segments in all, so a 100 m one-segment top section on a 520 m line
(fairlead tension off by 50 %) passed silently. Every section whose segments are longer than
1/8 of the line (coarser than a uniform eight-segment line, however the line is split into
sections) now gets a warning, for `EI = 0` and finite-EI lines, in the single-topology driver
and in the standalone mixed route. No example deck is affected.
- Rejection messages name the unsupported capability and the workaround. An `EI = 0` line
between two Coupled points suggests splitting it at a `Connect` point, and a finite-EI one,
which that split does not admit, says to anchor it or model the span with `EI = 0` lines; a
finite-EI cable ending on a `Connect`/`Free`/`Coupled` point, or on a Coupled End A that a deck
with `Connect`/`Free` points cannot drive (it would need `motionFile` coupling), names the point
and what the route supports; the "this coupled mode runs the mooring in
STILL WATER" rejection of deck waves or current now names the route that rejects it (a
standalone mixed deck, which is not coupled, or FAST.Farm) and gives that route's remedy (an
all-`EI = 0` or all-finite-EI deck, or OpenFAST with SeaState; in FAST.Farm, removing the
OPTION); an anchor below the seabed by more than the
tolerance gives the depth, the tolerance rule, and the Z to use. These messages change no
acceptance rule.
- The development environment (`environment.yml`) excludes OpenBLAS 0.3.34, which caused the
access violation in the modal analysis tests listed under Known issues for 0.1.1. On AMD
Zen 4 and Zen 5 CPUs that expose AVX-512, OpenBLAS 0.3.34 enlarges the GEMM blocking,
Expand Down
58 changes: 58 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2195,6 +2195,64 @@ add_test(NAME driver_lazy_wave_planar_refined_att_quiet
set_tests_properties(driver_lazy_wave_planar_refined_att_quiet PROPERTIES
LABELS "fortran;driver;integration;static")

# Diagnostics that name the cause and the remedy. Each deck below was rejected by a message that
# named the wrong cause or none, or ran with no warning, before the message was written.
function(cabledyn_msg_test name deck rc must_match must_not)
add_test(NAME driver_msg_${name}
COMMAND ${CMAKE_COMMAND} -DDRIVER=$<TARGET_FILE:cabledyn> -DEXPECT_RC=${rc}
"-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/tests/data/${deck}|msg"
"-DMUST_MATCH=${must_match}" "-DMUST_NOT=${must_not}"
-DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/driver_msg_${name}
-P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake)
set_tests_properties(driver_msg_${name} PROPERTIES LABELS "fortran;driver;integration;static")
endfunction()
# A neutrally buoyant finite-EI line longer than its span has no catenary and no tension-only bow.
cabledyn_msg_test(weightless_finite_ei msg_weightless_finite_ei.dat 2
"weightless .neutrally buoyant. line is longer than its span;shorten the line to its span, or give it net weight"
"net-heavy")
# An EI=0 line type rejected as net-buoyant whose mass is a relative 4e-9 below the displaced water
# mass is named weightless and slack; one a relative 2e-6 below it keeps the plain message.
cabledyn_msg_test(weightless_ei0 msg_weightless_ei0.dat 1
"is neutrally buoyant .its dry mass equals the displaced water mass to within a relative 1e-6.;weightless and slack: its static shape is indeterminate"
"")
cabledyn_msg_test(net_buoyant_ei0 msg_net_buoyant_ei0.dat 1
"is net-buoyant .dry mass <= displaced water mass.: buoyant / lazy-wave sections require a dynamic finite-EI deck"
"weightless")
# A line half the length of its span converges at 100 % strain; the static solve says so.
cabledyn_msg_test(static_strain msg_static_strain.dat 0
"Note: LINE 1 is stretched to a static strain of 100.0 % at the fairlead;above 10.0 % .the note level used without maxStrain." "")
# A 100 m one-segment top section of a 520 m line.
cabledyn_msg_test(coarse_section msg_coarse_section.dat 0
"WARNING: LINE 1 section of type \"chain\" .100.00 m in 1 segment.s.. has segments of 100.00 m, 19.2 %" "")
# A well-meshed line with a modest stretch raises neither.
cabledyn_msg_test(quiet_catenary ../../examples/chain_catenary_r3_100m.dat 0 ""
"static strain;too coarse to follow")
cabledyn_msg_test(shared_line msg_shared_line.dat 1
"LINE 1 End B .NodeB, POINT 2, coupled. must be a Fixed .anchor. point;Workaround for this EI=0 line: split it into two lines that meet at a Connect point"
"cannot be split")
# A finite-EI shared line cannot be split at a Connect point: that advice is not given.
cabledyn_msg_test(shared_line_finite_ei msg_shared_line_finite_ei.dat 1
"finite-EI LINE 1 End B .NodeB, POINT 2, coupled. must be a Fixed .anchor. point;A finite-EI line cannot be split at a Connect point either;anchor it on a Fixed point"
"Workaround")
cabledyn_msg_test(pliant_connect_end_b msg_pliant_connect_end_b.dat 1
"finite-EI LINE 1 in a mixed-topology deck needs a Fixed End B;End B is POINT 2 .connect.;Anchor the cable on a Fixed point"
"")
cabledyn_msg_test(mixed_current msg_mixed_current.dat 1
"the deck current OPTION is not supported for a standalone mixed EI=0/finite-EI deck;runs the mooring in STILL WATER;couple the deck to OpenFAST .CompMooring = 5. with SeaState"
"this coupled mode;the C API;FAST.Farm")
cabledyn_msg_test(mixed_connect_coupled_cable msg_mixed_connect_coupled_cable.dat 1
"finite-EI LINE 3: a Coupled/Vessel End A .POINT 1. would need motionFile coupling to drive it;remove the Connect/Free points;held still .that route takes no motionFile either."
"is driven by a motionFile")
# The standalone mixed route warns about a coarse section and notes a static strain above maxStrain.
cabledyn_msg_test(mixed_coarse_strain msg_mixed_coarse_strain.dat 0
"WARNING: LINE 1 section of type \"chain\" .150.00 m in 1 segment.s.. has segments of 150.00 m, 17.6 %;Note: LINE 1 is stretched to a static strain of;above 1.00E-02 % .OPTION maxStrain."
"LINE 2 section of type")
# The tensile qualification failure of a dynamic step names the remedy to the end (the message was
# cut at 256 characters: "... at element 64, xi= 0.5000; increase").
cabledyn_msg_test(tensile_safety_whole msg_tensile_safety_truncated.dat 2
"tensile qualification failed;at element 64, xi= 0.5000; increase tensile_strain_tolerance only with an engineering basis, or use warn mode" "")
cabledyn_msg_test(anchor_below_seabed msg_anchor_below_seabed.dat 1
"POINT 2 .Fixed. lies below the seabed;by 1.00E-02 m, more than the 1.00E-03 m seabed tolerance;Set the anchor Z to -100.00000 m" "")
if(WIN32 AND CABLEDYN_RUNTIME_DLLS)
add_test(
NAME windows_install_runtime
Expand Down
12 changes: 6 additions & 6 deletions app/cabledyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ PROGRAM cabledyn
LOGICAL :: converged, has_dtm, has_tmax, has_motion_file, has_line_outputs, has_objects
! the run-time profile includes the finite-EI cable step counters (not on the mixed route)
LOGICAL :: profile_cable_detail = .FALSE.
! Sized for the aggregate and deck-driver messages it relays (512-character buffers
! plus deck-line context), so no diagnostic is cut short.
CHARACTER(1024) :: ErrMsg
! Sized for the aggregate and deck-driver messages it relays (built in buffers of up to
! 2048 characters, plus deck-line context), so no diagnostic is cut short.
CHARACTER(4096) :: ErrMsg

nargs = COMMAND_ARGUMENT_COUNT()

Expand Down Expand Up @@ -450,7 +450,7 @@ SUBROUTINE run_mixed_held_deck(deck, root, dt, has_dt, run_time, has_run_time, h
INTEGER :: es, n_moving, nstep, step, n_iter, miss_count, consecutive_miss, max_consecutive_miss
INTEGER :: unit, ios
LOGICAL :: step_converged, stalled, file_open
CHARACTER(512) :: em
CHARACTER(4096) :: em
CHARACTER(4096) :: static_path, dynamic_path
TYPE(StandaloneProgress) :: progress

Expand Down Expand Up @@ -697,8 +697,8 @@ SUBROUTINE print_mixed_initialization(aggregate, stat, msg)
CHARACTER(*), INTENT(OUT) :: msg
INTEGER :: n_lines, n_points, n_sections, n_ei0, n_finite, i, line_id, es
REAL(wp) :: tension, force(3), inclination, declination, azimuth
CHARACTER(512) :: em
CHARACTER(1024) :: note
CHARACTER(4096) :: em
CHARACTER(2048) :: note

CALL CD_AGG_GetInitMetadata(aggregate, n_lines, n_points, n_sections, n_ei0, n_finite, es, em)
IF (es /= CD_AGG_OK) THEN
Expand Down
8 changes: 4 additions & 4 deletions doc/capi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ A step that finishes without meeting the Newton tolerance still returns ``CD_C_O
Diagnostics
~~~~~~~~~~~

Each handle keeps the text of its last failure, up to 1024 characters. The message is set by a
Each handle keeps the text of its last failure, up to 4096 characters. The message is set by a
failing call on a valid handle and cleared by a successful one. ``CableDyn_GetLastError`` does
not change it, and neither does ``CableDyn_IsInitialized``. A call rejected with
``CD_C_BAD_HANDLE`` has no handle to store a message in. ``CableDyn_GetLastError`` on such a
Expand Down Expand Up @@ -1688,7 +1688,7 @@ before the copy and stay zero if the call fails. The model is not changed.
- --
- --
- buffer capacity in bytes. A value below 1 makes the call a no-op. A message is at most
1024 characters, so a buffer of 1025 bytes always holds the full message and its
4096 characters, so a buffer of 4097 bytes always holds the full message and its
terminating ``NUL``.

State and size queries
Expand Down Expand Up @@ -1979,7 +1979,7 @@ surges ±0.05 m with a 10 s period. The program needs no input file.

static int report(void *h, const char *where, int err)
{
char msg[1024];
char msg[4097]; /* a message is at most 4096 characters, plus the NUL */
CableDyn_GetLastError(h, msg, (int)sizeof msg);
fprintf(stderr, "%s failed (status %d): %s\n", where, err, msg);
return 1;
Expand Down Expand Up @@ -2066,7 +2066,7 @@ host writes its own motion into the blocks of the points it drives before each s
int major, minor, patch, abi, err = CD_C_OK, status = 1;
void *h = NULL;
double *q = NULL, *v = NULL, *a = NULL, *loads = NULL;
char msg[1024];
char msg[4097]; /* a message is at most 4096 characters, plus the NUL */

CableDyn_GetVersion(&major, &minor, &patch, &abi);
if (abi != CABLEDYN_CAPI_ABI_VERSION) {
Expand Down
2 changes: 1 addition & 1 deletion doc/coupling_boundary.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Rules shared by every entry point:
xyz triples; connectivity and fixed-DOF indices are 1-based.
- Calls with an `err_stat` argument return `CD_C_OK`, `CD_C_BAD_HANDLE`, `CD_C_ALLOC_FAIL`,
`CD_C_BAD_INPUT`, `CD_C_SOLVE_FAIL`, or `CD_C_NOT_INITIALIZED`. Diagnostics are kept per handle
(up to 1024 characters) and copied by `CableDyn_GetLastError`.
(up to 4096 characters) and copied by `CableDyn_GetLastError`.
- `CableDyn_NPoints` returns the column count expected by `CableDyn_UpdatePointFluidFields`; it
can exceed `NCoupledDOF/3` when a deck has output-only fixed or coupled points.
- Deck initialisation is transactional: a failed `CableDyn_InitDeck` or `CableDyn_InitDeckAt`
Expand Down
7 changes: 5 additions & 2 deletions doc/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,11 @@ rejected as unknown. The dynamic Newton controls are set with ``dynamic_solver``
strain of steel, polyester, and nylon lines), stops the run with exit code 2 and a message
naming the line, element, strain, estimated elastic tension, and time. It catches a
numerically unstable march whose Newton residual still converges; a physical run never
reaches the default. Finite-EI cables are guarded by ``tensile_safety`` instead
- both (``EI = 0`` lines)
reaches the default. Finite-EI cables are guarded by ``tensile_safety`` instead. The static
solve is not stopped by it: when the static fairlead strain of any line, ``EI = 0`` or
finite-EI (tension over the EA of the End A section), exceeds this value, or 10 % when the
OPTION is not given or is ``0``, the run prints a ``Note`` and continues
- both for the dynamic guard (``EI = 0`` lines); standalone for the static note (every line)
- ``0.5 maxStrain``
* - ``dynamic_solver rel abs max_iter backtracks [rhoInf]``
- keyword-first record: two reals, two integers, optional real
Expand Down
Loading
Loading