FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0429 — Cable/RigidBarCable ports return the buffers of the last OdeFcn, not the values at the state they are read at
ID 0429
Class BUG
Severity 2
Status ready

Models: Cable/RigidBarCable

Found: 2026-10-24 review of 7c147a4 (doc/reviews/fhsim_marine_elements-2026-10-24/), finding A4

Evidence

RigidBarCable::ForceA returns m_forceOutA without computing anything; OdeFcn is the only writer (and allocates scratch with new per call). A port read at a state other than the last OdeFcn (the Jacobian check, an output at a different time) gets stale values.

Effect

Output ports of the model lag the state in observers and in consumers that read at trial states.

Possible fix

Move the engine output to a common calculation (as Cable does with CalcOutput), call it from OdeFcn and the ports, and use member scratch instead of new per call.

Test that would prove it

A test that reads ForceA at two different states without an OdeFcn between.

Risk

Changes the values consumers see at trial states of an integration step; needs a baseline check of the fishery inputs that use the model (none found by grep).