On Mar 3, 2009, at 7:28 PM, Lingyun Wang wrote:
I am asking the same question that someone has asked before (as in
this link: http://osdir.com/ml/science.photonic-bands/2004-01/msg00002.html)
. The link to Steven's example file in his reply post is no longer
working. Could someone help me find out this example file? I need
some tutorial on this.
Basically I want to draw the gap map and gap recipe as shown in the
"Photonic crystals: molding the flow of light" textbook's gap map
Atlas in the appendix. In Mpb's official tutorial, I cannot find
similar examples. Thanks.
To find the "gap maps", you just find the gaps as a function of some
parameter (e.g. rod radius in the book).
To find the "gap recipes" as in the book, you have to optimize the gap
for each index contrast as a function of some geometric parameter
(e.g. the rod radius in the book). To do this, I used libctl's built-
in "maximize" function.
Below is an example file that finds the maximum TE gap between bands 1
and 2 as a function of index contrast for a square lattice of square
air holes in dielectric.
Steven
--------------
(set! num-bands 2)
(set! geometry-lattice (make lattice (size 1 1 no-size)))
(define Gamma (vector3 0 0 0))
(define X (vector3 0.5 0 0))
(define M (vector3 0.5 0.5 0))
(set! k-points (list Gamma X M))
(define-param res0 32)
(define-param n0 1.5)
(set! mesh-size 7) ; increase from default value of 3
; find the smallest integer >= N that has prime factors all <= 7
(define (next-factor2357 N)
(define (factor2357? N)
(define (divby N p)
(if (zero? (remainder N p))
(divby (quotient N p) p)
N))
(= 1 (divby (divby (divby (divby N 2) 3) 5) 7)))
(if (factor2357? N) N (next-factor2357 (+ N 1))))
(define ((first-te-gap n) w)
(set! default-material (make dielectric (index n)))
(set! geometry (list (make block
(center 0 0 0) (size (- 1 w) (- 1 w)
infinity)
(material air))))
(set! resolution (next-factor2357 (inexact->exact (* res0 (/ n
n0)))))
(run-te)
(retrieve-gap (- num-bands 1)))
(print "maxgap:, index, w, gap\n")
(define (max-gap n)
(let ((result (maximize (first-te-gap n) 0.001 (/ 0.1 n) (/ 1.0 n))))
(print "maxgap:, " n ", " (max-arg result) ", " (max-val result)
"\n")))
(define-param n-min 1)
(define-param n-max 7)
(define-param n-interp 40)
(map max-gap (map / (interpolate n-interp (map / (list n-max n-min)))))
_______________________________________________
mpb-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/mpb-discuss