From c5be921f86018518041ff23cc83a60db7ab701c8 Mon Sep 17 00:00:00 2001 From: Hao-Wei Pang Date: Wed, 24 Jan 2024 13:43:29 -0500 Subject: [PATCH] fix --- src/Simulation.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Simulation.jl b/src/Simulation.jl index 480601e4..6d3547de 100644 --- a/src/Simulation.jl +++ b/src/Simulation.jl @@ -412,7 +412,9 @@ end export rops function getrate(rarray, cs, kfs, krevs, V, i) - if @inbounds rarray[2, i] == 0 + if @inbounds rarray[1, i] == 0 + fR = 0.0 + elseif @inbounds rarray[2, i] == 0 @inbounds @fastmath fR = kfs[i] * cs[rarray[1, i]] elseif @inbounds rarray[3, i] == 0 @inbounds @fastmath fR = kfs[i] * cs[rarray[1, i]] * cs[rarray[2, i]] @@ -421,7 +423,9 @@ function getrate(rarray, cs, kfs, krevs, V, i) else @inbounds @fastmath fR = kfs[i] * cs[rarray[1, i]] * cs[rarray[2, i]] * cs[rarray[3, i]] * cs[rarray[4, i]] end - if @inbounds rarray[6, i] == 0 + if @inbounds rarray[5, i] == 0 + rR = 0.0 + elseif @inbounds rarray[6, i] == 0 @inbounds @fastmath rR = krevs[i] * cs[rarray[5, i]] elseif @inbounds rarray[7, i] == 0 @inbounds @fastmath rR = krevs[i] * cs[rarray[5, i]] * cs[rarray[6, i]]