Module Configuration¶
- photonforge.config¶
Global configuration for the module.
Important
PhotonForge caches structures to improve efficiency, so
config.gridandconfig.toleranceshould only be set at the start of the session to avoid unexpected behavior.Attributes
- config.default_kwargs = {}¶
Default keyword arguments used by parametric components and the
Tidy3DModel- Examples:
Set a default radius for all components that use a
radiusparameter:>>> config.default_kwargs["radius"] = 50
Set a default Euler fraction only for the
parametric.s_bend()component:>>> config.default_kwargs["s_bend"] = {"euler_fraction": 0.5}
Set a default run time specification for Tidy3D models:
>>> config.default_kwargs["tidy3d"] = {"run_time": 1.0e-12}
- config.default_mesh_refinement = 20.0¶
Default mesh refinement used in Tidy3D grids.
- config.default_technology (initially unset)¶
Default technology for new components.
- config.default_time_steppers = {'*': SMatrixTimeStepper(pole_residue_matrix=None, s_matrix_kwargs={}, initial_poles=(), min_poles=0, max_poles=6, loss_factor=0.001, rms_error_tolerance=0.0001, max_iterations=100, max_stale_iterations=3, passive=True, feedthrough=None, delays='auto'), 'CircuitModel': CircuitTimeStepper(mesh_refinement=None, max_iterations=100, abs_tolerance=1e-08, rel_tolerance=1e-05, max_threads=8, verbose=True)}¶
Default time steppers for models without a time stepper. Each value is a
TimeStepperinstance that is used by default whenModel.time_stepper()is unset. The keys areModelnames to which the defaults apply. A key"*"is used as fallback default.
- config.grid = 0.001¶
Grid for snapping vertices after transformations. See also
snap_to_grid().
- config.tolerance = 0.005¶
Tolerance for geometry discretization (e.g. setting the number of straight segments that make up a curve).
- config.svg_ports = True¶
Show ports in component SVG representations.
- config.svg_port_names = True¶
Show port names in component SVG representations.
- config.svg_labels = True¶
Show labels in component SVG representations.
- config.svg_label_scaling = -1.0¶
Label scaling (positive values scale proportionally to
Label.scalingand negative values are used as absolute factors).
- config.svg_virtual_connections = True¶
Show virtual connections in component SVG representations.
- config.svg_references = True¶
Show references in component SVG representations.
- config.svg_reference_labels = False¶
Show reference labels in component SVG representations.
- config.svg_reference_names = False¶
Show reference names in component SVG representations.
- config.svg_reference_ports = False¶
Show reference ports in component SVG representations.
- config.svg_reference_port_names = False¶
Show reference port names in component SVG representations.
- cache.path = "~/.tidy3d/pf_cache"¶
Path to store cached simulation files.
Warning
This confguration value will be removed in a future version of photonforge. Caching will be handled and cofigured in Tidy3d directly.
- tidy3d_model.use_local_mode_solver = False¶
Flag controlling the use of Tidy3D’s local ModeSolver instead of the remote one.
Constants¶
- photonforge.C_0 = 2.99792458e14¶
Speed of light in vacuum (in µm/s)