41@plask.material.simple()
42class Glass(plask.material.Material):
43 def nr(self, w, T=300., n=0.):
46@plask.material.simple()
47class Asym(plask.material.Material):
48 def nr(self, w, T=300., n=0.):
51shelf = geometry.Shelf2D()
53 stack = geometry.Stack2D(left=0)
55 stack = geometry.Stack2D(xcenter=0)
57core = geometry.Block2D(wn, h,
Glass())
58air = geometry.Block2D(wa, h, material.air)
70p = stack.append(shelf)
74 main = geometry.Cartesian2D(stack, left=
'mirror', right=
'periodic')
76 main = geometry.Cartesian2D(stack, left=
'periodic', right=
'periodic')
79 main = geometry.Cartesian2D(stack, left=
'mirror', right=
'extend')
81 main = geometry.Cartesian2D(stack, right=
'extend')
83opt = optical.Fourier2D(
"opt")
93opt.set_interface(shelf, p)
106XX = linspace(left, right, 24000)
108msh = mesh.Rectangular2D(XX, [0.5*h])
110for i
in range(-4, 5):
111 axvline((wn+wa)*i, color=
'0.75')
113eps = [main.get_material(x, 0.5*h).nr(opt.wavelength.real).real**2
for x
in XX]
116eps = opt.outEpsilon(msh)
117plot(XX, eps.array[:,0,0,0].real,
'g')
118plot(XX, eps.array[:,0,1,1].real,
'r', label=
'Fourier')
135gcf().canvas.set_window_title(
"%s %s %s" % (
'Symmetric' if symmetric
else 'Asymmetric',
'periodic' if periodic
else '', ft))