MCPcopy Create free account
hub / github.com/NanoComp/meep / get_poynting

Method get_poynting

python/solver.py:349–373  ·  view source on GitHub ↗
(self, which_band)

Source from the content-addressed store, hash-verified

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()

Callers 4

output_poyntingFunction · 0.80
output_poynting_xFunction · 0.80
output_poynting_yFunction · 0.80
output_poynting_zFunction · 0.80

Calls 6

get_efieldMethod · 0.95
get_hfieldMethod · 0.95
get_latticeMethod · 0.95
MPBArrayClass · 0.85
set_curfield_cmplxMethod · 0.80
set_curfield_typeMethod · 0.80

Tested by

no test coverage detected