|
FhSim
3.1.0
Marine systems simulation
|
| ID | 0065 |
| Class | ARCHITECTURE |
| Severity | 1 |
| Status | ready |
Models: FlukeAnchor, TorpedoAnchor
Found: Deep review 2026-09-28, worktrees/nethydro/review/deep/other-hydro-forces.md P2 (performance), at 31210e5
Decision needed:
src/rigidbody/PolyplateEnvironmentForces.cpp:19: SplitPolygon does new double[n] / delete[] per call. :115-116 (CalcSoilforcesPolyplate): two std::vector<double>(numPoints + 40) on every call, also when the plate is far above the seabed, and two more (:122-123) when it touches.
Several small allocations per plate per right-hand side; measurable only in long anchor runs.
Fixed-size stack buffers (the polygon has at most numPoints + 4 points after two splits), or an early return when the plate's lowest point is above the seabed.
The allocations are not proven to matter (no timing), and the early return needs the plate's lowest point, new geometry code; the brief allows performance fixes only when bit-identical and certain, and the gain is unmeasured.
Bit-identical anchor outputs and a timing before and after.
Low.