setup_adjoint_simulation#
- PortFom.setup_adjoint_simulation(fdtd_session: FdtdSession, sources: list, sim_result: PortResults) None#
Configure the FDTD session for an adjoint port simulation.
Sets
sim_result.monitor_nameas the active source port for the adjoint run and updates port positions by one mesh cell to account for the monitor/source offset convention used by Lumerical.- Parameters:
- fdtd_session
FdtdSession Active FDTD session to modify.
- sources
list Unused for port-based simulations.
- sim_result
PortResults Port-based simulation result that defines which port monitor to use as the adjoint source.
- fdtd_session
- Raises:
RuntimeErrorIf setting the source port fails.
RuntimeErrorIf the configuration entry for
sim_resultcannot be found inconfig_map.