Skip to content

Commit ab26c9c

Browse files
authored
make the assertion on rho, e more informative (compressible solvers) (#328)
1 parent 49f7447 commit ab26c9c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pyro/compressible/simulation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ def cons_to_prim(U, gamma, ivars, myg):
6565
out=np.zeros_like(U[:, :, ivars.iener]),
6666
where=(U[:, :, ivars.idens] != 0.0))
6767

68-
assert e.v().min() > 0.0
69-
assert q.v(n=ivars.irho).min() > 0.0
68+
e_min = e.v().min()
69+
rho_min = q.v(n=ivars.irho).min()
70+
71+
assert e_min > 0.0 and rho_min > 0.0, f"invalid state, min(rho) = {rho_min}, min(e) = {e_min}"
7072

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

0 commit comments

Comments
 (0)