From 2bc645b757c3f2834bb76d593581f9ff7abb972d Mon Sep 17 00:00:00 2001 From: Zhi Date: Wed, 31 Jul 2024 21:03:23 -0400 Subject: [PATCH] add try except for getting riemann solver --- pyro/compressible/simulation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyro/compressible/simulation.py b/pyro/compressible/simulation.py index 154f21754..7df36d008 100644 --- a/pyro/compressible/simulation.py +++ b/pyro/compressible/simulation.py @@ -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")