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:
setupUnion[Callable, str]

Either a callable that sets up the simulation, or a path to a .lsf script or .fsp project file.

parametrizationBaseParametrization

BaseParametrization instance for optimization geometry.

fdtd_sessionFdtdSession, optional

Existing FdtdSession instance (will create new if None, default: None).

fomBaseFom, optional

Figure of merit instance (default: None).

runnerBaseRunner, optional

Runner instance for job management (default: None).

project_namestr, optional

Custom name for saved project files (default: None, uses “lumopt2_project”).

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.

Project.run_adjoint()

Run adjoint simulation(s).

Project.run_forward()

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.

Project.setup_base_simulation([...])

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.