From c912b755ad0ab15dbaa883bb9346a7fe9036fc18 Mon Sep 17 00:00:00 2001 From: craig-warren Date: Wed, 9 Mar 2016 11:11:34 +0000 Subject: [PATCH] Updated dispersion warning to take account of when there are no sources in the model (not a very useful scenario....) --- gprMax/grid.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gprMax/grid.py b/gprMax/grid.py index ed9fb8f1..aac79308 100644 --- a/gprMax/grid.py +++ b/gprMax/grid.py @@ -100,11 +100,13 @@ def dispersion_check(waveforms, materials, dx, dy, dz): dx, dy, dz (float): Spatial discretisation of the model. Returns: - dispersionwarning (boolean): Potential numerical dispersion + (boolean): Potential numerical dispersion """ # Find maximum frequency freqs = [waveform.freq for waveform in waveforms] + if not freqs: + return False maxfreq = max(freqs) # Find minimum wavelength @@ -125,11 +127,9 @@ def dispersion_check(waveforms, materials, dx, dy, dz): # Test for numerical dispersion if max((dx, dy, dz)) > (minwavelength / resolution): - dispersionwarning = True + return True else: - dispersionwarning = False - - return dispersionwarning + return False def get_other_directions(direction):