should be e dot j.conj()

This commit is contained in:
Jan Petykiewicz 2024-01-17 22:20:59 -08:00
parent 5c3b3532a9
commit c3b6fd94a6

View File

@ -43,8 +43,12 @@ def test_poynting_planes(sim: 'FDResult') -> None:
s[1, mask].sum(), -s[1, my].sum(), s[1, mask].sum(), -s[1, my].sum(),
s[2, mask].sum(), -s[2, mz].sum()] s[2, mask].sum(), -s[2, mz].sum()]
e_dot_j = sim.e * sim.j * sim.dxes[0][0][:, None, None] * sim.dxes[0][1][None, :, None] * sim.dxes[0][2][None, None, :] e_dot_j = sim.e * sim.j.conj()
src_energy = -e_dot_j[:, mask].real / 2 dv = (sim.dxes[0][0][:, None, None]
* sim.dxes[0][1][None, :, None]
* sim.dxes[0][2][None, None, :]
)
src_energy = -(e_dot_j.real * dv)[:, mask] / 2
assert_close(sum(planes), src_energy.sum()) assert_close(sum(planes), src_energy.sum())