Skip to content

Commit

Permalink
make the assertion on rho, e more informative (compressible solvers) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Jan 24, 2025
1 parent 49f7447 commit ab26c9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyro/compressible/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ def cons_to_prim(U, gamma, ivars, myg):
out=np.zeros_like(U[:, :, ivars.iener]),
where=(U[:, :, ivars.idens] != 0.0))

assert e.v().min() > 0.0
assert q.v(n=ivars.irho).min() > 0.0
e_min = e.v().min()
rho_min = q.v(n=ivars.irho).min()

assert e_min > 0.0 and rho_min > 0.0, f"invalid state, min(rho) = {rho_min}, min(e) = {e_min}"

q[:, :, ivars.ip] = eos.pres(gamma, q[:, :, ivars.irho], e)

Expand Down

0 comments on commit ab26c9c

Please sign in to comment.