feat(CVODE_Solver_Strategy): added non negative constraint to CVODE based abundance solver
this prevents abundance values from going negative which is non physical
This commit is contained in:
@@ -244,6 +244,9 @@ namespace gridfire {
|
||||
// If j is algebraic, we can return 0.0 since the Jacobian entry for algebraic species is always zero.
|
||||
return 0.0;
|
||||
}
|
||||
if (std::ranges::contains(m_algebraic_species_indices, i_full)) {
|
||||
return 0.0;
|
||||
}
|
||||
// Otherwise we need to query the full jacobian
|
||||
return m_baseEngine.getJacobianMatrixEntry(i_full, j_full);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user