Project#
- class lumopt2.core.project.Project(setup: Callable | str, parametrization: BaseParametrization, fdtd_session: FdtdSession = None, fom: BaseFom = None, runner: BaseRunner = None, project_name: str = None)#
Main project class that coordinates parametrization, FOM, and solver.
- Parameters:
- setup
Union[Callable,str] Either a callable that sets up the simulation, or a path to a .lsf script or .fsp project file.
- parametrization
BaseParametrization BaseParametrization instance for optimization geometry.
- fdtd_session
FdtdSession,optional Existing FdtdSession instance (will create new if None, default: None).
- fom
BaseFom,optional Figure of merit instance (default: None).
- runner
BaseRunner,optional Runner instance for job management (default: None).
- project_name
str,optional Custom name for saved project files (default: None, uses “lumopt2_project”).
- setup
Methods
Project.compute_fom([params])Compute the figure of merit for the current simulation.
Project.compute_gradient([params])Compute the gradient of the figure of merit with respect to parameters.
Project.generate([params])Generate the optimization project by setting up the base simulation.
Project.load_forward_results([config_key])Reload a completed forward simulation file into the FDTD session.
Run adjoint simulation(s).
Run forward simulation.
Project.save_project(filename[, params])Saves the current project to a specified file, or to the project folder if no file is specified.
Project.set_adj([params])Generate the files for the adjoint simulations to run.
Project.set_fwd([params])Generate the files for the forward simulations to run.
Return the FDTD session to the base setup.
Project.update_geometry(params)Update the geometry in the FDTD CAD with new parameters.
Project.visualize_fom([params])Generate and visualize the simulation project with given parameters and computes the figure of merit.
Project.visualize_geometry([params])Generate and visualize the base simulation project.