(self, which_band)
| 347 | return np.reshape(arr, dims) |
| 348 | |
| 349 | def get_poynting(self, which_band): |
| 350 | e = self.get_efield(which_band, False) |
| 351 | dims = e.shape |
| 352 | e = e.ravel() |
| 353 | h = self.get_hfield(which_band, False).ravel() |
| 354 | # Reshape into rows of vector3s |
| 355 | e = e.reshape((int(e.shape[0] / 3), 3)) |
| 356 | h = h.reshape((int(h.shape[0] / 3), 3)) |
| 357 | |
| 358 | res = np.zeros(e.shape, dtype=np.complex128) |
| 359 | |
| 360 | def ExH(e, h): |
| 361 | ev = mp.Vector3(e[0], e[1], e[2]) |
| 362 | hv = mp.Vector3(h[0], h[1], h[2]) |
| 363 | return ev.conj().cross(hv) |
| 364 | |
| 365 | for i in range(e.shape[0]): |
| 366 | res[i] = np.array(ExH(e[i], h[i])) |
| 367 | |
| 368 | flat_res = res.ravel() |
| 369 | self.mode_solver.set_curfield_cmplx(flat_res) |
| 370 | self.mode_solver.set_curfield_type("v") |
| 371 | |
| 372 | arr = np.reshape(res, dims) |
| 373 | return MPBArray(arr, self.get_lattice(), self.current_k) |
| 374 | |
| 375 | def get_epsilon(self): |
| 376 | self.mode_solver.get_epsilon() |
no test coverage detected