From b92a98f950709618263e8bde33e8b3118892bcf5 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Mon, 17 Aug 2020 18:10:00 +0100 Subject: [PATCH] Added error message for 2D models and sub-grids. --- gprMax/cmds_singleuse.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gprMax/cmds_singleuse.py b/gprMax/cmds_singleuse.py index 26b51328..92add6a0 100644 --- a/gprMax/cmds_singleuse.py +++ b/gprMax/cmds_singleuse.py @@ -121,6 +121,13 @@ class Domain(UserObjectSingle): G.calculate_dt() logger.info(f'Mode: {config.get_model_config().mode}') + + # Sub-grids cannot be used with 2D models. There would typically be + # minimal performance benefit with sub-gridding and 2D models. + if '2D' in config.get_model_config().mode and config.sim_config.general['subgrid']: + logger.exception('Sub-gridding cannot be used with 2D models') + raise ValueError + logger.info(f'Time step (at CFL limit): {G.dt:g} secs')