gplugins.gmeep.write_sparameters_meep_batch

gplugins.gmeep.write_sparameters_meep_batch#

gplugins.gmeep.write_sparameters_meep_batch(jobs: list[dict], cores_per_run: int = 2, total_cores: int = 4, temp_dir: Path = PosixPath('/home/runner/.gdsfactory/sp/temp'), delete_temp_files: bool = True, dirpath: Path | None = None, layer_stack: LayerStack | None = None, **kwargs) list[Path][source]#

Write Sparameters for a batch of jobs using MPI and returns results filepaths.

Given a list of write_sparameters_meep keyword arguments jobs launches them in different cores using MPI where each simulation runs with cores_per_run cores. If there are more simulations than cores each batch runs sequentially.

Args
jobs: list of Dicts containing the simulation settings for each job.

for write_sparameters_meep.

cores_per_run: number of processors to assign to each component simulation. total_cores: total number of cores to use. temp_dir: temporary directory to hold simulation files. delete_temp_files: deletes temp_dir when done. dirpath: directory to store Sparameters. layer_stack: contains layer to thickness, zmin and material.

Defaults to active pdk.layer_stack.

Keyword Arguments:
  • resolution – in pixels/um (30: for coarse, 100: for fine).

  • port_symmetries – Dict to specify port symmetries, to save number of simulations.

  • dirpath – directory to store Sparameters.

  • port_margin – margin on each side of the port.

  • port_monitor_offset – offset between monitor GDS port and monitor MEEP port.

  • port_source_offset – offset between source GDS port and source MEEP port.

  • filepath – to store pandas Dataframe with Sparameters in CSV format..

  • animate – saves a MP4 images of the simulation for inspection, and also outputs during computation. The name of the file is the source index.

  • lazy_parallelism – toggles the flag “meep.divide_parallel_processes” to perform the simulations with different sources in parallel.

  • dispersive – use dispersive models for materials (requires higher resolution).

  • xmargin – left and right distance from component to PML.

  • xmargin_left – west distance from component to PML.

  • xmargin_right – east distance from component to PML.

  • ymargin – top and bottom distance from component to PML.

  • ymargin_top – north distance from component to PML.

  • ymargin_bot – south distance from component to PML.

  • extend_ports_length – to extend ports beyond the PML

  • layer_stack – Dict of layer number (int, int) to thickness (um).

  • zmargin_top – thickness for cladding above core.

  • zmargin_bot – thickness for cladding below core.

  • tpml – PML thickness (um).

  • clad_material – material for cladding.

  • is_3d – if True runs in 3D.

  • wavelength_start – wavelength min (um).

  • wavelength_stop – wavelength max (um).

  • wavelength_points – wavelength steps.

  • dfcen – delta frequency.

  • port_source_name – input port name.

  • port_margin – margin on each side of the port.

  • distance_source_to_monitors – in (um) source goes before.

  • port_source_offset – offset between source GDS port and source MEEP port.

  • port_monitor_offset – offset between monitor GDS port and monitor MEEP port.

Returns:

filepath list for sparameters numpy saved files (wavelengths, o1@0,o2@0, …).