diff --git a/gprMax/cmds_singleuse.py b/gprMax/cmds_singleuse.py index cf562e41..7bcb6aa7 100644 --- a/gprMax/cmds_singleuse.py +++ b/gprMax/cmds_singleuse.py @@ -188,7 +188,7 @@ class TimeStepStabilityFactor(UserObjectSingle): super().__init__(**kwargs) self.order = 4 - def build(self, G, uip): + def build(self, model, uip): try: f = self.kwargs["f"] except KeyError: @@ -202,6 +202,7 @@ class TimeStepStabilityFactor(UserObjectSingle): ) raise ValueError + G = model.G G.dt_mod = f G.dt = G.dt * G.dt_mod @@ -220,7 +221,7 @@ class TimeWindow(UserObjectSingle): super().__init__(**kwargs) self.order = 5 - def build(self, G, uip): + def build(self, model, uip): # If number of iterations given # The +/- 1 used in calculating the number of iterations is to account for # the fact that the solver (iterations) loop runs from 0 to < G.iterations diff --git a/gprMax/grid/fdtd_grid.py b/gprMax/grid/fdtd_grid.py index f0ee1ea8..60921fe1 100644 --- a/gprMax/grid/fdtd_grid.py +++ b/gprMax/grid/fdtd_grid.py @@ -61,7 +61,8 @@ class FDTDGrid: self.dz = 0.0 self.dl: np.ndarray self.dt = 0.0 - self.dt_mod = None # Time step stability factor + + self.dt_mod = 1.0 # Time step stability factor self.iteration = 0 # Current iteration number self.iterations = 0 # Total number of iterations self.timewindow = 0