NanoComp / meep

free finite-difference time-domain (FDTD) software for electromagnetic simulations
GNU General Public License v2.0
1.16k stars 594 forks source link

Circular-polarized guassian light focused when propagating in homogenous medium #2768

Open beizhixing opened 5 months ago

beizhixing commented 5 months ago

Electric Field (Plane_in) Electric Field (Plane_out) Electric Field (Plane_XZ)

I want to simulate circular-polarized guassian light propagating 3D anisotropic medium along Z axis, First, I test it propagate in air or n=constant, the results show it focused when propagating in homogenous medium, what'smore, I saw E from input and output monitor are oppsition and in XZ plane you need to do transpose, I have reviewed some projects in http://simpetus.com/projects.html and https://meep.readthedocs.io/en/latest/Python_Tutorials/Mode_Decomposition/#diffraction-spectrum-of-liquid-crystal-polarization-gratings, but can not slove two problem I met.

Here is the same structure simulated by Lumerical FDTD:

RHC

I'd be appreciate if you can help me to solve it, @smartalecH @oskooi !

oskooi commented 4 months ago

Here are three guides which together demonstrate how to set up a circularly polarized Gaussian beam source and anisotropic media (one of which it seems you have already seen):

beizhixing commented 4 months ago

Thanks for replying! Actually I have seen three guides you mentioned above, but it can not solve my problem.

I attached my code, please take a look!

LCP_Guassian.txt

beizhixing commented 3 months ago

I think the boundary k_point should be the default: false under my situation, and the result below shows a circularly polarized Gaussian beam source propagation in vacuum in 3D space.

E Plane_XZ Ex_angle0

stevengj commented 3 months ago

What is the code that defines your source?

beizhixing commented 3 months ago

What is the code that defines your source?

    # Circular-polarized guassian continous source
    beam_x0 = mp.Vector3(0, 0, 0)  # beam focus (relative to source center)
    rot_angle = 0  # CCW rotation angle about z axis (0: +z axis)
    beam_kdir = mp.Vector3(0, 0, 1).rotate(
        mp.Vector3(0, 1, 0), math.radians(rot_angle)
    )  # beam propagation direction
    beam_w0 = 2.4  # beam waist radius
    beam_E0 = math.sqrt(2)/2*mp.Vector3(1,1j,0)
    sources = [
    mp.GaussianBeamSource(
        src=mp.ContinuousSource(fcen, fwidth=df, is_integrated=True),
        center=mp.Vector3(0,0, -0.5 * sz + dpml+ 0.5*dair),
        size=mp.Vector3(r,r,0),
        beam_x0=beam_x0,
        beam_kdir=beam_kdir,
        beam_w0=beam_w0,
        beam_E0=beam_E0, 
        )
    ]