From fa87b6c57adb0ed281ddf4f35c972315225e1fc4 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Mon, 4 Sep 2023 20:23:55 +0100 Subject: [PATCH] More work on setting precision with subgrids --- gprMax/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gprMax/config.py b/gprMax/config.py index f9b1dcf8..387888fb 100644 --- a/gprMax/config.py +++ b/gprMax/config.py @@ -263,7 +263,7 @@ class SimulationConfig: self.devices["devs"] = detect_opencl() # Subgrids - try: + if hasattr(self.args, "subgrid") and self.args.subgrid: self.general["subgrid"] = self.args.subgrid # Double precision should be used with subgrid for best accuracy self.general["precision"] = "double" @@ -274,7 +274,7 @@ class SimulationConfig: "You cannot currently use CUDA or OpenCL-based " "solvers with models that contain sub-grids." ) raise ValueError - except AttributeError: + else: self.general["subgrid"] = False # Scenes parameter may not exist if user enters via CLI