I would like to be able to define my own dielectric function in Scheme, so that I am not just limited to the standard shapes of circles, cones, rectangles, etc. (and their intersections), but I am not sure how to do this. In order to probe how I could define my own epsilon function in scheme, I tried making a triangle using the following code:
(set-param! resolution 64) (define (px p)(vector3-x (lattice->cartesian p))) (define (py p)(vector3-y (lattice->cartesian p))) (set! geometry-lattice (make lattice (size 1 1 no-size) (basis1 1 0) (basis2 0 1))) (material-func[p] (material (make dielectric (epsilon (if (< (+ px py) 0.5) 12 1 ))))) (set! num-bands 8) (set! k-points (list (vector3 0 0 0) ; Gamma (vector3 0 (/ 1 2) 0) ; M (vector3 (/ 3) (/ 2 3) 0) ; K (vector3 0 0 0))) ; Gamma (set! k-points (interpolate 32 k-points)) (run) ------------------------------------------------------------------------------------ So the part where I define material-func is where I'm stuck. As I expected, this code doesn't work, but I don't know how to change it so that it does what I want. I've also tried similar code with epsilon-func instead of material-func. I hope someone might be able to help.
_______________________________________________ mpb-discuss mailing list mpb-discuss@ab-initio.mit.edu http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/mpb-discuss