avoid zero division if source rate of previous result is zero (#3169)

This commit is contained in:
Lorenzo Chierici 2024-10-14 21:47:22 +02:00 committed by GitHub
parent 8263f05e7e
commit dcb25575ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -754,8 +754,9 @@ class Integrator(ABC):
rates = res.rates[0]
k = ufloat(res.k[0, 0], res.k[0, 1])
# Scale reaction rates by ratio of source rates
rates *= source_rate / res.source_rate
if res.source_rate != 0.0:
# Scale reaction rates by ratio of source rates
rates *= source_rate / res.source_rate
return bos_conc, OperatorResult(k, rates)
def _get_start_data(self):