add fdfd.poynting_e_cross_h()

This commit is contained in:
Jan Petykiewicz 2019-10-27 12:41:08 -07:00
parent 88123342be
commit 6257254579

View File

@ -204,3 +204,19 @@ def e_tfsf_source(TF_region: field_t,
neg_iwj = A(TF_region * e) - TF_region * A(e)
return neg_iwj / (-1j * omega)
def poynting_e_cross_h(dxes: dx_lists_t):
def exh(e: field_t, h: field_t):
s = numpy.empty_like(e)
ex = e[0] * dxes[0][0][:, None, None]
ey = e[1] * dxes[0][1][None, :, None]
ez = e[2] * dxes[0][2][None, None, :]
hx = h[0] * dxes[1][0][:, None, None]
hy = h[1] * dxes[1][1][None, :, None]
hz = h[2] * dxes[1][2][None, None, :]
s[0] = numpy.roll(ey, -1, axis=0) * hz - numpy.roll(ez, -1, axis=0) * hy
s[1] = numpy.roll(ez, -1, axis=1) * hx - numpy.roll(ex, -1, axis=1) * hz
s[2] = numpy.roll(ex, -1, axis=2) * hy - numpy.roll(ey, -1, axis=2) * hx
return s
return exh