FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Regression baselines

Status of every baseline below: reviewed and approved by the owner, 2026-09-25. Each one freezes what the code at the time produced, and the owner has confirmed the plots are correct. MARE-0032 is resolved; MARE-0033 stays open, narrowed to Cable/Branched, which has no baseline yet.

Each baseline is a gtest, SimObject.<ID>, that runs tests/in/<dir>/<ID>_in.xml with RunAndCompareRegressionXmlTiming (tests/TestUtils.h) and compares its output with <ID>_ref.csv under the limits in <ID>.ref, as SimObject.Disk does. Each page shows every compared output against time, says what should happen physically and checks the numbers against a hand calculation.

Object Issue Test and page Fixture Compared outputs Hand check
Net/Sphere MARE-0033 Sphere_Regression 1000 kg, 1 m sphere sinking from rest in a 0.5 m/s current, 5 s Position, Velocity RK4 of the drag law on the relative velocity: within 5e-7 m/s, 5e-6 m
Cable/LumpedMass MARE-0033 Cable_Regression 10 m cable, ends 8 m apart, 0.5 m/s cross current, 10 s Node states, ForceA, ForceB Sideways drag 76.4 N against 76.9 N; vertical end forces 375.2 N, 0.99 of the 380.4 N wet weight (380.4 N in still water)
RbCable/CableConnector MARE-0033 CableConnector_Regression 50 kg connector under a decaying and a constant end force, 5 s Pos, Vel, PosA, PosB Closed form: within 5e-7
TrawlBeam MARE-0033 TrawlBeam_Regression PID from rest to 1.5 m/s against a 2 × 2e4 N pull on a 0.3 rad track, 30 s States, ShipForce, tow-point positions Steady ShipForce 38212.7 N against 4e4 cos 0.3 = 38213.5 N
Net/NetStructure MARE-0032 (b) NetStructure_Regression 1 m² panel in a 0.5 m/s current, pulled 2 N upstream, 15 s Node positions and velocities Twine drag at the steady drift ≈ 2.0 C_n N against 2.03 N; without the pull the panel drifts at the current speed

Cable/Branched has no baseline yet: it waits for MARE-0036 and MARE-0037, whose answers change its numbers.

Defects the hand checks found, now fixed

Each fix regenerated the baselines it changed.

  • Cable/LumpedMass and Cable/Branched (MARE-0082): the end forces carried twice the cable's weight in water, as CableElBasics::CalcMassAndWeight gave each end node of an element the element's whole weight in water. Each node now carries half, as its mass already did.
  • Net/Sphere (MARE-0084) read the current but took its drag on its own velocity. It now uses the velocity relative to the water, as Net/Disk does, and its fixture has a current.
  • Net/NetStructure (MARE-0083): the panel drag scaled the water velocity, not the velocity relative to the net, by the Kristiansen-Faltinsen solidity factor (1.159 here), so a free panel drifted at 1.159 times the current. It now scales the relative velocity, and a free panel drifts at the current speed. Net/NetStructureWakeEffect and Net/NetStructureWithConstraints had the same defect and have the same fix.

Tolerance

The harness (FhSim TestResult::CompareRegression) supports one limit, output_rms_max: the root mean square over time of the difference between run and baseline, absolute, applied to every column of the output file alike. There is no relative limit and no per-column limit, and it compares whole files: the columns are chosen by the fixture's <FileOutput Select=...>, and every column of the file is compared.

Every baseline uses output_rms_max 1e-8, the owner's "slightly looser than Disk's 1e-10". The compared columns are SI values whose peaks are between 0.37 and 7.7e5 (the smallest are the net's y positions and the Cable node velocities), so 1e-8 absolute is at most about 3e-8 of any column's peak. FhSim writes the result file with e, seven significant digits, so a change of one unit in the last printed digit of one row already exceeds 1e-8 in every column above about 0.1: in practice each test passes only while the output is unchanged to printed precision, as Disk's does. A relative 1e-8 would be below that print resolution and could not be checked.

Checks made before freezing

  • Determinism: each fixture was run twice in separate processes, with identical result files.
  • Red: a 1 % change of one force coefficient fails each test (sphere drag coefficient, cable normal drag coefficient, connector gravity, TrawlBeam trawl force, net twine normal drag), with RMS differences of 1e-4 and more on the main columns, against the 1e-8 limit. A 1e-6 relative change of the sphere drag coefficient still fails, with RMS 4.9e-6 (in the still-water fixture before MARE-0084).
  • Jacobian: Sphere, CableConnector and TrawlBeam also run the default Jacobian check. Cable/LumpedMass and Net/NetStructure do not, see the comments in their tests.

Regenerating

Delete <ID>.ref and <ID>_ref.csv and run the test: the harness writes both again (ReferenceMode::CreateIfMissing), with output_rms_max 1e-10; set it back to 1e-8. Then rerun python3 tests/plot_baselines.py from the repository root, which rewrites the pages here and prints the hand checks.