FDTD on GDSFactory+ Cloud#

MEEP is an open-source FDTD electromagnetic simulator. This notebook demonstrates using the gsim.meep API to run an S-parameter simulation on a parametric cell and visualize the data.

Requirements:

  • Corner Stone PDK: uv pip install cspdk

  • GDSFactory Simulation SDK: uv pip install gsim

  • GDSFactory+ account for cloud simulation

Load a pcell from UBC PDK#

from cspdk.si220.cband import PDK, cells

PDK.activate()

c = cells.coupler(length=20)

c
../_images/64ad40e61f7c70831bc430624371f87d22a8cd69cc1ef54f9f3490ca958a7022.png

Configure and run simulation#

from gsim import meep

sim = meep.Simulation()

sim.geometry(component=c, z_crop="auto")
sim.materials = {"si": 3.47, "SiO2": 1.44}
sim.source(port="o1", wavelength=1.55, wavelength_span=0.04, num_freqs=21)
sim.monitors = ["o1", "o2", "o3", "o4"]
sim.domain(pml=1.0, margin=0.5)
sim.solver(resolution=20, save_animation=True, verbose_interval=5.0)
sim.solver.stop_after_sources(time=150)

print(sim.validate_config())
Stack validation: PASSED
Warnings:
  - No stack configured. Will use active PDK with defaults.
sim.plot_2d(slices="xyz")
../_images/b0b545eda479a9aff12afb5f29477aced08b090c39ed158df016c165bc852cad.png

Run simulation on cloud#

# Run on GDSFactory+ cloud
result = sim.run()
  meep-489bbf17  completed  14m 08s
Extracting results.tar.gz...
Downloaded 462 files to /home/runner/work/cspdk/cspdk/docs/notebooks/sim-data-meep-489bbf17
result.plot(db=True)
../_images/283f7e22e204d3ffce930a3d982ff4ef3168913d11e0fce0209deee324d69d97.png
result.show_animation()