|
FhSim
3.1.0
Marine systems simulation
|
| ID | 0115 |
| Class | BUG |
| Severity | 1 |
| Status | ready |
Models: —
Found: 2026-10-25, plan Q1 (r2-wrong-numbers), observation 13.
src/fmu/fhFMUexport/FmuPortMappingReader.cpp:163: const int portSize = std::stoi(obj.Attribute("Size_" + portName));. stoi reads a numeric prefix, so Size_y="2x" gives 2 and Size_y="2.7" gives 2. A missing or non-numeric value throws std::invalid_argument without naming the object or port. The engine reads the same attribute strictly.
An exported FMU with a port of the wrong size from a mistyped input, with no message.
Parse with fhsim::strict (as Initial_ values now are, FHSIM-0112), require a whole number of 1 or more, and name the object, port and text in the error.
In tests/fmu/FmuPortMappingReader_test.cpp: Size_y="2x" throws std::runtime_error naming ExtLink, y and 2x.
Low. No consumer exports an FMU.