FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0390 — Cats mode: Net/NetStructure starts a refined cable's inner new nodes at the wrong place
ID 0390
Class BUG
Severity 1
Status blocked

Models: Net/NetStructure

Found: 2026-10-15, feature net-mesh (plan E10, owner question N3), at 7b7bd43

Decision needed: fix the Cats-mode initial condition (and which rule: interpolate each new node once from the original end nodes and its offset), or leave Cats mode (FoldingPointRefinement="1", used by no input in the codebases) as it is. Owner ruling 2026-10-15: no fix in E10.

Evidence

Cats mode (FoldingPointRefinement="1") splits a cable with NoOfFoldingPoints = n into n + 1 parts (NetStructureSpec::DivideCableElement, src/net/NetStructureSpec.cpp:578-664). Each new part gets m_fromNodes = the original end nodes and m_nodeOffset = its new node's place along the original cable; the shortened original keeps what the last NetCableElementSpec::Divide set (NetCableElementSpec.cpp:176-183): m_fromNodes = (its first node, the previous new node) and m_nodeOffset = the last split distance.

NetStructure::InitialConditionSetup (src/net/NetStructure.cpp:224-293) sets each cable's undefined (NaN) end node to from_0 * blend + (1 - blend) * from_1 with blend = 1 - m_nodeOffset, for both ends with the same blend (:262-279), and a later cable overwrites an earlier one's value. For the test net tests/in/NetSpec/FoldingPointNet.xml (node 0 at x = 0, node 1 at x = 3, two folding points; refined mesh in FoldingPointNet_refined.txt):

  • cable 0 (0-4, from (0, 3), offset 1/2): node 4 from NaN node 3, so 0;
  • cable 2 (3-1, from (0, 1), offset 2/3): node 3 at x = 2 (right);
  • cable 3 (4-3, from (0, 1), offset 1/3): node 4 at x = 1 (right), then node 3 with the same blend at x = 1 (wrong; it overwrites x = 2).

Both new nodes start at x = 1: a zero-length element 4-3 and a part twice its length.

Effect

A Cats-mode net starts with its folding-point nodes bunched, not spread along the cable: wrong initial geometry, large initial tensions in the stretched part. With three or more folding points other inner nodes are hit the same way. No input in ME, fishery or trawlwriter sets FoldingPointRefinement="1"; nets with the default refinement are not affected (they set NaN states to 0).

Possible fix

Give each new node its position once, from its own cable part: the node at m_conn[0] of each new part, from m_fromNodes and m_nodeOffset (and leave m_conn[1] to the part that owns it), or let DivideCableElement record for each new node its original end nodes and offset and let InitialConditionSetup loop over the nodes.

Test that would prove it

NetStructure.DISABLED_CatsMode_NewNodesStartBetweenTheOriginalEndNodes_MARE0390 (tests/NetSpec_Test.cpp): red at 7b7bd43 (node 3: expected x = 2, got 0.99999999999999978). Run it with --gtest_also_run_disabled_tests; enable it with the fix.

Risk

Low: only Cats mode, which no shipped input uses. The refined-mesh pin FoldingPointNet_refined.txt keeps the spec's values unless the fix changes DivideCableElement.