From 5c9d8585751d315e737af6da326b25901a8a3ee2 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Thu, 25 Feb 2016 15:08:33 +0000 Subject: [PATCH] Added check for at least one cell in every domain dimension. --- gprMax/input_cmds_singleuse.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gprMax/input_cmds_singleuse.py b/gprMax/input_cmds_singleuse.py index 56a317cd..4b5e1fda 100644 --- a/gprMax/input_cmds_singleuse.py +++ b/gprMax/input_cmds_singleuse.py @@ -104,6 +104,8 @@ def process_singlecmds(singlecmds, multicmds, G): G.nx = round_value(tmp[0]/G.dx) G.ny = round_value(tmp[1]/G.dy) G.nz = round_value(tmp[2]/G.dz) + if G.nx == 0 or G.ny == 0 or G.nz == 0: + raise CmdInputError(cmd + ' requires at least one cell in every dimension') if G.messages: print('Domain size: {:g} x {:g} x {:g}m ({:d} x {:d} x {:d} = {:g} cells)'.format(tmp[0], tmp[1], tmp[2], G.nx, G.ny, G.nz, (G.nx * G.ny * G.nz))) # Guesstimate at memory usage