From 1860d754cda26da183bebb814c5fe23748787111 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 26 Aug 2019 00:27:32 -0700 Subject: [PATCH] Fix shifts applied to E and H fields Only some components need shifting --- meanas/fdfd/waveguide_mode.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meanas/fdfd/waveguide_mode.py b/meanas/fdfd/waveguide_mode.py index 7776ce2..b9524e5 100644 --- a/meanas/fdfd/waveguide_mode.py +++ b/meanas/fdfd/waveguide_mode.py @@ -118,7 +118,8 @@ def solve_waveguide_mode(mode_number: int, fields_2d['H'] *= polarity # Apply phase shift to H-field - fields_2d['H'] *= numpy.exp(-polarity * 1j * 0.5 * fields_2d['wavenumber'] * dx_prop) + fields_2d['H'][:2] *= numpy.exp(-1j * polarity * 0.5 * fields_2d['wavenumber'] * dx_prop) + fields_2d['E'][2] *= numpy.exp(-1j * polarity * 0.5 * fields_2d['wavenumber'] * dx_prop) # Expand E, H to full epsilon space we were given E = numpy.zeros_like(epsilon, dtype=complex)