From 7a53633adf3ee17a8bb3da3d19a506a0c9671921 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Mon, 13 Mar 2017 13:55:47 +0000 Subject: [PATCH] Removed '+1' from arrays for storing waveform values. --- gprMax/sources.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gprMax/sources.py b/gprMax/sources.py index 3ddb6e09..ae34f753 100644 --- a/gprMax/sources.py +++ b/gprMax/sources.py @@ -17,7 +17,6 @@ # along with gprMax. If not, see . from copy import deepcopy -import decimal as d import numpy as np @@ -49,11 +48,15 @@ class Source(object): G (class): Grid class instance - holds essential parameters describing the model. """ - self.waveformvaluesJ = np.zeros((G.iterations + 1), dtype=floattype) - self.waveformvaluesM = np.zeros((G.iterations + 1), dtype=floattype) + # Waveform values for electric sources - calculated half a timestep later + self.waveformvaluesJ = np.zeros((G.iterations), dtype=floattype) + + # Waveform values for magnetic sources + self.waveformvaluesM = np.zeros((G.iterations), dtype=floattype) + waveform = next(x for x in G.waveforms if x.ID == self.waveformID) - for iteration in range(G.iterations + 1): + for iteration in range(G.iterations): time = G.dt * iteration if time >= self.start and time <= self.stop: # Set the time of the waveform evaluation to account for any delay in the start