Dear Steven and others,
could you please answer two my questions (hereafter I discuss only 2D
simulations):
1. Setting up a k-point in meep is still not completely clear to me. As far
as I see if one needs periodic boundary conditions say in Y direction one
should type (since k vector is k=2*pi /sy(0,1) and k in meep must be set up
in units 2*pi):
(set-param k-point (vector3 0 (/ 1 sy))
)
where sy -- y-size of a computational cell.Although I have figured out that
for instance
(set-param k-point (vector3 0 sy))
)
works in the same way. Also here in the meep-discuss archive I saw
suggestion that to put periodic boundary conditions on all the boundaries
one should write:
(set-param k-point (vector3 0 0)
).
2.a) I tried to calculate a transmission/reflection spectra for normal
incidence on a dielectric slab (please see the control file below). If I
move reflection flux plane closer to the slab, but still far enough from it
-- about 10 wavelengths I get positive reflection flux:
flux1:, 0.3, 0.00402280824472127, 0.0175279447668702
flux1:, 0.302020202020202, 0.0039794157233877, 0.0204477622409809
flux1:, 0.304040404040404, 0.00377341358133434, 0.0264463440220973
flux1:, 0.306060606060606, 0.00441600176959974, 0.0376819698408472
flux1:, 0.308080808080808, 0.00578687487558648, 0.0574699129341807
Moving reflection flux plane close to the left boundary (where the wave
comes from) solves this problem, but what was wrong is unclear.
b) If I simply double the size of computational sell keeping reflection and
transmission flux planes close to the left and right boundaries respectively
I get negative transmitted flux:
flux1:, 0.483838383838385, -1.4046176131049e-12, -1.00749060039099
flux1:, 0.485858585858587, -1.00810901340437e-12, -0.871214641332232
flux1:, 0.487878787878789, -7.18588741744825e-13, -0.760422421201135
flux1:, 0.489898989898991, -5.08364565582074e-13, -0.670610818932086
flux1:, 0.491919191919193, -3.56421738720093e-13, -0.597995811065107
The control file:
(define-param sx 50)
(define-param sy 24)
(set! geometry-lattice (make lattice (size sx sy no-size)))
;PARAMETERS
(define-param norm false)
(define-param eps 14) ; dielectric
(define-param L 7)
(define-param pmlthick 2)
(if (not norm)
(set! geometry
(list
(make block (center 0 0) (size L sy infinity) ; making a dielectric
block where holes will be drilled
(material (make dielectric (epsilon eps))))
)
)
)
(set! pml-layers (list (make pml (thickness pmlthick) (direction X))))
(set-param! k-point (vector3 0 (/ 1 sy)) )
(set! resolution 10)
(define-param fcen 0.4) ; pulse center frequency
(define-param df 0.2) ; pulse width (in frequency)
(set! sources (list
(make source
(src (make gaussian-src (frequency fcen) (fwidth df)))
(component Hz)
(center (+ pmlthick (* -0.5 sx)) 0)
(size 0 sy)
)))
(define-param nfreq 100) ; number of frequencies at which to compute flux
(define trans ; transmitted flux
(add-flux fcen df nfreq
(make flux-region
(center (- (* 0.5 sx) (+ 1 pmlthick)) 0) (size 0 sy))))
(define refl ; reflected flux
(add-flux fcen df nfreq
(make flux-region
(center (+ 20 (+ (* -0.5 sx) pmlthick)) 0) (size 0
sy))))
(if (not norm) (load-minus-flux "refl-flux" refl))
(run-sources+
(stop-when-fields-decayed 50 Hz
(vector3 (- (* 0.5 sx) (+ 1 pmlthick)) (-
(* 0.5sy) 2))
1e-3) (at-beginning output-epsilon) )
(if norm (save-flux "refl-flux" refl))
(display-fluxes trans refl)
Commands for invoking meep are:
meep norm=true tr_block.ctl | tee tr_blockn0_norm.out
meep tr_block.ctl | tee tr_blockn0.out
Thank you in advance for the help.
Sincerely,
Ruslan
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss