FieldFom#
- class lumopt2.fom.field_fom.FieldFom(sim_results, fct=None)#
Figure of merit calculator for field-based (DFT monitor) simulations.
Inherits all shared FOM logic from
BaseFomand specializes adjoint source setup and adjoint field extraction for field monitors.- Parameters:
- sim_results
FieldResultsorlistofFieldResults One or more field monitor result objects.
- fct
callable(),optional Scalar-valued function of the monitor values. Defaults to
anp.mean(x), which averages the values across all monitors.
- sim_results
Methods
FieldFom.calculate_fom(fdtd_session)Compute the figure of merit using the user-defined function and monitor results.
Compute the gradient of the FOM with respect to permittivity using adjoint fields.
Create the project folder based on the project name in the config map.
FieldFom.dipole_base_amplitude(freq[, ...])Compute the dipole amplitude that produces power_target [W] at frequency freq [Hz].
FieldFom.get_adjoint_fields(fdtd_session, entry)Extract adjoint field for field-based simulation.
FieldFom.get_jacobian(fdtd_session)Compute the Jacobian of the FOM with respect to monitor result values.
FieldFom.get_scaling_factor(fdtd_session, ...)Compute a per-wavelength scaling factor for the adjoint gradient (field-based).
FieldFom.set_project_name(project_name)Set the project name used to determine the simulation output folder.
Configure the FDTD session for an adjoint field simulation.
Attributes
Whether forward and adjoint simulations can be run concurrently.