Skip to content

Commit

Permalink
add try except for getting riemann solver
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 committed Aug 1, 2024
1 parent 172f62c commit 2bc645b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyro/compressible/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ def initialize(self, extra_vars=None, ng=4):
my_data = self.data_class(my_grid)

# Make sure we use CGF for riemann solver when we do SphericalPolar
riemann = self.rp.get_param("compressible.riemann")
try:
riemann = self.rp.get_param("compressible.riemann")
except KeyError:
msg.fail("ERROR: Riemann Solver is not set.")

if my_grid.coord_type == 1 and riemann == "HLLC":
msg.fail("ERROR: Only CGF Riemann Solver is supported " +
"with SphericalPolar Geometry")
Expand Down

0 comments on commit 2bc645b

Please sign in to comment.