Calculates the Poynting vector (energy flux) from E and H fields.
Parameters: |
-
E
(Array )
–
Electric field array with shape (3, nx, ny, nz)
-
H
(Array )
–
Magnetic field array with shape (3, nx, ny, nz)
-
axis
(int , default:
0
)
–
Axis for computing the poynting flux. Defaults to 0.
|
Returns: |
-
Array
–
jax.Array: Poynting vector array with shape (3, nx, ny, nz) representing
-
Array
–
energy flux in each direction
|
Source code in src/fdtdx/core/physics/metrics.py
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 | def compute_poynting_flux(E: jax.Array, H: jax.Array, axis: int = 0) -> jax.Array:
"""Calculates the Poynting vector (energy flux) from E and H fields.
Args:
E (jax.Array): Electric field array with shape (3, nx, ny, nz)
H (jax.Array): Magnetic field array with shape (3, nx, ny, nz)
axis (int, optional): Axis for computing the poynting flux. Defaults to 0.
Returns:
jax.Array: Poynting vector array with shape (3, nx, ny, nz) representing
energy flux in each direction
"""
return jnp.cross(
E,
jnp.conj(H),
axisa=axis,
axisb=axis,
axisc=axis,
)
|