Skip to content

Instantly share code, notes, and snippets.

@ptomato
Created May 21, 2012 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptomato/2761283 to your computer and use it in GitHub Desktop.
Save ptomato/2761283 to your computer and use it in GitHub Desktop.
Surface plasmon launch at a metal slit in Meep
(define-param slit? true) ; set to false to turn off the slit
(define a 1e-6) ;length unit used in simulation = 1 micron
(set! resolution 50) ;pixels per micron
(define size-x 7) ;microns
(define size-y 3) ;microns
(define wl 0.83) ;microns
(define pi 3.14159265358979)
(define c0 299792458) ; m/s
(define timesteps 150)
; Gold with dispersion
; Based on http://juluribk.com/2011/04/27/plasmonic-materials-in-meep/
(define plasma-freq-Au 9.03) ;eV
(define f-Au '(0.760 0.024 0.010 0.071 0.601 4.384)) ;Oscillator strengths
(define gamma-Au '(0.053 0.241 0.345 0.870 2.494 2.214)) ;Damping (eV)
(define omega-Au '(0.000 0.415 0.830 2.969 4.304 13.32)) ;Resonance (eV)
(define ev2w (/ (* 2 pi) 4.135666e-15)) ; Convert frequency from eV to omega
(define (norm x) (* x (/ ev2w (/ (* 2 pi c0) a)))) ; Normalization factor
(define omega-p-norm (norm plasma-freq-Au))
(define gamma-norm (map norm gamma-Au))
(define omega-norm (map norm omega-Au))
(set-car! omega-norm 1e-20) ; needs to be a small number but not zero
(define sigma-norm (map (lambda (f omega)
(/ (* f omega-p-norm omega-p-norm)
(* omega omega)))
f-Au omega-norm))
(define list-pol
(map (lambda (o g s) (make polarizability (omega o) (gamma g) (sigma s)))
omega-norm gamma-norm sigma-norm))
(define gold
(make dielectric (epsilon 1)
(apply polarizations list-pol)))
; Define the computational grid volume
(set! geometry-lattice (make lattice (size size-x size-y no-size)))
; Define the structure
(set! geometry
(if slit?
(list (make block (center 0 0.75) (size infinity 1.5 infinity)
(material gold))
(make block (center 0 0.75) (size 0.2 1.5 infinity)
(material air)))
(list (make block (center 0 0.75) (size infinity 1.5 infinity)
(material gold)))))
; Define the source
(set! sources (list
(make source
(src (make continuous-src (wavelength wl)))
(component Ex)
(size 6 0 0)
(center 0 -0.5))))
; Define the PML
(set! pml-layers (list (make pml (thickness 0.5))))
(run-until 10
(with-prefix (if slit? "slit-" "no-slit-")
(at-end output-efield)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment