Skip to content

Commit

Permalink
#1477 only call IDAGetSens if calculating sensitivities
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjrobins committed Jun 14, 2021
1 parent 47c5345 commit b3a3091
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pybamm/solvers/c_solvers/idaklu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,9 @@ Solution solve(np_array t_np, np_array y0_np, np_array yp0_np,

if (retval == IDA_TSTOP_RETURN || retval == IDA_SUCCESS || retval == IDA_ROOT_RETURN)
{
IDAGetSens(ida_mem, &tret, yyS);
if (number_of_parameters > 0) {
IDAGetSens(ida_mem, &tret, yyS);
}

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

0 comments on commit b3a3091

Please sign in to comment.