Replies: 3 comments 4 replies
-
Near-to-far definitely works in 3d, and has been used many times. If you just want the scattered field, maybe you're forgetting to subtract the incident field? Or you have some other bug … I don't have time to look through your code in detail. |
Beta Was this translation helpful? Give feedback.
-
This is wrong. Use a Gaussian source. You want the field to have decayed away completely by the time you use the Fourier transform to compute the far fields. |
Beta Was this translation helpful? Give feedback.
-
I am performing a near-to-far-field transformation and calculating the Poynting vector from the far-field data Ex, Ey, Ez, Hx, Hy, Hz. def calcPoyntingVec(thetaPoints, phiPoints, nearFieldBox, radius):
print("--- Calc Poynting Vector ---")
r = radius
field_vectors = []
for theta in thetaPoints:
print(f"-- {theta} -- ")
for phi in phiPoints:
x = r * np.sin(theta) * np.cos(phi)
y = r * np.sin(theta) * np.sin(phi)
z = r * np.cos(theta)
ff = sim.get_farfield(
nearFieldBox,
mp.Vector3(x, y, z)
)
field_vectors.append(ff)
field_vectors = np.transpose(field_vectors)
print(field_vectors.shape)
Ex, Ey, Ez, Hx, Hy, Hz = field_vectors
Ex = np.array(Ex)
Ey = np.array(Ey)
Ez = np.array(Ez) |
Beta Was this translation helpful? Give feedback.
-
Hello, for my bachelor thesis, I try to implement a Near-to-Far-Field Transformation in 3D using Meep. It works as expected in 2D. My work is based on the "Near to Far Field Spectra" tutorial from the Meep documentation. For testing in 3D, I used a sphere and a plane wave, and I try to visualize the results. However, I am not getting the expected outcomes according to mie-scattering. Even adding or changing geometry doesn't fundamentally change the result, and I'm not sure why.
Do any of you have experience with a Near-to-Far-Field Transformation in 3D and can help me?
In the following I can show you my basic sim-settings:
I use a ContinuousSource wave with the parameter:
size = mp.Vector3(0, cell.y, cell.z), center=wavePos, end_time=3, width=0.5, slowness=1
For the nearfield detection I define near2far_regions:
For the understanding I can show you a simple image. This is how I define the nearfield detection box, the geometry and the wave by the blue arrow:
So then I run the simulation:
sim.run(mp.at_every(timestep, mp.output_efield_z), until=simTime)
For the calculation of the Poynting Vector (Px, Py, Pz) for each theta and phi I use
get_farfield
to calculate the far-field at each defined point on the sphere. I don't know if this is correct:Pr corresponds to the absolut of the Poynting-Vector and consists of phi x theta elements. That basically mena for each angel theta and phi, we have a certain value of the Poynting-Vector. In the following we go back drom the spherical coordinates to a 3D cartesian grad X, Y, Z. To calculate the position of the scattered field using the Poyning-Vector in X, Y and Z we use this command:
x = Pr[index] * np.sin(theta) * np.cos(phi)
, y and z equivalent. Here, the radius is replaced by the absolut eof the Poyntin-Vector for each angle theta and phi. At the end every position in X, Y, Z is displayd in a 3D projection.Here in the following is an image of my result for scattering on a sphere.
The other image represents the "correct" scatterin behaviour in 3D:
However, my scattered field in 3D does not look correct.
Do you know how to implement this on the correct way to get a 3D Near-to-Far-Field transform as expected for a sphere for example?
Thank you for your help.
Beta Was this translation helpful? Give feedback.
All reactions