コード例 #1
0
#wvlens = np.arange(100,500, interval)*nm
#freqs = c / wvlens
#np.save("../graph/freqs", freqs)
#src = source.Gaussian(dt, wvc, spread, pick_pos, dtype=np.float32)
#src.plot_pulse(Tsteps, freqs, savedir)
#wvlen = wvc

########## Sine source
#smth = source.Smoothing(dt, 1000)
#src = source.Sine(dt, np.float64)
#wvlen = 300*um
#src.set_wvlen(wvlen)

########## Harmonic source
smth = source.Smoothing(dt, 1000)
src = source.Harmonic(dt)
wvlen = 200 * nm
src.set_wvlen(wvlen)

src1 = source.Harmonic(dt)
src1.set_wvlen(250 * nm)

src2 = source.Harmonic(dt)
src2.set_wvlen(300 * nm)

src3 = source.Harmonic(dt)
src3.set_wvlen(120 * nm)

########## Delta source
#src = source.Delta(1000)
#wvlen = 2*Lz
コード例 #2
0
#ky = k0 * np.cos(theta)

# mmt for Gamma to Chi.
lamx = float(sys.argv[1]) * nm
lamy = 0 * nm
kx = 2 * np.pi / lamy
ky = 0
theta = 0, 0
wvlen = lamy * np.cos(theta)

mmt = (kx, ky)
#mmt = (0, 0)

########## Harmonic source
smth = source.Smoothing(dt, 1000)
src1 = source.Harmonic(dt)
src1.set_wvlen(wvlen)

########## Line src along x-axis.
#setter1 = source.Setter(TF, (0, 140*nm), (Lx, 140*nm+dy), mmt)
#setter2 = source.Setter(TF, (0, 150*nm, 100*nm), (Lx, 150*nm+dy, 100*nm+dz), mmt)
#setter3 = source.Setter(TF, (0, 300*nm, 450*nm), (Lx, 300*nm+dy, 450*nm+dz), mmt)
#setter4 = source.Setter(TF, (0, 450*nm, 196*nm), (Lx, 450*nm+dy, 196*nm+dz), mmt)

########## Line src along y-axis.
setter1 = source.Setter(TF, (140 * nm, 0), (140 * nm + dx, Ly), mmt)
#setter2 = source.Setter(TF, (200*nm, 0), (410*nm+dx, Ly), mmt)
#setter3 = source.Setter(TF, (100*nm, 0), (410*nm+dx, Ly), mmt)
#setter4 = source.Setter(TF, (100*nm, 0), (410*nm+dx, Ly), mmt)

########## Point src.
コード例 #3
0
#Box1_end = (round(272*um/dx), round(96*um/dy), round( 96*um/dz))
#Box = structure.Box(FDTDspace, Box1_srt, Box1_end, 4., 1.)

# Set PML and PBC
FDTDspace.set_PML({'x':'+-','y':'','z':''}, 10)
PSTDspace.set_PML({'x':'+-','y':'','z':''}, 10)

# Save eps, mu and PML data.
#FDTDspace.save_PML_parameters('./')
#FDTDspace.save_eps_mu(savedir)

# Set the type of input source.
smoothing = source.Smoothing(dt, 1000)
#Src = source.Gaussian(dt, wvc, spread, pick_pos, np.float64)
#Src.plot_pulse(Tstep, freqs, savedir)
Src = source.Harmonic(dt)
wvlen = 300*um
Src.set_wvlen(wvlen)

# Set source position.
#src_xpos = int(Nx/2)
src_xpos = 50
src_ypos = 50

# Momentum of the source.
# mmt for plane wave normal to x axis
# phi is the angle between k0 vector and xz-plane.
# theta is the angle between k0cos(phi) and x-axis.
k0 = 2*np.pi / wvlen
phi, theta = 0*np.pi/180, -30*np.pi/180
#phi, theta = 0, 0