Defining a new dielectric function

"Vincent ." <[email protected]> Fri, 9 Nov 2018 13:14:34 +0100
Newsgroups gmane.comp.science.photonic-bands
Message-ID <CAGwzFameH4k0PYOgE14x6gf9B5f4vHFE79LKKNV73Es_4n2XUg@mail.gmail.com>
--===============4129438830323297864==
Content-Type: multipart/alternative; boundary="000000000000fdc25c057a3a4b8c"

--000000000000fdc25c057a3a4b8c
Content-Type: text/plain; charset="UTF-8"

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.

--000000000000fdc25c057a3a4b8c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I would like to be able to define my own dielectric f=
unction 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 su=
re how to do this.</div><div>In order to probe how I could define my own ep=
silon function in scheme, I tried making a triangle using the following cod=
e:</div><div><br></div><div><div>(set-param! resolution 64)</div><div><br><=
/div><div>(define (px p)(vector3-x (lattice-&gt;cartesian p)))</div><div>(d=
efine (py p)(vector3-y (lattice-&gt;cartesian p)))</div><div><br></div><div=
>(set! geometry-lattice (make lattice (size 1 1 no-size)</div><div><span st=
yle=3D"white-space:pre-wrap">						</span>(basis1 1 0)</div><div><span styl=
e=3D"white-space:pre-wrap">						</span>(basis2 0 1)))</div><div><span styl=
e=3D"white-space:pre-wrap">						</span></div><div>(material-func[p]</div><=
div><span style=3D"white-space:pre-wrap">	</span>(material (make dielectric=
 (epsilon</div><div><span style=3D"white-space:pre-wrap">				</span>(if (&l=
t; (+ px py) 0.5) 12 1 )))))</div><div><br></div><div><br></div><div>(set! =
num-bands 8)</div><div>(set! k-points (list (vector3 0 0 0)<span style=3D"w=
hite-space:pre-wrap">		</span>; Gamma</div><div><span style=3D"white-space:=
pre-wrap">		</span>=C2=A0(vector3 0 (/ 1 2) 0)<span style=3D"white-space:pr=
e-wrap">		</span>; M</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(vector3 (/ 3) (/ 2 3) 0)<span style=3D"w=
hite-space:pre-wrap">	</span>; K</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(vector3 0 0 0)))<span style=
=3D"white-space:pre-wrap">			</span>; Gamma</div><div><br></div><div>(set! =
k-points (interpolate 32 k-points))</div><div><br></div><div>(run)</div></d=
iv><div><br></div><div><br></div><div>-------------------------------------=
-----------------------------------------------</div><div><br></div><div><b=
r></div><div>So the part where I define material-func is where I&#39;m stuc=
k. As I expected, this code doesn&#39;t work, but I don&#39;t know how to c=
hange it so that it does what I want.</div><div>I&#39;ve also tried similar=
 code with epsilon-func instead of material-func.</div><div><br></div><div>=
I hope someone might be able to help.</div></div>

--000000000000fdc25c057a3a4b8c--


--===============4129438830323297864==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbXBiLWRpc2N1
c3MgbWFpbGluZyBsaXN0Cm1wYi1kaXNjdXNzQGFiLWluaXRpby5taXQuZWR1Cmh0dHA6Ly9hYi1p
bml0aW8ubWl0LmVkdS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vbXBiLWRpc2N1c3M=

--===============4129438830323297864==--