Skip to content

Commit b3a3091

Browse files
committed
#1477 only call IDAGetSens if calculating sensitivities
1 parent 47c5345 commit b3a3091

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pybamm/solvers/c_solvers/idaklu.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,9 @@ Solution solve(np_array t_np, np_array y0_np, np_array yp0_np,
445445

446446
if (retval == IDA_TSTOP_RETURN || retval == IDA_SUCCESS || retval == IDA_ROOT_RETURN)
447447
{
448-
IDAGetSens(ida_mem, &tret, yyS);
448+
if (number_of_parameters > 0) {
449+
IDAGetSens(ida_mem, &tret, yyS);
450+
}
449451

450452
t_return[t_i] = tret;
451453
for (int j = 0; j < number_of_states; j++)

0 commit comments

Comments
 (0)