FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0052 — PortJacobianBlockChecker (and two tests) cast to ModelStructure instead of using IJacobianSystem::GetTopologyView
ID 0052
Class ARCHITECTURE
Severity 1
Status ready

Models: —

Found: 2026-10-20 architecture review (a406e955); owner ruled "default ok" on the whole plan 2026-10-20

Source plan: plans/arch-2026-10-20/not-implemented/f10-modelstructure-interface.md (workspace fhsim_workspace)

Kind: Bit for bit refactor. Take when passing; rides with: engine-graph phase 2 (checker); tests only if a touched file.

Evidence

src/testtools/PortJacobianBlockChecker.cpp:366:

auto* concreteModel = dynamic_cast<ModelStructure*>(model);

The checker needs the Jacobian assembler through the concrete class. IJacobianSystem::GetTopologyView() (src/engine/model/IJacobianSystem.h:118) already exposes the read-only topology.

Same pattern in tests (tests only): tests/integrator/linear/LinearSolverSelection_test.cpp:28,46,66,87 and tests/diagnostics/Diagnostics_JacobianTriggers_test.cpp:180 (its use is at :183; the plan quoted :183).

Effect

None for users. The cast ties the test tool to the concrete class that engine-graph phase 2 reshapes.

Possible fix

Use GetTopologyView() in the checker. For the tests, change them only when a touched file (the cast is harmless).

Test that would prove it

The existing port Jacobian checker tests and all downstream suites that use the checker.

Risk

Very low. Do it inside engine-graph phase 2 so the cast is changed once.