calculate_gradient_fields#

FieldFom.calculate_gradient_fields(fdtd_session: FdtdSession, parametrization) ndarray#

Compute the gradient of the FOM with respect to permittivity using adjoint fields.

Parameters:
fdtd_sessionFdtdSession

FDTD session providing forward and adjoint field data.

parametrizationBaseParametrization

Current geometry parametrization used to compute the scaling factor.

Returns:
np.ndarray

Real-valued gradient field array of shape (nx, ny, nz, 3) summed over all simulation results and wavelengths.