Skip to content

Commit

Permalink
Update IDAKLUSolverOpenMP.inl
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcBerliner committed Sep 19, 2024
1 parent 76dcc71 commit 75ca46b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pybamm/solvers/c_solvers/idaklu/IDAKLUSolverOpenMP.inl
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,10 @@ void IDAKLUSolverOpenMP<ExprSet>::Initialize() {
// Determine if the system is an ODE
is_ODE = number_of_states > 0;
for (int ii = 0; ii < number_of_states; ii++) {
const bool id_i = id_np_val[ii];
id_val[ii] = id_i;
is_ODE &= id_i;
id_val[ii] = id_np_val[ii];
// check if id_val[ii] approximately equals 1 (>0.999) handles
// cases where id_val[ii] is not exactly 1 due to numerical errors
is_ODE &= id_val[ii] > 0.999;
}

// Variable types: differential (1) and algebraic (0)
Expand Down

0 comments on commit 75ca46b

Please sign in to comment.