Skip to content

Commit

Permalink
fix explicit Euler
Browse files Browse the repository at this point in the history
  • Loading branch information
slayoo committed May 10, 2021
1 parent 834ea1f commit d26088b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions PySDM/backends/numba/impl/_chemistry_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ def oxidation_body(n_sd, cell_ids, do_chemistry_flag, explicit_euler, pH2H,
):
continue

explicit_euler(moles_O3[i:i+1], a, dconc_dt_O3)
explicit_euler(moles_S_IV[i:i+1], a, dconc_dt_S_IV)
explicit_euler(moles_S_VI[i:i+1], a, dconc_dt_S_VI)
explicit_euler(moles_H2O2[i:i+1], a, dconc_dt_H2O2)
moles_O3[i] = explicit_euler(moles_O3[i], a, dconc_dt_O3)
moles_S_IV[i] = explicit_euler(moles_S_IV[i], a, dconc_dt_S_IV)
moles_S_VI[i] = explicit_euler(moles_S_VI[i], a, dconc_dt_S_VI)
moles_H2O2[i] = explicit_euler(moles_H2O2[i], a, dconc_dt_H2O2)

# @numba.njit(**{**conf.JIT_FLAGS, **{'parallel': False}}) # TODO #440
def chem_recalculate_drop_data(self, dissociation_factors, equilibrium_consts, cell_id, pH):
Expand Down
3 changes: 1 addition & 2 deletions PySDM/backends/numba/impl/_physics_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def __init__(self):

@numba.njit(**{**conf.JIT_FLAGS, 'fastmath': self.formulae.fastmath})
def explicit_euler_body(y, dt, dy_dt):
for i in prange(y.shape[0]):
y[i] = explicit_euler(y[i], dt, dy_dt)
y[:] = explicit_euler(y, dt, dy_dt)
self.explicit_euler_body = explicit_euler_body

@numba.njit(**{**conf.JIT_FLAGS, 'fastmath': self.formulae.fastmath})
Expand Down

0 comments on commit d26088b

Please sign in to comment.