diff --git a/gprMax/input_cmds_geometry.py b/gprMax/input_cmds_geometry.py index 22688803..bad0d6a7 100644 --- a/gprMax/input_cmds_geometry.py +++ b/gprMax/input_cmds_geometry.py @@ -121,6 +121,10 @@ def process_geometrycmds(geometry, G): if data.dtype != 'int16': data = data.astype('int16') + # Check that there are no values in the data greater than the maximum index for the specified materials + if np.amax(data) > len(materials) - 1: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' found data value(s) ({}) in the geometry objects file greater than the maximum index for the specified materials ({})'.format(np.amax(data), len(materials) - 1)) + # Look to see if rigid and ID arrays are present (these should be # present if the original geometry objects were written from gprMax) try: