Package: meep / 1.7.0-3

fix-test.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Description: patch to avoid division by zero
             (cherry picked for this version)
Author: upstream deevlopers
diff --git a/python/simulation.py b/python/simulation.py
index 2671225..cbe2b32 100644
--- a/python/simulation.py
+++ b/python/simulation.py
@@ -418,7 +418,7 @@ class Harminv(object):
 
         modes = []
         for freq, amp, err in bands:
-            Q = freq.real / (-2 * freq.imag)
+            Q = freq.real / (-2 * freq.imag) if freq.imag != 0 else float('inf')
             modes.append(Mode(freq.real, freq.imag, Q, amp, err))
             display_run_data(sim, 'harminv', [freq.real, freq.imag, Q, abs(amp), amp, err])