Skip to content

Commit

Permalink
Update deprecated zeros_like usage (#916)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener committed Jun 22, 2023
1 parent 82fac8c commit 11472b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mirgecom/eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def dependent_vars(
temperature = self.temperature(cv, temperature_seed)
# MJA, it doesn't appear that we can have a None field embedded inside DV,
# make a dummy smoothness in this case
zeros = cv.array_context.zeros_like(cv.mass)
zeros = cv.array_context.np.zeros_like(cv.mass)
if smoothness_mu is None:
smoothness_mu = zeros
if smoothness_kappa is None:
Expand Down Expand Up @@ -265,7 +265,7 @@ def dependent_vars(
temperature = self.temperature(cv, temperature_seed)
# MJA, it doesn't appear that we can have a None field embedded inside DV,
# make a dummy smoothness in this case
zeros = cv.array_context.zeros_like(cv.mass)
zeros = cv.array_context.np.zeros_like(cv.mass)
if smoothness_mu is None:
smoothness_mu = zeros
if smoothness_kappa is None:
Expand Down
6 changes: 3 additions & 3 deletions mirgecom/gas_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ def make_fluid_state(cv, gas_model, temperature_seed=None,
dd=limiter_dd)

# FIXME work-around for now
smoothness_mu = (actx.zeros_like(pressure) if smoothness_mu
smoothness_mu = (actx.np.zeros_like(pressure) if smoothness_mu
is None else smoothness_mu)
smoothness_kappa = (actx.zeros_like(pressure) if smoothness_kappa
smoothness_kappa = (actx.np.zeros_like(pressure) if smoothness_kappa
is None else smoothness_kappa)
smoothness_beta = (actx.zeros_like(pressure) if smoothness_beta
smoothness_beta = (actx.np.zeros_like(pressure) if smoothness_beta
is None else smoothness_beta)

dv = GasDependentVars(
Expand Down

0 comments on commit 11472b4

Please sign in to comment.