load_forward_results#

Project.load_forward_results(config_key: Any = None) None#

Reload a completed forward simulation file into the FDTD session.

compute_gradient returns with the FDTD session in a freshly rebuilt base-setup state (no monitor data) because computing the dEps/dP Jacobian requires reverting to a clean geometry. Callers that want to inspect monitor results after gradient computation – typically live visualizations such as GraphicalVisualizer – can use this method to restore the post-forward-simulation state.

The .fsp file written by set_fwd() already contains the recorded fields, so this is a fast disk load rather than a new simulation.

Parameters:
config_keyhashable, optional

Specific config to load. When None (the default) the first config in fom.config_map is loaded, which is the common single-config case.

Raises:
RuntimeError

If the project has no FDTD session, the FOM/config map is missing, or the requested forward simulation file does not exist on disk yet (e.g. compute_fom has not been called).

KeyError

If config_key is provided but not present in the config map.