Fix wgmode expansion

fdtd_extras
Jan Petykiewicz 5 years ago
parent 3429120993
commit 2c91ea249f

@ -436,16 +436,15 @@ def expand_wgmode_e(E: field_t,
phase_E = numpy.exp(iphi * r_E).reshape(a_shape)
# Expand our slice to the entire grid using the phase factors
Ee = numpy.zeros_like(E)
E_expanded = numpy.zeros_like(E)
slices_exp = list(slices)
slices_exp[axis] = slice(E.shape[axis + 1])
slices_exp = (slice(None), *slices_exp)
slices_in = tuple(slice(None), *slices)
slices_in = (slice(None), *slices)
Ee[slices_exp] = phase_E * numpy.array(E)[slices_in]
return Ee
E_expanded[slices_exp] = phase_E * numpy.array(E)[slices_in]
return E_expanded

Loading…
Cancel
Save