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 photonic Y-branch.

Requirements:

  • UBC PDK: uv pip install ubcpdk

  • GDSFactory Simulation SDK: uv pip install gsim

  • GDSFactory+ account for cloud simulation

Load a pcell from UBC PDK#

from ubcpdk import PDK, cells

PDK.activate()

c = cells.ebeam_y_1550()
c
../_images/42a3f0c7d4312be19760ccfd1cca560767307a2250795bff057989c6b6202f36.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.01, num_freqs=11)
sim.monitors = ["o1", "o2", "o3"]
sim.domain(pml=1.0, margin=0.5)
sim.solver(resolution=20, simplify_tol=0.01, save_animation=True, verbose_interval=5.0)
sim.solver.stop_after_sources(time=60)

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

Run simulation on cloud#

# Run on GDSFactory+ cloud
result = sim.run()
Uploading simulation... 
done
Job started: meep-ec7d1165
Created: 19:49:06 | Now: 19:58:38 | Status: completed
Extracting results.tar.gz...
Downloaded 282 files to /home/runner/work/ubc/ubc/docs/notebooks/sim-data-meep-ec7d1165
result.plot(db=True)
../_images/9b7c67a84f7366533eafc98a518d4f1a317c58e0ab8fc27c286d6fd0ec4d6bbf.png
result.show_animation()