From 8a017f09b0ade4bd6e8d90d43107774e131a68c5 Mon Sep 17 00:00:00 2001 From: Mo Chen Date: Tue, 7 Dec 2021 17:42:01 -0500 Subject: [PATCH] fix --- python/simulation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/simulation.py b/python/simulation.py index e3bc16c62..65a1e9d93 100644 --- a/python/simulation.py +++ b/python/simulation.py @@ -4569,6 +4569,8 @@ def _stop(_sim): change = _sim.fields.dft_time_fields_norm() closure['maxchange'] = max(closure['maxchange'],change) closure['t0'] = _sim.fields.t + if closure['maxchange'] == 0: + return False if verbosity.meep > 1: fmt = "DFT fields decay(t = {0:0.2f}): {1:0.4e}" print(fmt.format(_sim.meep_time(), np.real(change/closure['maxchange'])))