98 geo =
geometry.Cartesian2D(stack, left=
'periodic', right=
'periodic', top=
'extend', bottom=
'extend')
105 with Refl(solver,
'tran',
'El')
as refl:
108 self.assertAlmostEqual(R,
R_TE(a), 3)
109 self.assertAlmostEqual(T,
T_TE(a), 3)
112 with Refl(solver,
'tran',
'Et')
as refl:
115 self.assertAlmostEqual(R,
R_TM(a), 3)
116 self.assertAlmostEqual(T,
T_TM(a), 3)
118 if __name__ ==
'__main__':
119 show_plots(solver,
'tran',
'Separated Tran 2D',
True)
123 with Refl(solver,
'long',
'TE')
as refl:
126 self.assertAlmostEqual(R,
R_TM(a), 3)
127 self.assertAlmostEqual(T,
T_TM(a), 3)
129 with Refl(solver,
'long',
'TM')
as refl:
132 self.assertAlmostEqual(R,
R_TE(a), 3)
133 self.assertAlmostEqual(T,
T_TE(a), 3)
135 with Refl(solver,
'tran',
'TE')
as refl:
138 self.assertAlmostEqual(R,
R_TE(a), 3)
139 self.assertAlmostEqual(T,
T_TE(a), 3)
141 with Refl(solver,
'tran',
'TM')
as refl:
144 self.assertAlmostEqual(R,
R_TM(a), 3)
145 self.assertAlmostEqual(T,
T_TM(a), 3)
147 if __name__ ==
'__main__':
158 geo =
geometry.Cartesian3D(stack, left=
'periodic', right=
'periodic', back=
'periodic', front=
'periodic', top=
'extend', bottom=
'extend')
164 with Refl(solver,
'long',
'El')
as refl:
167 self.assertAlmostEqual(R,
R_TM(a), 3)
168 self.assertAlmostEqual(T,
T_TM(a), 3)
170 with Refl(solver,
'long',
'Et')
as refl:
173 self.assertAlmostEqual(R,
R_TE(a), 3)
174 self.assertAlmostEqual(T,
T_TE(a), 3)
176 with Refl(solver,
'tran',
'El')
as refl:
179 self.assertAlmostEqual(R,
R_TE(a), 3)
180 self.assertAlmostEqual(T,
T_TE(a), 3)
182 with Refl(solver,
'tran',
'Et')
as refl:
185 self.assertAlmostEqual(R,
R_TM(a), 3)
186 self.assertAlmostEqual(T,
T_TM(a), 3)
188 if __name__ ==
'__main__':