Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manually trigger garbage collection in Meep waveguide converter simulation #23

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion waveguide_mode_converter/mode_converter_meep.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def mode_converter(design_fname: str):

eig_parity = mp.ODD_Z
src_pt = mp.Vector3(-0.5*sx+dpml,0)
sources = [mp.EigenModeSource(src=mp.GaussianSource(fcen,fwidth=df),
sources = [mp.EigenModeSource(mp.GaussianSource(fcen,fwidth=df),
size=mp.Vector3(0,sy),
center=src_pt,
eig_band=1,
Expand Down Expand Up @@ -139,6 +139,9 @@ def mode_converter(design_fname: str):
tran = np.abs(coeffs[0,:,0])**2 / input_flux
tran_flux = np.array(mp.get_fluxes(tran_mon))

# force the garbage collection
sim.reset_meep()

sparam_to_dB = lambda s: 20 * np.log10(s)

for idx,wvl in enumerate(wvls):
Expand Down