From 2e891861a2b514d0f6b19e4c6e700fbdef76cf20 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Mon, 4 Sep 2023 11:03:02 +0100 Subject: [PATCH] Fix subgrid arg for CLI --- gprMax/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gprMax/config.py b/gprMax/config.py index 8d589a56..f9b1dcf8 100644 --- a/gprMax/config.py +++ b/gprMax/config.py @@ -262,8 +262,9 @@ class SimulationConfig: # Add pyopencl available device(s) self.devices["devs"] = detect_opencl() - self.general["subgrid"] = self.args.subgrid - if self.args.subgrid: + # Subgrids + try: + self.general["subgrid"] = self.args.subgrid # Double precision should be used with subgrid for best accuracy self.general["precision"] = "double" if (self.general["subgrid"] and self.general["solver"] == "cuda") or ( @@ -273,6 +274,8 @@ class SimulationConfig: "You cannot currently use CUDA or OpenCL-based " "solvers with models that contain sub-grids." ) raise ValueError + except AttributeError: + self.general["subgrid"] = False # Scenes parameter may not exist if user enters via CLI try: