Near-field to far-field, as openEMS's nf2ff (openEMS.nf2ff): a box of six faces
records E and H in the frequency domain (node-interpolated HDF5 dumps
<name>_E_<n>.h5 / <name>_H_<n>.h5), and CalcNF2FF turns them into the far field
over (theta, phi), written in openEMS's result file and returned as openEMS's
nf2ff_results.
nf = FDTD.CreateNF2FFBox(frequency=[2.4e9]) # before the run: the faces
# inside the absorbing
# boundaries
FDTD.Run(path)
r = nf.CalcNF2FF(path, [2.4e9], theta, phi, center=[0, 0, 0])
r.Dmax, r.Prad, r.E_norm[0] # (theta, phi) per frequency
The faces carry the equivalent currents J = n x H and M = -n x E (n: outward),
summed with trapezoid weights at the nodes. The far field (e^jwt, r -> inf):
N = sum J w e^(jk r^.r'), L = sum M w e^(jk r^.r')
E_theta = -jk e^-jkr / (4 pi r) (L_phi + eta N_theta),
E_phi = jk e^-jkr / (4 pi r) (L_theta - eta N_phi)
On a planar face e^(jk r^.r') is a product over its two axes, so each sum is two
matrix products. Mirrors (a PEC or PMC side the box rests on) add the image
currents. P_rad = |E|^2 / (2 eta). Prad is the power through the recorded faces,
1/2 Re sum (E x H*).n w (the images not counted), and Dmax = 4 pi r^2 max(P_rad)
/ Prad, as openEMS's.