Dear Steven and Meep users,

I want to simulate some periodic gold squares to obtain the transmittance 
curve. However, I did not understand completely some transfer in Meep. I have 
consulted some posters by other, but I am still not sure. My questions are as 
following:
1. How to convert the international unit into the Meep unit? 
  unit ; base unit of distance
  unitw = 2*pi*c/unit ; base unit for frequency, where c is 3e+8. 
                      ; Is it right? I am not sure. Someone said c=1.
  lam ; free space wavelength (meters)
  fcen = unit/lam ; source center frequency
  pw ; free Space pulse Width (in frequency)
  df = 2*pi*pw/unitw ; pulse width in Meep unit
  where fcen and df are used to define the source, respectively. 
2. How to obtain the Meep Drude parameters from the usual Drude parameters?
  The equation of usual Drude Model is as following:
  eps(w) = eps_inf - wp^2/(w^2 + i*w*delta)              (1)
  The equation in Meep that can describe the dispersive materials is as 
following:
  eps(w1) = eps_inf + omega^2 * de / ( omega^2 – w1^2 – i*w1*gamma)    (2)
  The w in Eq. (1) is in the unit of frequency. However, the w1 in Eq. (2) is 
in the unit of  unitw = 2*pi*c/unit. So we should transform the Eq. (1) into 
Eq.(3).
  eps(w1) = eps_inf – wp1^2/(w1^2 + i*w1*delta1)    (3)
  where wp1 = wp/unitw and delta1 = delta/unitw. Then, we can compare Eq.(3) 
with Eq.(2), and we can obtain the parameters in Meep as following:
  omega = 1e-20 ; set omega to be some small number 
  gamma = delta1
  de = wp1^2/omega^2; 
3. How to close eps-averaging?
  Many users used (set! eps-averaging? false) to close it. However, someone 
said that Meep still does some averaging, even when you set eps-averaging? to 
false. Is it right? Meanwhile, Steven suggested that we should disable the 
following line (192) in anistroptic_averaging.cpp:
#if 1 // legacy method: very simplistic averaging (TODO: delete this?)
to
#if 0
Where can I find the file of anistroptic_averaging.cpp.
4. How to set periodic boundary condition in x and y directions? Meanwhile, 
PML are used at z direction. Are the following setting right?
  (set-param! k-point (vector3 0 0 0)) ; Set periodic boundary condition
  (define-param dpml 10) ; PML thickness
  (set! pml-layers (list (make pml (thickness dpml) (direction Z))))
Attachment is my ctl file. But it has some errors as following:

command-line param: no-geometry?=false
-----------
Initializing structure...
Working in 3D dimensions.
     block, center = (0,0,0)
          size (116,116,20)
          axes (1,0,0), (0,1,0), (0,0,1)
          dielectric constant epsilon = 9
time for set_epsilon = 16.0158 s
polarizability: omega=1e-20, gamma=-7.14782e-05, deps=4.88547e+35, esat=0
-----------
ERROR: In procedure list:
ERROR: end of file in test.ctl 

Would you please help me fix them?  Any help or hints will be appreciated. 
Thanks a lot.

Best,
Shuqi
=====================================================================
; Test 3d simulation by Meep to obtain the transmittace curves.
; The simulated geometry is some periodic gold squares. 
; The length and thickness are 116nm and 20nm, respectively. 
; The gap between the two squares is 44nm. PML are used at 
; the top and bottom of the simulation domain. The periodic 
; boundary conditions are used in the x-y directions. The 
; total simulation volume is (length+gap)×(length+gap)×400nm. 
; The incident light polarized along x direction was launched
; in -z direction.

(reset-meep)
(define-param unit 1e-9)       ; base unit in meters (1e-9 = 1 nm)
(define-param c 299792458)     ; the speed of light in vacuum (m/s)
(define-param lam 785e-9)      ; free space wavelength (meters)
(define lamu (/ lam unit))     ; wavelength in base units

; Some parameters to describe the geometry:
(define-param len 116) ; length of square
(define-param thick 20) ; thickness of square
(define-param gap 44)     ; gap between the two squares

; The lattice dimensions
(define sx (+ len gap)) ; size of cell in x direction
(define sy (+ len gap)) ; size of cell in y direction
(define sz 400)         ; size of cell in z direction
(set! geometry-lattice (make lattice (size sx sy sz)))
(set-param! resolution 1)

; Drude model of Gold
; the following parameters are from Drude model
(define-param wp 1.3166e+16)   ; resonant plasma frequency
(define-param epsinf 9.0)      ; relative permittivity at infinite frequency
(define-param del -1.3464e+14) ; damping coefficient
;these parameters are For Meep
(define unitw (/ (* 2 pi c) unit)) ; base unit For frequency
(define gammau (/ del unitw))      ; gamma in base unit
(define wpu (/ wp unitw))          ; resonant plasma frequency in base unit
(define deltaeps (* wpu wpu 1e+40)); For delta-epsilon

(set! eps-averaging? false)
(define gold
      (make dielectric (epsilon epsinf)
            (polarizations 
             (make polarizability
               (omega 1e-20) (gamma gammau) (delta-epsilon deltaeps))
             )))
(define-param no-geometry? false) ; if true, no geometry     
; Set Geometry
(set! geometry 
              (if no-geometry? 
               (list
                (make block (center 0 0 0) (size len len thick)
                      (material (make dielectric (epsilon 1)))))
               (list
                (make block (center 0 0 0) (size len len thick)
                      (material gold)))
                      ))  
                
(set-param! k-point (vector3 0 0 0)) ; Set periodic boundary condition
(define-param dpml 10)               ; PML thickness
(set! pml-layers (list (make pml (thickness dpml) (direction 
Z))))              
; Set Source
(define fcen (/ unit lam))     ; source center frequency
(define-param pw 2e+14)        ; free Space pulse Width (in frequency)
(define df (/ (* pw unit) c))  ; pulse width in Meep Unit
(set! sources (list
               (make source
                 (src (make gaussian-src (frequency fcen) (fwidth df)))
                 (component Ex)
                 (center 0 0 (+ (/ sz -2) dpml 1))
                 )))

(define-param nfreq 200) ; number of frequencies at which to compute 
flux             
(define trans ; transmitted 
flux                                                
      (add-flux fcen df nfreq
                (if no-geometry?
                    (make flux-region
                     (center 1 2 (- (/ sz 2) dpml 1)) (size 1 1 0))
                    (make flux-region
                     (center 1 2 (- (/ sz 2) dpml 1)) (size 1 1 0))
                  )))
(run-sources+ 
 (stop-when-fields-decayed 50 Ex
                           (if no-geometry? 
                               (vector3 1 2 (- (/ sz 2) dpml 1))
                               (vector3 1 2 (- (/ sz 2) dpml 1))
                           1e-3)
                           (at-beginning output-epsilon))
(display-fluxes)


_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to