> I have tried the following for a beam propagating along the x-axis (so
> y-coordinate should follow a Gaussian profile):

> But it seems to give something more like a point source rather than a
beam.

You don't give all the parameters you used; if the source area is
point-like, it will diverge like any point source (in the attached, set
radius to eg 0.1). You need a substantial area.

Depending on your application you might also want to control the phase
to put some curvature in the wavefront at the source.

Ian
import meep as mp
import math
import cmath

x_size=30
y_size=30

cell=mp.Vector3(x_size, y_size, 0)

dpml=1.0

pml_layers=[mp.PML(dpml)]

resolution=20

radius=2
amp_factor=1
phi_factor=1/4
skew=5.0

def term1(position):
    x=position.x
    val=amp_factor*(x/radius)**2
    return math.exp(-val)

def term2(position):
    x=position.x
    val=complex(0, x*skew+phi_factor*(x/radius)**2)
    return cmath.exp(-val)

def pw_amp():
    def _pw_amp(position):
        return term1(position)*term2(position)
    return _pw_amp

fcen=2.0
df=0.02

sources = [
    mp.Source(
        mp.ContinuousSource(fcen, fwidth=df),
        component=mp.Ez,
        center=mp.Vector3(0, -14),
        size=mp.Vector3(x_size, 0, 0),
        amp_func=pw_amp()
    )
]

sim = mp.Simulation(
    cell_size=cell,
    sources=sources,
    boundary_layers=pml_layers,
    resolution=resolution,
)

t=50
sim.run(mp.to_appended("ez", mp.at_every(0.1, mp.output_efield_z)), until=t)
_______________________________________________
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to