tidy3d.RunTimeSpec#
- class RunTimeSpec[source]#
Bases:
Tidy3dBaseModel
Defines specification for how long to run a simulation when added to
Simulation.run_time
.- Parameters:
attrs (dict = {}) β Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields,
attrs
are mutable. For example, the following is allowed for setting anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are serializable by callingobj.json()
.quality_factor (PositiveFloat) β Quality factor expected in the device. This determines how long the simulation will run as it assumes a field decay time that scales proportionally to this value.
source_factor (PositiveFloat = 3) β The contribution to the
run_time
from the longest source is computed from thesource_time
length timessource_factor
. Larger values provide more buffer at the expense of potentially givingrun_time
values that are larger than needed.
Notes
The evaluated
run_time
will be computed from aRunTimeSpec()
as follows:\[\text{run_time} = \text{source_factor} * T_{src_max} + \text{quality_factor} n_{max} L_{max} / c_{0}\]Where:
source_factor
andquality_factor
are fields in the spec, \(T_{src_max}\) is the longest time that a source is non-zero, \(n_{max}\) is the maximum refractive index in the simulation, \(L_{max}\) is the distance along the largest dimension in the simulation, and \(c_0\) is the speed of light in vacuum.Attributes
Methods
Inherited Common Usage
- quality_factor#
- source_factor#
- __hash__()#
Hash method.