get_scaling_factor#

PortFom.get_scaling_factor(fdtd_session: FdtdSession, parametrization, sim_result) ndarray#

Compute a per-wavelength scaling factor for the adjoint gradient (port-based).

For port-based simulations, the scaling factor does not depend on frequency and is therefore uniform across wavelengths.

Parameters:
fdtd_sessionFdtdSession

FDTD session used to query normalization amplitude.

parametrizationBaseParametrization

Current geometry parametrization supplying mesh cell sizes.

sim_resultBaseResults

Simulation result object. The wavelengths are not used here but the parameter is present for a consistent interface with BaseFom.get_scaling_factor().

Returns:
np.ndarray

Array of scaling factors with shape (n_wavelengths,), all equal to 2 * eps0 * dV.