setup_adjoint_simulation#

FieldFom.setup_adjoint_simulation(fdtd_session: FdtdSession, sources: list, sim_result: FieldResults) None#

Configure the FDTD session for an adjoint field simulation.

Reads and conjugates the forward E-field from sim_result, switches the session to layout mode, disables all forward sources, enables source mode on the monitor associated with sim_result, and configures that adjoint source with the conjugated forward E-field.

Parameters:
fdtd_sessionFdtdSession

Active FDTD session to modify. Must be in analysis mode with forward-simulation results.

sourceslist

List of forward source descriptors (source_type, source_name) to disable.

sim_resultFieldResults

Simulation result whose monitor will be switched to source mode.

Raises:
RuntimeError

If disabling the forward sources fails.

RuntimeError

If switching the monitor to source mode fails.