FdtdSession#

class lumopt2.core.fdtd_session.FdtdSession(show_fdtd_cad: bool = False)#

A class to manage the FDTD simulation session.

Parameters:
show_fdtd_cadbool, optional

Whether to display the FDTD CAD interface (default: False).

Methods

FdtdSession.add_field_monitors(box)

Add DFT field monitors to the FDTD simulation.

FdtdSession.add_index_monitors(box)

Add index monitors to the FDTD simulation.

FdtdSession.add_nk_import_object(box, ...)

Add an nk import object to the FDTD simulation.

FdtdSession.check_object_for_source(idx[, ...])

Check whether the object at index idx contains an active source.

FdtdSession.check_simulation_success([...])

Check if the simulation completed successfully.

FdtdSession.close()

Close the underlying Lumerical FDTD session.

FdtdSession.get_active_sources()

Get a list of all active sources in the simulation.

FdtdSession.get_dict_values_at_wavelengths(...)

Extract several values from one getresult call, sliced per wavelength.

FdtdSession.get_fields_at_wavelengths(sim_result)

Extract monitor values from a simulation at each requested wavelength.

FdtdSession.get_result(monitor_name, key_name)

Get results from a monitor in the FDTD simulation.

FdtdSession.get_simulation_status()

Get the status of the most recent FDTD simulation.

FdtdSession.invalidate_loaded_state()

Mark the in-memory FDTD state as no longer matching any file.

FdtdSession.load_base_simulation(setup, ...)

Setup base simulation from file, function, or script.

FdtdSession.load_if_needed(filename)

Load filename only if it isn't already the active project.

FdtdSession.lock_grid()

Lock the FDTD grid to prevent changes to the grid size and ensure consistency across simulations.

FdtdSession.mark_as_loaded(filename)

Record filename as the file that matches the in-memory state.

FdtdSession.remove_objects_by_name(object_names)

Remove objects from FDTD simulation by name.

FdtdSession.set_mesh_refinement_region(box, ...)

Add a mesh refinement region to the FDTD simulation.

FdtdSession.set_working_directory(workingDir)

Set the working directory for the FDTD session.

FdtdSession.update_polygon(structure[, ...])

Create or update the optimization polygon in the FDTD CAD.

FdtdSession.update_polygon_vertices(vertices)

Update the optimization polygon object in the FDTD CAD with new vertices.

FdtdSession.update_properties_in_cad(properties)

Update object properties in the FDTD CAD.

FdtdSession.verify_base_simulation()

Verify simulation setup: - Should contain an FDTD structure.

FdtdSession.verify_uniform_mesh_size(box)

Verify that the mesh size within the optimization region is uniform.