84 solver.symmetry =
None, sym
86 solver.symmetry =
None,
None
88 start = {
'Ez': 1.1433,
'Ex': 1.115}[sym]
100 mod = solver.find_mode(klong=start*solver.k0)
102 solver.modes[mod].power = 1.
103 print_log(
'result', f
"neff: {solver.modes[mod].klong/solver.modes[mod].k0}", solver.modes[mod])
105 lx = (solver.pmls.tran.size + L/2.)
106 ly_b = - rect_bottom.height - solver.vpml.dist - solver.vpml.size
107 ly_t = rect_top.height + solver.vpml.dist + solver.vpml.size
109 XX = linspace(-lx, lx, 201)
110 YY = linspace(ly_b, ly_t, 201)
113 h = h_top - stack.bbox.height / 2
116 msh = mesh.Rectangular3D(ZZ, XX, YY)
117 field = solver.outLightMagnitude(mod, msh, interp)
119 im = plot_field(field, plane=
'xy')
120 colorbar(im, use_gridspec=
True)
121 plot_geometry(solver.geometry,
'w', mirror=
True, plane=
'xy')
122 axvline(0, color=
'w', ls=
':')
123 axhline(h, color=
'w', ls=
':')
124 gcf().canvas.set_window_title(
'2D intensity [{}]'.format(sym))
128 msh = mesh.Rectangular3D(ZZ, [0.], YY)
129 field =
provider(mod, msh, interp).array[0,0,:,comp]
133 bboxes = space.get_leafs_bboxes()
136 lines.add(box.lower.y)
137 lines.add(box.upper.y)
139 axhline(line, ls=
':', color=
'k')
140 axhline(space.bbox.lower.y-solver.vpml.dist, ls=
':', color=
'y')
141 axhline(space.bbox.upper.y+solver.vpml.dist, ls=
':', color=
'y')
142 gcf().canvas.set_window_title(
"E{} (y) [{}]".format(config.axes[comp], sym))
147 msh = mesh.Rectangular3D(ZZ, XX, [h])
148 field =
provider(mod, msh, interp).array[0,:,0,comp]
153 bboxes = space.get_leafs_bboxes()
156 lines.add(box.lower.x)
157 lines.add(box.upper.x)
159 axvline(line, ls=
':', color=
'k')
160 gcf().canvas.set_window_title(
"E{} (x) [{}]".format(config.axes[comp], sym))
164 integral_mesh = mesh.Rectangular3D([-1, 1],
166 mesh.Regular(-lx, lx, 1001),
167 mesh.Regular(box.bottom, box.top, 1001))
168 dx, dy = integral_mesh.axis1[1] - integral_mesh.axis1[0], integral_mesh.axis2[1] - integral_mesh.axis2[0]
169 integral_mesh = integral_mesh.elements.mesh
171 E = solver.outLightE(mod, integral_mesh).array
172 E2 = sum(real(E*conj(E)), -1)
173 print_log(
'result',
"E:", 0.5 * sum(E2) * dx * dy / solver.integrateEE(mod, box.bottom, box.top))
175 H = solver.outLightH(mod, integral_mesh).array
176 H2 = sum(real(H*conj(H)), -1)
177 print_log(
'result',
"H:", 0.5 * sum(H2) * dx * dy / solver.integrateHH(mod, box.bottom, box.top))