FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0027 — Three follow-ups left by the scalar-templated panel force core
ID 0027
Class ARCHITECTURE
Severity 1
Status ready
Models Net/NetStructure
Found 2026-09-22, on landing MARE-0026 (2ae2738)
Decision needed — (three independent tasks, each specified below; take them in any order)

MARE-0026 extracted the net panel force path into src/net/NetElement3NForces.h templated on the scalar type, and MARE-0004 closed with an exact panel Jacobian built on it. Three things were deliberately left out of that change because each carries its own verification burden. None is a regression; each is listed separately because they are unrelated.

(a) The panel Jacobian test still pins the checker's step

Evidence

tests/NetStructure_Jacobian_Test.cpp sets jacCfg.perturbationEps = 1e-5 in SimObject.NetStructure_PanelJacobian, against the checker's default of 1e-8.

Effect

The block under test is exact, so the only approximate side of the comparison is the checker's own central difference. PanelNet_Jacobian_in.xml has enough curvature that the reference is still dominated by rounding noise at 1e-8: sweeping the step gives absolute errors of 82271, 109.7, 1.097, 0.0486 and 0.597 at 1e-4 through 1e-8, so the accurate window is around 1e-5 to 1e-6 and the default sits past the bottom of the V. The test therefore verifies the block at a chosen step rather than at the checker's default, which is a weaker statement than the other Jacobian tests in this directory make.

Possible fix

  • (a) A lower-curvature fixture: the same panel topology at a modest twine strain and a modest inflow, so the reference's second-order error at 1e-8 falls below absTol. Then drop the perturbationEps line. This is the option MARE-0004 recorded as its (c).
  • (b) Keep the pin and accept it, documenting the sweep as the test already does.

Test that would prove it

SimObject.NetStructure_PanelJacobian passing with no perturbationEps override, at relTol = 1e-3 or tighter.

Risk

None to shipped code; this is a test fixture only.

(b) Three sibling panel classes still carry their own copy of the force arithmetic

Evidence

NetElement3NWithConstraints, NetElement3NWakeEffect and ScreenElement3N each contain their own copy of the twine tension, the Reynolds-dependent normal drag, the coordinate rotations and the damping, including their own m_meshOpeningAngle member — the same member whose removal from NetElement3N was a precondition for differentiating that class.

Effect

Four copies of one force law. A correction to the Ersdal-Faltinsen branch or to the drag saturation has to be made four times or the copies drift, which is how the NumElements/numElements drift in MARE-0006 happened. None of the three has a Jacobian of its own, so a net using them falls back to a numerical difference of the whole right-hand side.

Possible fix

Point each of the three at net_element_forces::AddNodeForces, extending PanelParams with the fields the variants add. net_element_forces::AddNodeForces was made a free function rather than a member for exactly this reason.

Test that would prove it

The same method that verified MARE-0026: a reference translation unit transformed by script from each class's pre-change source, compared against the shared core over randomised states and required to agree bit-for-bit, before anything else changes.

Risk

These are load-bearing force paths with no force test of their own in this repository, which is why the bit-for-bit comparison rather than a tolerance is the required evidence.

(c) The <tt>fhlib</tt> version floor is not enforced

Evidence

src/net/NetStructure.cpp includes sfh/ad/Dual.h, which is new in fhlib 4.3.0. conanfile.py does not require fhlib at all: it arrives transitively through fhsim, which requires fhlib/[^4.2.0]@sintef/stable.

Effect

The build resolves 4.3.0 only because that package happens to be present. A checkout that sees only 4.2.x fails at compile time with a missing header instead of at dependency resolution with a version message. The same applies to the several other sfh/... includes in this library, which have never been declared either; only the version floor is new.

Possible fix

  • (a) Raise fhsim's floor to fhlib/[^4.3.0]@sintef/stable. Done on the fhsim branch feature/require-fhlib-4.3.0 (commit aa0a831d), which is pushed but not merged. It must not merge before fhlib 4.3.0 is released, because until then the range resolves for nobody but a machine that built 4.3.0 locally. This part of the issue closes when that branch merges.
  • (b) Require fhlib directly here. This makes the existing sfh/... includes honest as well, but departs from the convention the rest of the tree follows.

Test that would prove it

A build against fhlib 4.2.x that fails during conan install with a version conflict rather than during compilation.

Risk

Option (b) adds a direct dependency edge; the resolved version does not change, since [^4.3.0] and fhsim's [^4.2.0] both select 4.3.0.