FDTD Meep gratings#
Meep can also compute grating coupler Sparameters and far field.
grating sparameters#
fiber_xposition
|
fiber_core_diameter
/ / / / |
/ / / / | fiber_thickness
/ / / / _ _ _| _ _ _ _ _ _ _
|
| air_gap_thickness
_ _ _| _ _ _ _ _ _ _
|
clad_material | top_clad_thickness
_ _ _| _ _ _ _ _ _ _
_|-|_|-|_|-|___ | _| etch_depth
core_material | |core_thickness
______________|_ _ _|_ _ _ _ _ _ _ _
|
nbox |box_thickness
______________ _ _ _|_ _ _ _ _ _ _ _
|
nsubstrate |substrate_thickness
______________ _ _ _|
import gdsfactory as gf
from gdsfactory.generic_tech import get_generic_pdk
import gplugins as sim
import gplugins.gmeep as gm
gf.config.rich_output()
PDK = get_generic_pdk()
PDK.activate()
Using MPI version 4.1, 1 processes
2024-08-16 06:15:59.035 | INFO | gplugins.gmeep:<module>:39 - Meep '1.29.0' installed at ['/home/runner/micromamba/lib/python3.11/site-packages/meep']
sp = gm.write_sparameters_grating(plot=True)
Warning: grid volume is not an integer number of pixels; cell size will be rounded to nearest pixel.
sp = gm.write_sparameters_grating(plot=True, plot_contour=True)
Warning: grid volume is not an integer number of pixels; cell size will be rounded to nearest pixel.
sp = gm.write_sparameters_grating(plot=True, plot_contour=True, fiber_angle_deg=45)
Warning: grid volume is not an integer number of pixels; cell size will be rounded to nearest pixel.
plot=True
only plots the simulations for you to review that is set up correctly
However the core and cladding index of the fiber are very close to 1.44, so it’s hard to see. You can also use
plot_contour=True
to plot only the contour of the simulation shapes.
sp20 = gm.write_sparameters_grating() # fiber_angle_deg = 20
sim.plot.plot_sparameters(sp20)
sp = gm.write_sparameters_grating(fiber_angle_deg=15)
sim.plot.plot_sparameters(sp)
Single core#
Running on a single CPU core can be slow as the a single core needs to update all the simulation grid points sequentially.
Multicore (MPI)#
You can divide each simulation into multiple cores thanks to MPI (message passing interface)
Batch#
You can also run a batch of multicore simulations
Far field#
TODO