FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0029 — The Sundials summary logs the model's resolved solver type (DenseLU) as the linear solver while SUNDIALS runs SPGMR
ID 0029
Class BUG
Severity 1
Status ready

Models: —

Found: 2026-09-27, while diagnosing FHSIM-0028 against e0bbf4ea

Decision needed: —

Evidence

src/engine/integrator/sundials/FhIntegratorSundials.cpp:324-337: when the configured SUNDIALS linear solver is "SPGMR" and the model has a Jacobian system, linResolved is replaced by the name of the model's ResolveLinearSolverType() (DenseLU, SparseLU, BiCGSTAB, ...). :352 prints it as Linear solver : <linResolved>. For a DenseLU model that type is not used: SPGMR runs, SetupSpgmrPreconditioner returns no preconditioner for it (SundialsSolverBuilder.cpp:136-137), and :353 prints Preconditioner : none.

Observed on the fhsim_marine_elements S6 model (<Integrator Method="BDF">, no <LinearSolver>):

[Info] Method : cvodes/BDF
[Info] Jacobian type : dense
[Info] Linear solver : DenseLU
[Info] Preconditioner : none

SUNDIALS was running unpreconditioned SPGMR with maxl 5 (FHSIM-0028).

Effect

The log reads as a direct dense LU solve. A user looking for the reason BDF steps collapse is pointed away from the cause, because "DenseLU" with "Preconditioner: none" looks consistent.

Possible fix

Print the SUNDIALS linear solver that was created (SPGMR, DENSE, BAND), with maxl for SPGMR, and name the model's resolved type separately, e.g. Linear solver : SPGMR (maxl 5, unpreconditioned); model solver type DenseLU. Log a warning on the silent unpreconditioned path in SetupSpgmrPreconditioner (:136-137), as the other unpreconditioned paths already do. Log text only; no numerical change.

Test that would prove it

Run a dense-model BDF case without <LinearSolver> and assert that the log names SPGMR, not DenseLU, as the linear solver.

Risk

Low: log text only. A test or script that matches the old Linear solver : DenseLU line would need updating.