106 self.
solver.domain =
'finite'
108 self.assertEqual(m, 0)
109 self.assertEqual(
len(self.
solver.modes), 1)
112 self.assertAlmostEqual(self.
solver.modes[m].
lam.imag, -0.02077, 3)
120 E = self.
solver.outLightE(m, msh).array[:,0,:]
121 H = self.
solver.outLightH(m, msh).array[:,0,:]
122 P = 0.5 * real(E[:,1]*
conj(H[:,0]) - E[:,0]*
conj(H[:,1]))
123 self.assertAlmostEqual(2e3*pi *
sum(1e-6*rr * P) * dr / self.
solver.modes[m].power, 1.0, 3)
126 self.
solver.domain =
'infinite'
129 self.assertEqual(m, 0)
130 self.assertEqual(
len(self.
solver.modes), 1)
132 self.assertAlmostEqual(self.
solver.modes[m].
lam.imag, -0.02077, 3)
140 E = self.
solver.outLightE(m, msh).array[:,0,:]
141 H = self.
solver.outLightH(m, msh).array[:,0,:]
142 P = 0.5 * real(E[:,1]*
conj(H[:,0]) - E[:,0]*
conj(H[:,1]))
143 self.assertAlmostEqual(2e3*pi *
sum(1e-6*rr * P) * dr / self.
solver.modes[m].power, 1.0, 2)
146 self.
solver.domain = domain
147 if kscale
is not None:
148 self.
solver.kscale = kscale
159 E = self.
solver.outLightE(integral_mesh).array
161 EE0 = 0.5 * 2*pi *
sum((rr * E2).
ravel()) * dr * dz
163 self.assertAlmostEqual(EE0 / EE1, 1., prec)
165 H = self.
solver.outLightH(integral_mesh).array
167 HH0 = 0.5 * 2*pi *
sum((rr * H2).
ravel()) * dr * dz
169 self.assertAlmostEqual(HH0 / HH1, 1., prec)