Use overlap_e

This commit is contained in:
jan 2019-09-05 22:42:39 +02:00
parent 2289c6d116
commit 10e275611d

View File

@ -137,7 +137,7 @@ def test1(solver=generic_solver):
wg_results = waveguide_mode.solve_waveguide_mode(mode_number=0, **wg_args) wg_results = waveguide_mode.solve_waveguide_mode(mode_number=0, **wg_args)
J = waveguide_mode.compute_source(**wg_args, E=wg_results['E'], wavenumber=wg_results['wavenumber']) J = waveguide_mode.compute_source(**wg_args, E=wg_results['E'], wavenumber=wg_results['wavenumber'])
H_overlap, slices = waveguide_mode.compute_overlap_ce(E=wg_results['E'], wavenumber=wg_results['wavenumber'], e_overlap = waveguide_mode.compute_overlap_e(E=wg_results['E'], wavenumber=wg_results['wavenumber'],
dxes=dxes, axis=src_axis, polarity=wg_args['polarity'], dxes=dxes, axis=src_axis, polarity=wg_args['polarity'],
slices=wg_args['slices']) slices=wg_args['slices'])
@ -212,8 +212,8 @@ def test1(solver=generic_solver):
q = [] q = []
for i in range(-5, 30): for i in range(-5, 30):
H_rolled = [numpy.roll(h, i, axis=0) for h in H_overlap] e_ovl_rolled = numpy.roll(e_overlap, i, axis=1)
q += [numpy.abs(vec(E) @ vec(H_rolled).conj())] q += [numpy.abs(vec(E) @ vec(e_ovl_rolled).conj())]
pyplot.figure() pyplot.figure()
pyplot.plot(q) pyplot.plot(q)
pyplot.title('Overlap with mode') pyplot.title('Overlap with mode')