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 BaseFom and specializes adjoint source setup and adjoint field extraction for field monitors.

Parameters:
sim_resultsFieldResults or list of FieldResults

One or more field monitor result objects.

fctcallable(), optional

Scalar-valued function of the monitor values. Defaults to anp.mean(x), which averages the values across all monitors.

Methods

FieldFom.calculate_fom(fdtd_session)

Compute the figure of merit using the user-defined function and monitor results.

FieldFom.calculate_gradient_fields(...)

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

FieldFom.create_project_folder()

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.

FieldFom.setup_adjoint_simulation(...)

Configure the FDTD session for an adjoint field simulation.

Attributes

FieldFom.supports_concurrent_adjoint

Whether forward and adjoint simulations can be run concurrently.