load_base_simulation#

FdtdSession.load_base_simulation(setup: Callable | str, parametrization: BaseParametrization, params: ndarray | None = None) None#

Setup base simulation from file, function, or script.

When the FDTD CAD is visible, all the addfdtd / addport / addpoly / set calls fired by the user’s setup function and by create_optimization_structures() would otherwise each force a UI redraw. Those redraws are by far the slowest part of a per- iteration rebuild, so we wrap the whole sequence in redrawoff / redrawon and let Lumerical batch them into a single repaint at the end.

Parameters:
setupUnion[Callable, str]

Either a callable function, .lsf script path, or .fsp project file path.

parametrizationBaseParametrization

Parametrization instance defining the optimization geometry.

paramsOptional[np.ndarray], optional

Parameter array for geometry generation (default: None).