diff --git a/CHANGELOG.md b/CHANGELOG.md
index cf497c0c4b..aacf65e339 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Selective simulation capabilities to `TerminalComponentModeler` via `run_only` and `element_mappings` fields, allowing users to run fewer simulations and extract only needed scattering matrix elements.
- Added KLayout plugin, with DRC functionality for running design rule checks in `plugins.klayout.drc`. Supports running DRC on GDS files as well as `Geometry`, `Structure`, and `Simulation` objects.
+- Added "mil" and "in" (inch) units to `plot_length_units`.
### Changed
- Validate mode solver object for large number of grid points on the modal plane.
diff --git a/schemas/EMESimulation.json b/schemas/EMESimulation.json
index e2ddb32646..67be0f9eab 100644
--- a/schemas/EMESimulation.json
+++ b/schemas/EMESimulation.json
@@ -1,6 +1,6 @@
{
"title": "EMESimulation",
- "description": "EigenMode Expansion (EME) simulation.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. \nsources : Tuple[NoneType, ...] = ()\n Sources in the simulation. NOTE: sources are not currently supported for EME simulations. Instead, the simulation performs full bidirectional propagation in the 'port_mode' basis. After running the simulation, use 'smatrix_in_basis' to use another set of modes or input field.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, minus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, type='Boundary'), y=Boundary(attrs={},, plus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, minus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, type='Boundary'), z=Boundary(attrs={},, plus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, minus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. By default, PEC boundary conditions are applied on all sides. This field is for consistency with FDTD simulations; however, please note that regardless of the 'boundary_spec', the mode solver terminates the mode plane with PEC boundary. The 'EMEModeSpec' can be used to apply PML layers in the mode solver.\nmonitors : Tuple[Annotated[Union[tidy3d.components.eme.monitor.EMEModeSolverMonitor, tidy3d.components.eme.monitor.EMEFieldMonitor, tidy3d.components.eme.monitor.EMECoefficientMonitor, tidy3d.components.monitor.ModeSolverMonitor, tidy3d.components.monitor.PermittivityMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_y=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_z=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), wavelength=None, override_structures=(), snapping_points=(), layer_refinement_specs=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions. This is distinct from 'eme_grid_spec', which defines the 1D EME grid in the propagation direction.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nlumped_elements : Tuple[Annotated[Union[tidy3d.components.lumped_element.LumpedResistor, tidy3d.components.lumped_element.CoaxialLumpedResistor, tidy3d.components.lumped_element.LinearLumpedElement], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of lumped elements in the simulation. Note: only :class:`tidy3d.LumpedResistor` is supported currently.\nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3,, edge_singularity_correction=False), pmc=Staircasing(attrs={},, type='Staircasing'), lossy_metal=SurfaceImpedance(attrs={},, type='SurfaceImpedance',, timestep_reduction=0.0,, edge_singularity_correction=False), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\nfreqs : Union[tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n Frequencies for the EME simulation. The field is propagated independently at each provided frequency. This can be slow when the number of frequencies is large. In this case, consider using the approximate 'EMEFreqSweep' as the 'sweep_spec' instead of providing all desired frequencies here.\naxis : Literal[0, 1, 2]\n Propagation axis (0, 1, or 2) for the EME simulation.\neme_grid_spec : Union[EMEUniformGrid, EMECompositeGrid, EMEExplicitGrid]\n Specification for the EME propagation grid. The simulation is divided into cells in the propagation direction; this parameter specifies the layout of those cells. Mode solving is performed in each cell, and then propagation between cells is performed to determine the complete solution. This is distinct from 'grid_spec', which defines the grid in the two tangential directions, as well as the grid used for field monitors.\nstore_port_modes : bool = True\n Whether to store the modes associated with the two ports. Required to find scattering matrix in basis besides the computational basis.\nnormalize : bool = True\n Whether to normalize the port modes to unity flux, thereby normalizing the scattering matrix and expansion coefficients.\nport_offsets : Tuple[NonNegativeFloat, NonNegativeFloat] = (0, 0)\n Offsets for the two ports, relative to the simulation bounds along the propagation axis.\nsweep_spec : Union[EMELengthSweep, EMEModeSweep, EMEFreqSweep, EMEPeriodicitySweep, NoneType] = None\n Specification for a parameter sweep to be performed during the EME propagation step. The results are stored in 'sim_data.smatrix'. Other simulation monitor data is not included in the sweep.\nconstraint : Optional[Literal['passive', 'unitary']] = passive\n Constraint for EME propagation, imposed at cell interfaces. A constraint of 'passive' means that energy can be dissipated but not created at interfaces. A constraint of 'unitary' means that energy is conserved at interfaces (but not necessarily within cells). The option 'none' may be faster for a large number of modes. The option 'passive' can serve as regularization for the field continuity requirement and give more physical results.\n\nNotes\n-----\n\n EME is a frequency-domain method for propagating the electromagnetic field along a\n specified axis. The method is well-suited for propagation of guided waves.\n The electromagnetic fields are expanded locally in the basis of eigenmodes of the\n waveguide; they are then propagated by imposing continuity conditions in this basis.\n\n The EME simulation is performed along the propagation axis ``axis`` at frequencies ``freqs``.\n The simulation is divided into cells along the propagation axis, as defined by\n ``eme_grid_spec``. Mode solving is performed at cell centers, and boundary conditions are\n imposed between cells. The EME ports are defined to be the boundaries of the first and last\n cell in the EME grid. These can be moved using ``port_offsets``.\n\n An EME simulation always computes the full scattering matrix of the structure.\n Additional data can be recorded by adding 'monitors' to the simulation.\n\n **Other Bases**\n\n By default, the scattering matrix is expressed in the basis of EME modes at the two ports. It is sometimes useful to use alternative bases. For example, in a waveguide splitter, we might want the scattering matrix in the basis of modes of the individual waveguides. The functions `smatrix_in_basis` and `field_in_basis` in :class:`.EMESimulationData` can be used for this purpose after the simulation has been run.\n\n **Frequency Sweeps**\n\n Frequency sweeps are supported by including multiple frequencies in the `freqs` field. However, our EME solver repeats the mode solving for each new frequency, so frequency sweeps involving a large number of frequencies can be slow and expensive. If a large number of frequencies are required, consider using our FDTD solver instead.\n\n **Passivity and Unitarity Constraints**\n\n Passivity and unitarity constraints can be imposed via the `constraint` field. These constraints are imposed at interfaces between cells, possibly at the expense of field continuity. Passivity means that the interface can only dissipate energy, and unitarity means the interface will conserve energy (energy may still be dissipated inside cells when the propagation constant is complex). Adding constraints can slow down the simulation significantly, especially for a large number of modes (more than 30 or 40).\n\n **Too Many Modes**\n\n It is important to use enough modes to capture the physics of the device and to ensure that the results have converged (see below). However, using too many modes can slow down the simulation and result in numerical issues. If too many modes are used, it is common to see a warning about invalid modes in the simulation log. While these modes are not included in the EME propagation, this can indicate some other issue with the setup, especially if the results have not converged. In this case, extending the simulation size in the transverse directions and increasing the grid resolution may help by creating more valid modes that can be used in convergence testing.\n\n **Mode Convergence Sweeps**\n\n It is a good idea to check that the number of modes is large enough by running a mode convergence sweep. This can be done using :class:`.EMEModeSweep`.\n\nExample\n-------\n>>> from tidy3d import Box, Medium, Structure, C_0, inf\n>>> from tidy3d import EMEModeSpec, EMEUniformGrid, GridSpec\n>>> from tidy3d import EMEFieldMonitor\n>>> lambda0 = 1550e-9\n>>> freq0 = C_0 / lambda0\n>>> sim_size = 3*lambda0, 3*lambda0, 3*lambda0\n>>> waveguide_size = (lambda0/2, lambda0, inf)\n>>> waveguide = Structure(\n... geometry=Box(center=(0,0,0), size=waveguide_size),\n... medium=Medium(permittivity=2)\n... )\n>>> eme_grid_spec = EMEUniformGrid(num_cells=5, mode_spec=EMEModeSpec(num_modes=10))\n>>> grid_spec = GridSpec(wavelength=lambda0)\n>>> field_monitor = EMEFieldMonitor(\n... size=(0, sim_size[1], sim_size[2]),\n... name=\"field_monitor\"\n... )\n>>> sim = EMESimulation(\n... size=sim_size,\n... monitors=[field_monitor],\n... structures=[waveguide],\n... axis=2,\n... freqs=[freq0],\n... eme_grid_spec=eme_grid_spec,\n... grid_spec=grid_spec\n... )\n\nSee Also\n--------\n\n**Notebooks:**\n * `EME Solver Demonstration <../../notebooks/docs/features/eme.rst>`_",
+ "description": "EigenMode Expansion (EME) simulation.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. \nsources : Tuple[NoneType, ...] = ()\n Sources in the simulation. NOTE: sources are not currently supported for EME simulations. Instead, the simulation performs full bidirectional propagation in the 'port_mode' basis. After running the simulation, use 'smatrix_in_basis' to use another set of modes or input field.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, minus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, type='Boundary'), y=Boundary(attrs={},, plus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, minus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, type='Boundary'), z=Boundary(attrs={},, plus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, minus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. By default, PEC boundary conditions are applied on all sides. This field is for consistency with FDTD simulations; however, please note that regardless of the 'boundary_spec', the mode solver terminates the mode plane with PEC boundary. The 'EMEModeSpec' can be used to apply PML layers in the mode solver.\nmonitors : Tuple[Annotated[Union[tidy3d.components.eme.monitor.EMEModeSolverMonitor, tidy3d.components.eme.monitor.EMEFieldMonitor, tidy3d.components.eme.monitor.EMECoefficientMonitor, tidy3d.components.monitor.ModeSolverMonitor, tidy3d.components.monitor.PermittivityMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_y=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_z=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), wavelength=None, override_structures=(), snapping_points=(), layer_refinement_specs=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions. This is distinct from 'eme_grid_spec', which defines the 1D EME grid in the propagation direction.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm', 'mil', 'in']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nlumped_elements : Tuple[Annotated[Union[tidy3d.components.lumped_element.LumpedResistor, tidy3d.components.lumped_element.CoaxialLumpedResistor, tidy3d.components.lumped_element.LinearLumpedElement], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of lumped elements in the simulation. Note: only :class:`tidy3d.LumpedResistor` is supported currently.\nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3,, edge_singularity_correction=False), pmc=Staircasing(attrs={},, type='Staircasing'), lossy_metal=SurfaceImpedance(attrs={},, type='SurfaceImpedance',, timestep_reduction=0.0,, edge_singularity_correction=False), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\nfreqs : Union[tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n Frequencies for the EME simulation. The field is propagated independently at each provided frequency. This can be slow when the number of frequencies is large. In this case, consider using the approximate 'EMEFreqSweep' as the 'sweep_spec' instead of providing all desired frequencies here.\naxis : Literal[0, 1, 2]\n Propagation axis (0, 1, or 2) for the EME simulation.\neme_grid_spec : Union[EMEUniformGrid, EMECompositeGrid, EMEExplicitGrid]\n Specification for the EME propagation grid. The simulation is divided into cells in the propagation direction; this parameter specifies the layout of those cells. Mode solving is performed in each cell, and then propagation between cells is performed to determine the complete solution. This is distinct from 'grid_spec', which defines the grid in the two tangential directions, as well as the grid used for field monitors.\nstore_port_modes : bool = True\n Whether to store the modes associated with the two ports. Required to find scattering matrix in basis besides the computational basis.\nnormalize : bool = True\n Whether to normalize the port modes to unity flux, thereby normalizing the scattering matrix and expansion coefficients.\nport_offsets : Tuple[NonNegativeFloat, NonNegativeFloat] = (0, 0)\n Offsets for the two ports, relative to the simulation bounds along the propagation axis.\nsweep_spec : Union[EMELengthSweep, EMEModeSweep, EMEFreqSweep, EMEPeriodicitySweep, NoneType] = None\n Specification for a parameter sweep to be performed during the EME propagation step. The results are stored in 'sim_data.smatrix'. Other simulation monitor data is not included in the sweep.\nconstraint : Optional[Literal['passive', 'unitary']] = passive\n Constraint for EME propagation, imposed at cell interfaces. A constraint of 'passive' means that energy can be dissipated but not created at interfaces. A constraint of 'unitary' means that energy is conserved at interfaces (but not necessarily within cells). The option 'none' may be faster for a large number of modes. The option 'passive' can serve as regularization for the field continuity requirement and give more physical results.\n\nNotes\n-----\n\n EME is a frequency-domain method for propagating the electromagnetic field along a\n specified axis. The method is well-suited for propagation of guided waves.\n The electromagnetic fields are expanded locally in the basis of eigenmodes of the\n waveguide; they are then propagated by imposing continuity conditions in this basis.\n\n The EME simulation is performed along the propagation axis ``axis`` at frequencies ``freqs``.\n The simulation is divided into cells along the propagation axis, as defined by\n ``eme_grid_spec``. Mode solving is performed at cell centers, and boundary conditions are\n imposed between cells. The EME ports are defined to be the boundaries of the first and last\n cell in the EME grid. These can be moved using ``port_offsets``.\n\n An EME simulation always computes the full scattering matrix of the structure.\n Additional data can be recorded by adding 'monitors' to the simulation.\n\n **Other Bases**\n\n By default, the scattering matrix is expressed in the basis of EME modes at the two ports. It is sometimes useful to use alternative bases. For example, in a waveguide splitter, we might want the scattering matrix in the basis of modes of the individual waveguides. The functions `smatrix_in_basis` and `field_in_basis` in :class:`.EMESimulationData` can be used for this purpose after the simulation has been run.\n\n **Frequency Sweeps**\n\n Frequency sweeps are supported by including multiple frequencies in the `freqs` field. However, our EME solver repeats the mode solving for each new frequency, so frequency sweeps involving a large number of frequencies can be slow and expensive. If a large number of frequencies are required, consider using our FDTD solver instead.\n\n **Passivity and Unitarity Constraints**\n\n Passivity and unitarity constraints can be imposed via the `constraint` field. These constraints are imposed at interfaces between cells, possibly at the expense of field continuity. Passivity means that the interface can only dissipate energy, and unitarity means the interface will conserve energy (energy may still be dissipated inside cells when the propagation constant is complex). Adding constraints can slow down the simulation significantly, especially for a large number of modes (more than 30 or 40).\n\n **Too Many Modes**\n\n It is important to use enough modes to capture the physics of the device and to ensure that the results have converged (see below). However, using too many modes can slow down the simulation and result in numerical issues. If too many modes are used, it is common to see a warning about invalid modes in the simulation log. While these modes are not included in the EME propagation, this can indicate some other issue with the setup, especially if the results have not converged. In this case, extending the simulation size in the transverse directions and increasing the grid resolution may help by creating more valid modes that can be used in convergence testing.\n\n **Mode Convergence Sweeps**\n\n It is a good idea to check that the number of modes is large enough by running a mode convergence sweep. This can be done using :class:`.EMEModeSweep`.\n\nExample\n-------\n>>> from tidy3d import Box, Medium, Structure, C_0, inf\n>>> from tidy3d import EMEModeSpec, EMEUniformGrid, GridSpec\n>>> from tidy3d import EMEFieldMonitor\n>>> lambda0 = 1550e-9\n>>> freq0 = C_0 / lambda0\n>>> sim_size = 3*lambda0, 3*lambda0, 3*lambda0\n>>> waveguide_size = (lambda0/2, lambda0, inf)\n>>> waveguide = Structure(\n... geometry=Box(center=(0,0,0), size=waveguide_size),\n... medium=Medium(permittivity=2)\n... )\n>>> eme_grid_spec = EMEUniformGrid(num_cells=5, mode_spec=EMEModeSpec(num_modes=10))\n>>> grid_spec = GridSpec(wavelength=lambda0)\n>>> field_monitor = EMEFieldMonitor(\n... size=(0, sim_size[1], sim_size[2]),\n... name=\"field_monitor\"\n... )\n>>> sim = EMESimulation(\n... size=sim_size,\n... monitors=[field_monitor],\n... structures=[waveguide],\n... axis=2,\n... freqs=[freq0],\n... eme_grid_spec=eme_grid_spec,\n... grid_spec=grid_spec\n... )\n\nSee Also\n--------\n\n**Notebooks:**\n * `EME Solver Demonstration <../../notebooks/docs/features/eme.rst>`_",
"type": "object",
"properties": {
"attrs": {
@@ -447,7 +447,9 @@
"um",
"mm",
"cm",
- "m"
+ "m",
+ "mil",
+ "in"
],
"type": "string"
},
diff --git a/schemas/HeatChargeSimulation.json b/schemas/HeatChargeSimulation.json
index 0867a9e920..911ffe0c37 100644
--- a/schemas/HeatChargeSimulation.json
+++ b/schemas/HeatChargeSimulation.json
@@ -1,6 +1,6 @@
{
"title": "HeatChargeSimulation",
- "description": "Defines thermoelectric simulations.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[MultiPhysicsMedium, Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium, Medium2D, AnisotropicMediumFromMedium2D, FluidSpec, SolidSpec, SolidMedium, FluidMedium, ChargeConductorMedium, ChargeInsulatorMedium, SemiconductorMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to a standard dispersion-less :class:`Medium` if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, 1], Literal[0, 1], Literal[0, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (symmetry off) or ``1`` (symmetry on).\nsources : Tuple[Annotated[Union[tidy3d.components.tcad.source.heat.HeatSource, tidy3d.components.tcad.source.coupled.HeatFromElectricSource, tidy3d.components.tcad.source.heat.UniformHeatSource], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of heat and/or charge sources.\nboundary_spec : Tuple[Annotated[Union[tidy3d.components.tcad.boundary.specification.HeatChargeBoundarySpec, tidy3d.components.tcad.boundary.specification.HeatBoundarySpec], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of boundary condition specifications.\nmonitors : Tuple[Annotated[Union[tidy3d.components.tcad.monitors.heat.TemperatureMonitor, tidy3d.components.tcad.monitors.charge.SteadyPotentialMonitor, tidy3d.components.tcad.monitors.charge.SteadyFreeCarrierMonitor, tidy3d.components.tcad.monitors.charge.SteadyEnergyBandMonitor, tidy3d.components.tcad.monitors.charge.SteadyElectricFieldMonitor, tidy3d.components.tcad.monitors.charge.SteadyCapacitanceMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Monitors in the simulation.\ngrid_spec : Union[UniformUnstructuredGrid, DistanceUnstructuredGrid]\n Grid specification for heat-charge simulation.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nanalysis_spec : Union[IsothermalSteadyChargeDCAnalysis, UnsteadyHeatAnalysis] = None\n The `analysis_spec` is used to specify the type of simulation. Currently, it is used to specify Charge simulations or transient Heat simulations.\n\nNotes\n-----\n A ``HeatChargeSimulation`` supports different types of simulations. It solves the\n heat and conduction equations using the Finite-Volume (FV) method. This solver\n determines the required computation physics according to the simulation scene definition.\n This is implemented in this way due to the strong multi-physics coupling.\n\nThe ``HeatChargeSimulation`` can solve multiple physics and the intention is to enable close thermo-electrical coupling.\n\nCurrently, this solver supports steady-state heat conduction where :math:`q` is the heat flux, :math:`k`\nis the thermal conductivity, and :math:`T` is the temperature.\n\n .. math::\n\n -\\nabla \\cdot (-k \\nabla T) = q\n\nIt is also possible to run transient heat simulations by specifying ``analysis_spec=UnsteadyHeatAnalysis(...)``. This adds\nthe temporal terms to the above equations:\n\n .. math::\n\n \\frac{\\partial \\rho c_p T}{\\partial t} -\\nabla \\cdot (k \\nabla(T)) = q\n\nwhere :math:`\\rho` is the density and :math:`c_p` is the specific heat capacity of the medium.\n\n\nThe steady-state electrical ``Conduction`` equation depends on the electric conductivity (:math:`\\sigma`) of a\nmedium, and the electric field (:math:`\\mathbf{E} = -\\nabla(\\psi)`) derived from electrical potential (:math:`\\psi`).\nCurrently, in this type of simulation, no current sources or sinks are supported.\n\n .. math::\n\n \\text{div}(\\sigma \\cdot \\nabla(\\psi)) = 0\n\n\nFor further details on what equations are solved in ``Charge`` simulations, refer to the :class:`SemiconductorMedium`.\n\nLet's understand how the physics solving is determined:\n\n .. list-table::\n :widths: 25 75\n :header-rows: 1\n\n * - Simulation Type\n - Example Configuration Settings\n * - ``Heat``\n - The heat equation is solved with specified heat sources,\n boundary conditions, etc. Structures should incorporate materials\n with defined heat properties.\n * - ``Conduction``\n - The electrical conduction equation is solved with\n specified boundary conditions such as ``SteadyVoltageBC``, ``SteadyCurrentBC``, ...\n * - ``Charge``\n - Drift-diffusion equations are solved for structures containing\n a defined :class:`SemiconductorMedium`. Insulators with a\n :class:`ChargeInsulatorMedium` can also be included. For these, only the\n electric potential field is calculated.\n\nExamples\n--------\nTo run a thermal (``Heat`` |:fire:|) simulation with a solid conductive structure:\n\n>>> import tidy3d as td\n>>> heat_sim = td.HeatChargeSimulation(\n... size=(3.0, 3.0, 3.0),\n... structures=[\n... td.Structure(\n... geometry=td.Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=td.Medium(\n... permittivity=2.0,\n... heat_spec=td.SolidSpec(\n... conductivity=1,\n... capacity=1,\n... )\n... ),\n... name=\"box\",\n... ),\n... ],\n... medium=td.Medium(permittivity=3.0, heat_spec=td.FluidSpec()),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.1),\n... sources=[td.HeatSource(rate=1, structures=[\"box\"])],\n... boundary_spec=[\n... td.HeatChargeBoundarySpec(\n... placement=td.StructureBoundary(structure=\"box\"),\n... condition=td.TemperatureBC(temperature=500),\n... )\n... ],\n... monitors=[td.TemperatureMonitor(size=(1, 2, 3), name=\"sample\")],\n... )\n\nTo run a drift-diffusion (``Charge`` |:zap:|) system:\n\n>>> import tidy3d as td\n>>> air = td.FluidMedium(\n... name=\"air\"\n... )\n>>> intrinsic_Si = td.material_library['cSi'].variants['Si_MultiPhysics'].medium.charge\n>>> Si_n = intrinsic_Si.updated_copy(N_d=1e16, name=\"Si_n\")\n>>> Si_p = intrinsic_Si.updated_copy(N_a=1e16, name=\"Si_p\")\n>>> n_side = td.Structure(\n... geometry=td.Box(center=(-0.5, 0, 0), size=(1, 1, 1)),\n... medium=Si_n,\n... name=\"n_side\"\n... )\n>>> p_side = td.Structure(\n... geometry=td.Box(center=(0.5, 0, 0), size=(1, 1, 1)),\n... medium=Si_p,\n... name=\"p_side\"\n... )\n>>> bc_v1 = td.HeatChargeBoundarySpec(\n... condition=td.VoltageBC(source=td.DCVoltageSource(voltage=[-1, 0, 0.5])),\n... placement=td.MediumMediumInterface(mediums=[air.name, Si_n.name]),\n... )\n>>> bc_v2 = td.HeatChargeBoundarySpec(\n... condition=td.VoltageBC(source=td.DCVoltageSource(voltage=0)),\n... placement=td.MediumMediumInterface(mediums=[air.name, Si_p.name]),\n... )\n>>> charge_sim = td.HeatChargeSimulation(\n... structures=[n_side, p_side],\n... medium=td.Medium(heat_spec=td.FluidSpec(), name=\"air\"),\n... monitors=[td.SteadyFreeCarrierMonitor(\n... center=(0, 0, 0), size=(td.inf, td.inf, 0), name=\"charge_mnt\", unstructured=True\n... )],\n... center=(0, 0, 0),\n... size=(3, 3, 3),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.05),\n... boundary_spec=[bc_v1, bc_v2],\n... analysis_spec=td.IsothermalSteadyChargeDCAnalysis(\n... tolerance_settings=td.ChargeToleranceSpec(rel_tol=1e5, abs_tol=3e3, max_iters=400),\n... convergence_dv=10),\n... )\n\n\nCoupling between ``Heat`` and electrical ``Conduction`` simulations is currently limited to 1-way.\nThis is specified by defining a heat source of type :class:`HeatFromElectricSource`. With this coupling, joule heating is\ncalculated as part of the solution to a ``Conduction`` simulation and translated into the ``Heat`` simulation.\n\nTwo common scenarios can use this coupling definition:\n 1. One in which BCs and sources are specified for both ``Heat`` and ``Conduction`` simulations.\n In this case one mesh will be generated and used for both the ``Conduction`` and ``Heat``\n simulations.\n 2. Only heat BCs/sources are provided. In this case, only the ``Heat`` equation will be solved.\n Before the simulation starts, it will try to load the heat source from file so a\n previously run ``Conduction`` simulations must have run previously. Since the Conduction\n and ``Heat`` meshes may differ, an interpolation between them will be performed prior to\n starting the ``Heat`` simulation.\n\nAdditional heat sources can be defined, in which case, they will be added on\ntop of the coupling heat source.",
+ "description": "Defines thermoelectric simulations.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[MultiPhysicsMedium, Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium, Medium2D, AnisotropicMediumFromMedium2D, FluidSpec, SolidSpec, SolidMedium, FluidMedium, ChargeConductorMedium, ChargeInsulatorMedium, SemiconductorMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to a standard dispersion-less :class:`Medium` if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, 1], Literal[0, 1], Literal[0, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (symmetry off) or ``1`` (symmetry on).\nsources : Tuple[Annotated[Union[tidy3d.components.tcad.source.heat.HeatSource, tidy3d.components.tcad.source.coupled.HeatFromElectricSource, tidy3d.components.tcad.source.heat.UniformHeatSource], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of heat and/or charge sources.\nboundary_spec : Tuple[Annotated[Union[tidy3d.components.tcad.boundary.specification.HeatChargeBoundarySpec, tidy3d.components.tcad.boundary.specification.HeatBoundarySpec], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of boundary condition specifications.\nmonitors : Tuple[Annotated[Union[tidy3d.components.tcad.monitors.heat.TemperatureMonitor, tidy3d.components.tcad.monitors.charge.SteadyPotentialMonitor, tidy3d.components.tcad.monitors.charge.SteadyFreeCarrierMonitor, tidy3d.components.tcad.monitors.charge.SteadyEnergyBandMonitor, tidy3d.components.tcad.monitors.charge.SteadyElectricFieldMonitor, tidy3d.components.tcad.monitors.charge.SteadyCapacitanceMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Monitors in the simulation.\ngrid_spec : Union[UniformUnstructuredGrid, DistanceUnstructuredGrid]\n Grid specification for heat-charge simulation.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm', 'mil', 'in']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nanalysis_spec : Union[IsothermalSteadyChargeDCAnalysis, UnsteadyHeatAnalysis] = None\n The `analysis_spec` is used to specify the type of simulation. Currently, it is used to specify Charge simulations or transient Heat simulations.\n\nNotes\n-----\n A ``HeatChargeSimulation`` supports different types of simulations. It solves the\n heat and conduction equations using the Finite-Volume (FV) method. This solver\n determines the required computation physics according to the simulation scene definition.\n This is implemented in this way due to the strong multi-physics coupling.\n\nThe ``HeatChargeSimulation`` can solve multiple physics and the intention is to enable close thermo-electrical coupling.\n\nCurrently, this solver supports steady-state heat conduction where :math:`q` is the heat flux, :math:`k`\nis the thermal conductivity, and :math:`T` is the temperature.\n\n .. math::\n\n -\\nabla \\cdot (-k \\nabla T) = q\n\nIt is also possible to run transient heat simulations by specifying ``analysis_spec=UnsteadyHeatAnalysis(...)``. This adds\nthe temporal terms to the above equations:\n\n .. math::\n\n \\frac{\\partial \\rho c_p T}{\\partial t} -\\nabla \\cdot (k \\nabla(T)) = q\n\nwhere :math:`\\rho` is the density and :math:`c_p` is the specific heat capacity of the medium.\n\n\nThe steady-state electrical ``Conduction`` equation depends on the electric conductivity (:math:`\\sigma`) of a\nmedium, and the electric field (:math:`\\mathbf{E} = -\\nabla(\\psi)`) derived from electrical potential (:math:`\\psi`).\nCurrently, in this type of simulation, no current sources or sinks are supported.\n\n .. math::\n\n \\text{div}(\\sigma \\cdot \\nabla(\\psi)) = 0\n\n\nFor further details on what equations are solved in ``Charge`` simulations, refer to the :class:`SemiconductorMedium`.\n\nLet's understand how the physics solving is determined:\n\n .. list-table::\n :widths: 25 75\n :header-rows: 1\n\n * - Simulation Type\n - Example Configuration Settings\n * - ``Heat``\n - The heat equation is solved with specified heat sources,\n boundary conditions, etc. Structures should incorporate materials\n with defined heat properties.\n * - ``Conduction``\n - The electrical conduction equation is solved with\n specified boundary conditions such as ``SteadyVoltageBC``, ``SteadyCurrentBC``, ...\n * - ``Charge``\n - Drift-diffusion equations are solved for structures containing\n a defined :class:`SemiconductorMedium`. Insulators with a\n :class:`ChargeInsulatorMedium` can also be included. For these, only the\n electric potential field is calculated.\n\nExamples\n--------\nTo run a thermal (``Heat`` |:fire:|) simulation with a solid conductive structure:\n\n>>> import tidy3d as td\n>>> heat_sim = td.HeatChargeSimulation(\n... size=(3.0, 3.0, 3.0),\n... structures=[\n... td.Structure(\n... geometry=td.Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=td.Medium(\n... permittivity=2.0,\n... heat_spec=td.SolidSpec(\n... conductivity=1,\n... capacity=1,\n... )\n... ),\n... name=\"box\",\n... ),\n... ],\n... medium=td.Medium(permittivity=3.0, heat_spec=td.FluidSpec()),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.1),\n... sources=[td.HeatSource(rate=1, structures=[\"box\"])],\n... boundary_spec=[\n... td.HeatChargeBoundarySpec(\n... placement=td.StructureBoundary(structure=\"box\"),\n... condition=td.TemperatureBC(temperature=500),\n... )\n... ],\n... monitors=[td.TemperatureMonitor(size=(1, 2, 3), name=\"sample\")],\n... )\n\nTo run a drift-diffusion (``Charge`` |:zap:|) system:\n\n>>> import tidy3d as td\n>>> air = td.FluidMedium(\n... name=\"air\"\n... )\n>>> intrinsic_Si = td.material_library['cSi'].variants['Si_MultiPhysics'].medium.charge\n>>> Si_n = intrinsic_Si.updated_copy(N_d=1e16, name=\"Si_n\")\n>>> Si_p = intrinsic_Si.updated_copy(N_a=1e16, name=\"Si_p\")\n>>> n_side = td.Structure(\n... geometry=td.Box(center=(-0.5, 0, 0), size=(1, 1, 1)),\n... medium=Si_n,\n... name=\"n_side\"\n... )\n>>> p_side = td.Structure(\n... geometry=td.Box(center=(0.5, 0, 0), size=(1, 1, 1)),\n... medium=Si_p,\n... name=\"p_side\"\n... )\n>>> bc_v1 = td.HeatChargeBoundarySpec(\n... condition=td.VoltageBC(source=td.DCVoltageSource(voltage=[-1, 0, 0.5])),\n... placement=td.MediumMediumInterface(mediums=[air.name, Si_n.name]),\n... )\n>>> bc_v2 = td.HeatChargeBoundarySpec(\n... condition=td.VoltageBC(source=td.DCVoltageSource(voltage=0)),\n... placement=td.MediumMediumInterface(mediums=[air.name, Si_p.name]),\n... )\n>>> charge_sim = td.HeatChargeSimulation(\n... structures=[n_side, p_side],\n... medium=td.Medium(heat_spec=td.FluidSpec(), name=\"air\"),\n... monitors=[td.SteadyFreeCarrierMonitor(\n... center=(0, 0, 0), size=(td.inf, td.inf, 0), name=\"charge_mnt\", unstructured=True\n... )],\n... center=(0, 0, 0),\n... size=(3, 3, 3),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.05),\n... boundary_spec=[bc_v1, bc_v2],\n... analysis_spec=td.IsothermalSteadyChargeDCAnalysis(\n... tolerance_settings=td.ChargeToleranceSpec(rel_tol=1e5, abs_tol=3e3, max_iters=400),\n... convergence_dv=10),\n... )\n\n\nCoupling between ``Heat`` and electrical ``Conduction`` simulations is currently limited to 1-way.\nThis is specified by defining a heat source of type :class:`HeatFromElectricSource`. With this coupling, joule heating is\ncalculated as part of the solution to a ``Conduction`` simulation and translated into the ``Heat`` simulation.\n\nTwo common scenarios can use this coupling definition:\n 1. One in which BCs and sources are specified for both ``Heat`` and ``Conduction`` simulations.\n In this case one mesh will be generated and used for both the ``Conduction`` and ``Heat``\n simulations.\n 2. Only heat BCs/sources are provided. In this case, only the ``Heat`` equation will be solved.\n Before the simulation starts, it will try to load the heat source from file so a\n previously run ``Conduction`` simulations must have run previously. Since the Conduction\n and ``Heat`` meshes may differ, an interpolation between them will be performed prior to\n starting the ``Heat`` simulation.\n\nAdditional heat sources can be defined, in which case, they will be added on\ntop of the coupling heat source.",
"type": "object",
"properties": {
"attrs": {
@@ -439,7 +439,9 @@
"um",
"mm",
"cm",
- "m"
+ "m",
+ "mil",
+ "in"
],
"type": "string"
},
diff --git a/schemas/HeatSimulation.json b/schemas/HeatSimulation.json
index e617a4e207..29695dc4d6 100644
--- a/schemas/HeatSimulation.json
+++ b/schemas/HeatSimulation.json
@@ -1,6 +1,6 @@
{
"title": "HeatSimulation",
- "description": "Contains all information about heat simulation.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[MultiPhysicsMedium, Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium, Medium2D, AnisotropicMediumFromMedium2D, FluidSpec, SolidSpec, SolidMedium, FluidMedium, ChargeConductorMedium, ChargeInsulatorMedium, SemiconductorMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to a standard dispersion-less :class:`Medium` if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, 1], Literal[0, 1], Literal[0, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (symmetry off) or ``1`` (symmetry on).\nsources : Tuple[Annotated[Union[tidy3d.components.tcad.source.heat.HeatSource, tidy3d.components.tcad.source.coupled.HeatFromElectricSource, tidy3d.components.tcad.source.heat.UniformHeatSource], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of heat and/or charge sources.\nboundary_spec : Tuple[Annotated[Union[tidy3d.components.tcad.boundary.specification.HeatChargeBoundarySpec, tidy3d.components.tcad.boundary.specification.HeatBoundarySpec], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of boundary condition specifications.\nmonitors : Tuple[Annotated[Union[tidy3d.components.tcad.monitors.heat.TemperatureMonitor, tidy3d.components.tcad.monitors.charge.SteadyPotentialMonitor, tidy3d.components.tcad.monitors.charge.SteadyFreeCarrierMonitor, tidy3d.components.tcad.monitors.charge.SteadyEnergyBandMonitor, tidy3d.components.tcad.monitors.charge.SteadyElectricFieldMonitor, tidy3d.components.tcad.monitors.charge.SteadyCapacitanceMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Monitors in the simulation.\ngrid_spec : Union[UniformUnstructuredGrid, DistanceUnstructuredGrid]\n Grid specification for heat-charge simulation.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nanalysis_spec : Union[IsothermalSteadyChargeDCAnalysis, UnsteadyHeatAnalysis] = None\n The `analysis_spec` is used to specify the type of simulation. Currently, it is used to specify Charge simulations or transient Heat simulations.\n\nExample\n-------\n>>> import tidy3d as td\n>>> heat_sim = td.HeatSimulation( # doctest: +SKIP\n... size=(3.0, 3.0, 3.0),\n... structures=[\n... td.Structure(\n... geometry=td.Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=td.Medium(\n... permittivity=2.0, heat_spec=td.SolidSpec(\n... conductivity=1,\n... capacity=1,\n... )\n... ),\n... name=\"box\",\n... ),\n... ],\n... medium=td.Medium(permittivity=3.0, heat_spec=td.FluidSpec()),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.1),\n... sources=[td.HeatSource(rate=1, structures=[\"box\"])],\n... boundary_spec=[\n... td.HeatChargeBoundarySpec(\n... placement=td.StructureBoundary(structure=\"box\"),\n... condition=td.TemperatureBC(temperature=500),\n... )\n... ],\n... monitors=[td.TemperatureMonitor(size=(1, 2, 3), name=\"sample\")],\n... )",
+ "description": "Contains all information about heat simulation.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[MultiPhysicsMedium, Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium, Medium2D, AnisotropicMediumFromMedium2D, FluidSpec, SolidSpec, SolidMedium, FluidMedium, ChargeConductorMedium, ChargeInsulatorMedium, SemiconductorMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to a standard dispersion-less :class:`Medium` if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, 1], Literal[0, 1], Literal[0, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (symmetry off) or ``1`` (symmetry on).\nsources : Tuple[Annotated[Union[tidy3d.components.tcad.source.heat.HeatSource, tidy3d.components.tcad.source.coupled.HeatFromElectricSource, tidy3d.components.tcad.source.heat.UniformHeatSource], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of heat and/or charge sources.\nboundary_spec : Tuple[Annotated[Union[tidy3d.components.tcad.boundary.specification.HeatChargeBoundarySpec, tidy3d.components.tcad.boundary.specification.HeatBoundarySpec], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of boundary condition specifications.\nmonitors : Tuple[Annotated[Union[tidy3d.components.tcad.monitors.heat.TemperatureMonitor, tidy3d.components.tcad.monitors.charge.SteadyPotentialMonitor, tidy3d.components.tcad.monitors.charge.SteadyFreeCarrierMonitor, tidy3d.components.tcad.monitors.charge.SteadyEnergyBandMonitor, tidy3d.components.tcad.monitors.charge.SteadyElectricFieldMonitor, tidy3d.components.tcad.monitors.charge.SteadyCapacitanceMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Monitors in the simulation.\ngrid_spec : Union[UniformUnstructuredGrid, DistanceUnstructuredGrid]\n Grid specification for heat-charge simulation.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm', 'mil', 'in']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nanalysis_spec : Union[IsothermalSteadyChargeDCAnalysis, UnsteadyHeatAnalysis] = None\n The `analysis_spec` is used to specify the type of simulation. Currently, it is used to specify Charge simulations or transient Heat simulations.\n\nExample\n-------\n>>> import tidy3d as td\n>>> heat_sim = td.HeatSimulation( # doctest: +SKIP\n... size=(3.0, 3.0, 3.0),\n... structures=[\n... td.Structure(\n... geometry=td.Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=td.Medium(\n... permittivity=2.0, heat_spec=td.SolidSpec(\n... conductivity=1,\n... capacity=1,\n... )\n... ),\n... name=\"box\",\n... ),\n... ],\n... medium=td.Medium(permittivity=3.0, heat_spec=td.FluidSpec()),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.1),\n... sources=[td.HeatSource(rate=1, structures=[\"box\"])],\n... boundary_spec=[\n... td.HeatChargeBoundarySpec(\n... placement=td.StructureBoundary(structure=\"box\"),\n... condition=td.TemperatureBC(temperature=500),\n... )\n... ],\n... monitors=[td.TemperatureMonitor(size=(1, 2, 3), name=\"sample\")],\n... )",
"type": "object",
"properties": {
"attrs": {
@@ -439,7 +439,9 @@
"um",
"mm",
"cm",
- "m"
+ "m",
+ "mil",
+ "in"
],
"type": "string"
},
diff --git a/schemas/ModeSimulation.json b/schemas/ModeSimulation.json
index 75478facde..0902689c80 100644
--- a/schemas/ModeSimulation.json
+++ b/schemas/ModeSimulation.json
@@ -1,6 +1,6 @@
{
"title": "ModeSimulation",
- "description": "Simulation class for solving electromagnetic eigenmodes in a 2D plane with\ntranslational invariance in the third dimension. If the field ``plane`` is\nspecified, the domain for mode solving is the intersection between the ``plane``\nand the simulation geometry. If the simulation geometry is 2D (has zero size\nin one dimension) and the ``plane`` is ``None``, then the domain for mode solving\nis the entire 2D geometry.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. \nsources : Tuple[] = ()\n Sources in the simulation. Note: sources are not supported in mode simulations.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), y=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), z=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. If ``None``, PML boundary conditions are applied on all sides. This behavior is for consistency with FDTD simulations; however, please note that the mode solver terminates the mode plane with PEC boundary. The 'ModeSpec' can be used to apply PML layers in the mode solver.\nmonitors : Tuple[PermittivityMonitor, ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_y=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_z=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), wavelength=None, override_structures=(), snapping_points=(), layer_refinement_specs=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nlumped_elements : Tuple[Annotated[Union[tidy3d.components.lumped_element.LumpedResistor, tidy3d.components.lumped_element.CoaxialLumpedResistor, tidy3d.components.lumped_element.LinearLumpedElement], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of lumped elements in the simulation. Note: only :class:`tidy3d.LumpedResistor` is supported currently.\nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3,, edge_singularity_correction=False), pmc=Staircasing(attrs={},, type='Staircasing'), lossy_metal=SurfaceImpedance(attrs={},, type='SurfaceImpedance',, timestep_reduction=0.0,, edge_singularity_correction=False), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\nmode_spec : ModeSpec\n Container with specifications about the modes to be solved for.\nfreqs : Union[tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n A list of frequencies at which to solve.\ndirection : Literal['+', '-'] = +\n Direction of waveguide mode propagation along the axis defined by its normal dimension.\ncolocate : bool = True\n Toggle whether fields should be colocated to grid cell boundaries (i.e. primal grid nodes). Default is ``True``.\nfields : Tuple[Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz'], ...] = ['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz']\n Collection of field components to store in the monitor. Note that some methods like ``flux``, ``dot`` require all tangential field components, while others like ``mode_area`` require all E-field components.\nplane : Union[Box, ModeSource, ModeMonitor, ModeSolverMonitor] = None\n Cross-sectional plane in which the mode will be computed. If provided, the computational domain will be the intersection between the provided ``plane`` and the simulation geometry. If ``None``, the simulation must be 2D, and the plane will be the entire simulation geometry.\n\nThe ``symmetry`` field can be used to enforce reflection symmetry across planes\nthrough the ``center`` of the simulation. Each component of the ``symmetry`` field\nis only used if the ``center`` of the ``plane`` and the simulation geometry\ncoincide in that component. Symmetry normal to the mode solving domain has no\neffect; the field ``filter_pol`` in :class:`.ModeSpec` can be used here instead.\n\nExample\n-------\n>>> from tidy3d import C_0, ModeSpec, BoundarySpec, Boundary\n>>> lambda0 = 1550e-9\n>>> freq0 = C_0 / lambda0\n>>> freqs = [freq0]\n>>> sim_size = lambda0, lambda0, 0\n>>> mode_spec = ModeSpec(num_modes=4)\n>>> boundary_spec = BoundarySpec(\n... x=Boundary.pec(),\n... y=Boundary.pec(),\n... z=Boundary.periodic()\n... )\n>>> sim = ModeSimulation(\n... size=sim_size,\n... freqs=freqs,\n... mode_spec=mode_spec,\n... boundary_spec=boundary_spec\n... )\n\nSee Also\n--------\n\n:class:`ModeSource`:\n Injects current source to excite modal profile on finite extent plane.\n\n**Notebooks:**\n * `Waveguide Y junction <../../notebooks/YJunction.html>`_\n * `Photonic crystal waveguide polarization filter <../../../notebooks/PhotonicCrystalWaveguidePolarizationFilter.html>`_\n\n**Lectures:**\n * `Prelude to Integrated Photonics Simulation: Mode Injection `_",
+ "description": "Simulation class for solving electromagnetic eigenmodes in a 2D plane with\ntranslational invariance in the third dimension. If the field ``plane`` is\nspecified, the domain for mode solving is the intersection between the ``plane``\nand the simulation geometry. If the simulation geometry is 2D (has zero size\nin one dimension) and the ``plane`` is ``None``, then the domain for mode solving\nis the entire 2D geometry.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. \nsources : Tuple[] = ()\n Sources in the simulation. Note: sources are not supported in mode simulations.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), y=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), z=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. If ``None``, PML boundary conditions are applied on all sides. This behavior is for consistency with FDTD simulations; however, please note that the mode solver terminates the mode plane with PEC boundary. The 'ModeSpec' can be used to apply PML layers in the mode solver.\nmonitors : Tuple[PermittivityMonitor, ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_y=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_z=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), wavelength=None, override_structures=(), snapping_points=(), layer_refinement_specs=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm', 'mil', 'in']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nlumped_elements : Tuple[Annotated[Union[tidy3d.components.lumped_element.LumpedResistor, tidy3d.components.lumped_element.CoaxialLumpedResistor, tidy3d.components.lumped_element.LinearLumpedElement], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of lumped elements in the simulation. Note: only :class:`tidy3d.LumpedResistor` is supported currently.\nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3,, edge_singularity_correction=False), pmc=Staircasing(attrs={},, type='Staircasing'), lossy_metal=SurfaceImpedance(attrs={},, type='SurfaceImpedance',, timestep_reduction=0.0,, edge_singularity_correction=False), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\nmode_spec : ModeSpec\n Container with specifications about the modes to be solved for.\nfreqs : Union[tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n A list of frequencies at which to solve.\ndirection : Literal['+', '-'] = +\n Direction of waveguide mode propagation along the axis defined by its normal dimension.\ncolocate : bool = True\n Toggle whether fields should be colocated to grid cell boundaries (i.e. primal grid nodes). Default is ``True``.\nfields : Tuple[Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz'], ...] = ['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz']\n Collection of field components to store in the monitor. Note that some methods like ``flux``, ``dot`` require all tangential field components, while others like ``mode_area`` require all E-field components.\nplane : Union[Box, ModeSource, ModeMonitor, ModeSolverMonitor] = None\n Cross-sectional plane in which the mode will be computed. If provided, the computational domain will be the intersection between the provided ``plane`` and the simulation geometry. If ``None``, the simulation must be 2D, and the plane will be the entire simulation geometry.\n\nThe ``symmetry`` field can be used to enforce reflection symmetry across planes\nthrough the ``center`` of the simulation. Each component of the ``symmetry`` field\nis only used if the ``center`` of the ``plane`` and the simulation geometry\ncoincide in that component. Symmetry normal to the mode solving domain has no\neffect; the field ``filter_pol`` in :class:`.ModeSpec` can be used here instead.\n\nExample\n-------\n>>> from tidy3d import C_0, ModeSpec, BoundarySpec, Boundary\n>>> lambda0 = 1550e-9\n>>> freq0 = C_0 / lambda0\n>>> freqs = [freq0]\n>>> sim_size = lambda0, lambda0, 0\n>>> mode_spec = ModeSpec(num_modes=4)\n>>> boundary_spec = BoundarySpec(\n... x=Boundary.pec(),\n... y=Boundary.pec(),\n... z=Boundary.periodic()\n... )\n>>> sim = ModeSimulation(\n... size=sim_size,\n... freqs=freqs,\n... mode_spec=mode_spec,\n... boundary_spec=boundary_spec\n... )\n\nSee Also\n--------\n\n:class:`ModeSource`:\n Injects current source to excite modal profile on finite extent plane.\n\n**Notebooks:**\n * `Waveguide Y junction <../../notebooks/YJunction.html>`_\n * `Photonic crystal waveguide polarization filter <../../../notebooks/PhotonicCrystalWaveguidePolarizationFilter.html>`_\n\n**Lectures:**\n * `Prelude to Integrated Photonics Simulation: Mode Injection `_",
"type": "object",
"properties": {
"attrs": {
@@ -503,7 +503,9 @@
"um",
"mm",
"cm",
- "m"
+ "m",
+ "mil",
+ "in"
],
"type": "string"
},
diff --git a/schemas/Simulation.json b/schemas/Simulation.json
index bbb6a1a3d0..5885b94a83 100644
--- a/schemas/Simulation.json
+++ b/schemas/Simulation.json
@@ -1,6 +1,6 @@
{
"title": "Simulation",
- "description": "Custom implementation of Maxwell\u2019s equations which represents the physical model to be solved using the FDTD\nmethod.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (no symmetry), ``1`` (even, i.e. 'PMC' symmetry) or ``-1`` (odd, i.e. 'PEC' symmetry). Note that the vectorial nature of the fields must be taken into account to correctly determine the symmetry value.\nsources : Tuple[Annotated[Union[tidy3d.components.source.current.UniformCurrentSource, tidy3d.components.source.current.PointDipole, tidy3d.components.source.field.GaussianBeam, tidy3d.components.source.field.AstigmaticGaussianBeam, tidy3d.components.source.field.ModeSource, tidy3d.components.source.field.PlaneWave, tidy3d.components.source.field.CustomFieldSource, tidy3d.components.source.current.CustomCurrentSource, tidy3d.components.source.field.TFSF], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of electric current sources injecting fields into the simulation.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), y=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), z=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. If ``None``, PML boundary conditions are applied on all sides.\nmonitors : Tuple[Annotated[Union[tidy3d.components.monitor.FieldMonitor, tidy3d.components.monitor.FieldTimeMonitor, tidy3d.components.monitor.AuxFieldTimeMonitor, tidy3d.components.monitor.PermittivityMonitor, tidy3d.components.monitor.FluxMonitor, tidy3d.components.monitor.FluxTimeMonitor, tidy3d.components.monitor.ModeMonitor, tidy3d.components.monitor.ModeSolverMonitor, tidy3d.components.monitor.FieldProjectionAngleMonitor, tidy3d.components.monitor.FieldProjectionCartesianMonitor, tidy3d.components.monitor.FieldProjectionKSpaceMonitor, tidy3d.components.monitor.DiffractionMonitor, tidy3d.components.monitor.DirectivityMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_y=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_z=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), wavelength=None, override_structures=(), snapping_points=(), layer_refinement_specs=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nlumped_elements : Tuple[Annotated[Union[tidy3d.components.lumped_element.LumpedResistor, tidy3d.components.lumped_element.CoaxialLumpedResistor, tidy3d.components.lumped_element.LinearLumpedElement], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of lumped elements in the simulation. \nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3,, edge_singularity_correction=False), pmc=Staircasing(attrs={},, type='Staircasing'), lossy_metal=SurfaceImpedance(attrs={},, type='SurfaceImpedance',, timestep_reduction=0.0,, edge_singularity_correction=False), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\ncourant : ConstrainedFloatValue = 0.99\n Normalized Courant stability factor that is no larger than 1 when CFL stability condition is met. It controls time step to spatial step ratio. Lower values lead to more stable simulations for dispersive materials, but result in longer simulation times.\nprecision : Literal['hybrid', 'double'] = hybrid\n Floating point precision to use in the computations.\nnormalize_index : Optional[NonNegativeInt] = 0\n Index of the source in the tuple of sources whose spectrum will be used to normalize the frequency-dependent data. If ``None``, the raw field data is returned unnormalized.\nshutoff : NonNegativeFloat = 1e-05\n Ratio of the instantaneous integrated E-field intensity to the maximum value at which the simulation will automatically terminate time stepping. Used to prevent extraneous run time of simulations with fully decayed fields. Set to ``0`` to disable this feature.\nrun_time : Union[PositiveFloat, RunTimeSpec]\n [units = sec]. Total electromagnetic evolution time in seconds. Note: If simulation 'shutoff' is specified, simulation will terminate early when shutoff condition met. Alternatively, user may supply a :class:`RunTimeSpec` to this field, which will auto-compute the ``run_time`` based on the contents of the spec. If this option is used, the evaluated ``run_time`` value is available in the ``Simulation._run_time`` property.\n\nNotes\n-----\n\n A ``Simulation`` defines a custom implementation of Maxwell's equations which represents the physical model\n to be solved using `the Finite-Difference Time-Domain (FDTD) method\n `_. ``tidy3d`` simulations\n run very quickly in the cloud through GPU parallelization.\n\n .. image:: ../../_static/img/field_update_fdtd.png\n :width: 50%\n :align: left\n\n FDTD is a method for simulating the interaction of electromagnetic waves with structures and materials. It is\n the most widely used method in photonics design. The Maxwell's\n equations implemented in the ``Simulation`` are solved per time-step in the order shown in this image.\n\n The simplified input to FDTD solver consists of the permittivity distribution defined by :attr:`structures`\n which describe the device and :attr:`sources` of electromagnetic excitation. This information is used to\n computate the time dynamics of the electric and magnetic fields in this system. From these time-domain\n results, frequency-domain information of the simulation can also be extracted, and used for device design and\n optimization.\n\n If you are new to the FDTD method, we recommend you get started with the `FDTD 101 Lecture Series\n `_\n\n **Dimensions Selection**\n\n By default, simulations are defined as 3D. To make the simulation 2D, we can just set the simulation\n :attr:`size` in one of the dimensions to be 0. However, note that we still have to define a grid size (eg.\n ``tidy3d.Simulation(size=[size_x, size_y, 0])``) and specify a periodic boundary condition in that direction.\n\n .. TODO sort out inheritance problem https://aware-moon.cloudvent.net/tidy3d/examples/notebooks/RingResonator/\n\n See further parameter explanations below.\n\nExample\n-------\n>>> from tidy3d import Sphere, Cylinder, PolySlab\n>>> from tidy3d import UniformCurrentSource, GaussianPulse\n>>> from tidy3d import FieldMonitor, FluxMonitor\n>>> from tidy3d import GridSpec, AutoGrid\n>>> from tidy3d import BoundarySpec, Boundary\n>>> from tidy3d import Medium\n>>> sim = Simulation(\n... size=(3.0, 3.0, 3.0),\n... grid_spec=GridSpec(\n... grid_x = AutoGrid(min_steps_per_wvl = 20),\n... grid_y = AutoGrid(min_steps_per_wvl = 20),\n... grid_z = AutoGrid(min_steps_per_wvl = 20)\n... ),\n... run_time=40e-11,\n... structures=[\n... Structure(\n... geometry=Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=Medium(permittivity=2.0),\n... ),\n... ],\n... sources=[\n... UniformCurrentSource(\n... size=(0, 0, 0),\n... center=(0, 0.5, 0),\n... polarization=\"Hx\",\n... source_time=GaussianPulse(\n... freq0=2e14,\n... fwidth=4e13,\n... ),\n... )\n... ],\n... monitors=[\n... FluxMonitor(size=(1, 1, 0), center=(0, 0, 0), freqs=[2e14, 2.5e14], name='flux'),\n... ],\n... symmetry=(0, 0, 0),\n... boundary_spec=BoundarySpec(\n... x = Boundary.pml(num_layers=20),\n... y = Boundary.pml(num_layers=30),\n... z = Boundary.periodic(),\n... ),\n... shutoff=1e-6,\n... courant=0.8,\n... subpixel=False,\n... )\n\nSee Also\n--------\n\n**Notebooks:**\n * `Quickstart <../../notebooks/StartHere.html>`_: Usage in a basic simulation flow.\n * `Using automatic nonuniform meshing <../../notebooks/AutoGrid.html>`_\n * See nearly all notebooks for :class:`Simulation` applications.\n\n**Lectures:**\n * `Introduction to FDTD Simulation `_: Usage in a basic simulation flow.\n * `Prelude to Integrated Photonics Simulation: Mode Injection `_\n\n**GUI:**\n * `FDTD Walkthrough `_",
+ "description": "Custom implementation of Maxwell\u2019s equations which represents the physical model to be solved using the FDTD\nmethod.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (no symmetry), ``1`` (even, i.e. 'PMC' symmetry) or ``-1`` (odd, i.e. 'PEC' symmetry). Note that the vectorial nature of the fields must be taken into account to correctly determine the symmetry value.\nsources : Tuple[Annotated[Union[tidy3d.components.source.current.UniformCurrentSource, tidy3d.components.source.current.PointDipole, tidy3d.components.source.field.GaussianBeam, tidy3d.components.source.field.AstigmaticGaussianBeam, tidy3d.components.source.field.ModeSource, tidy3d.components.source.field.PlaneWave, tidy3d.components.source.field.CustomFieldSource, tidy3d.components.source.current.CustomCurrentSource, tidy3d.components.source.field.TFSF], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of electric current sources injecting fields into the simulation.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), y=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), z=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. If ``None``, PML boundary conditions are applied on all sides.\nmonitors : Tuple[Annotated[Union[tidy3d.components.monitor.FieldMonitor, tidy3d.components.monitor.FieldTimeMonitor, tidy3d.components.monitor.AuxFieldTimeMonitor, tidy3d.components.monitor.PermittivityMonitor, tidy3d.components.monitor.FluxMonitor, tidy3d.components.monitor.FluxTimeMonitor, tidy3d.components.monitor.ModeMonitor, tidy3d.components.monitor.ModeSolverMonitor, tidy3d.components.monitor.FieldProjectionAngleMonitor, tidy3d.components.monitor.FieldProjectionCartesianMonitor, tidy3d.components.monitor.FieldProjectionKSpaceMonitor, tidy3d.components.monitor.DiffractionMonitor, tidy3d.components.monitor.DirectivityMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_y=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_z=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), wavelength=None, override_structures=(), snapping_points=(), layer_refinement_specs=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm', 'mil', 'in']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nlumped_elements : Tuple[Annotated[Union[tidy3d.components.lumped_element.LumpedResistor, tidy3d.components.lumped_element.CoaxialLumpedResistor, tidy3d.components.lumped_element.LinearLumpedElement], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of lumped elements in the simulation. \nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3,, edge_singularity_correction=False), pmc=Staircasing(attrs={},, type='Staircasing'), lossy_metal=SurfaceImpedance(attrs={},, type='SurfaceImpedance',, timestep_reduction=0.0,, edge_singularity_correction=False), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\ncourant : ConstrainedFloatValue = 0.99\n Normalized Courant stability factor that is no larger than 1 when CFL stability condition is met. It controls time step to spatial step ratio. Lower values lead to more stable simulations for dispersive materials, but result in longer simulation times.\nprecision : Literal['hybrid', 'double'] = hybrid\n Floating point precision to use in the computations.\nnormalize_index : Optional[NonNegativeInt] = 0\n Index of the source in the tuple of sources whose spectrum will be used to normalize the frequency-dependent data. If ``None``, the raw field data is returned unnormalized.\nshutoff : NonNegativeFloat = 1e-05\n Ratio of the instantaneous integrated E-field intensity to the maximum value at which the simulation will automatically terminate time stepping. Used to prevent extraneous run time of simulations with fully decayed fields. Set to ``0`` to disable this feature.\nrun_time : Union[PositiveFloat, RunTimeSpec]\n [units = sec]. Total electromagnetic evolution time in seconds. Note: If simulation 'shutoff' is specified, simulation will terminate early when shutoff condition met. Alternatively, user may supply a :class:`RunTimeSpec` to this field, which will auto-compute the ``run_time`` based on the contents of the spec. If this option is used, the evaluated ``run_time`` value is available in the ``Simulation._run_time`` property.\n\nNotes\n-----\n\n A ``Simulation`` defines a custom implementation of Maxwell's equations which represents the physical model\n to be solved using `the Finite-Difference Time-Domain (FDTD) method\n `_. ``tidy3d`` simulations\n run very quickly in the cloud through GPU parallelization.\n\n .. image:: ../../_static/img/field_update_fdtd.png\n :width: 50%\n :align: left\n\n FDTD is a method for simulating the interaction of electromagnetic waves with structures and materials. It is\n the most widely used method in photonics design. The Maxwell's\n equations implemented in the ``Simulation`` are solved per time-step in the order shown in this image.\n\n The simplified input to FDTD solver consists of the permittivity distribution defined by :attr:`structures`\n which describe the device and :attr:`sources` of electromagnetic excitation. This information is used to\n computate the time dynamics of the electric and magnetic fields in this system. From these time-domain\n results, frequency-domain information of the simulation can also be extracted, and used for device design and\n optimization.\n\n If you are new to the FDTD method, we recommend you get started with the `FDTD 101 Lecture Series\n `_\n\n **Dimensions Selection**\n\n By default, simulations are defined as 3D. To make the simulation 2D, we can just set the simulation\n :attr:`size` in one of the dimensions to be 0. However, note that we still have to define a grid size (eg.\n ``tidy3d.Simulation(size=[size_x, size_y, 0])``) and specify a periodic boundary condition in that direction.\n\n .. TODO sort out inheritance problem https://aware-moon.cloudvent.net/tidy3d/examples/notebooks/RingResonator/\n\n See further parameter explanations below.\n\nExample\n-------\n>>> from tidy3d import Sphere, Cylinder, PolySlab\n>>> from tidy3d import UniformCurrentSource, GaussianPulse\n>>> from tidy3d import FieldMonitor, FluxMonitor\n>>> from tidy3d import GridSpec, AutoGrid\n>>> from tidy3d import BoundarySpec, Boundary\n>>> from tidy3d import Medium\n>>> sim = Simulation(\n... size=(3.0, 3.0, 3.0),\n... grid_spec=GridSpec(\n... grid_x = AutoGrid(min_steps_per_wvl = 20),\n... grid_y = AutoGrid(min_steps_per_wvl = 20),\n... grid_z = AutoGrid(min_steps_per_wvl = 20)\n... ),\n... run_time=40e-11,\n... structures=[\n... Structure(\n... geometry=Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=Medium(permittivity=2.0),\n... ),\n... ],\n... sources=[\n... UniformCurrentSource(\n... size=(0, 0, 0),\n... center=(0, 0.5, 0),\n... polarization=\"Hx\",\n... source_time=GaussianPulse(\n... freq0=2e14,\n... fwidth=4e13,\n... ),\n... )\n... ],\n... monitors=[\n... FluxMonitor(size=(1, 1, 0), center=(0, 0, 0), freqs=[2e14, 2.5e14], name='flux'),\n... ],\n... symmetry=(0, 0, 0),\n... boundary_spec=BoundarySpec(\n... x = Boundary.pml(num_layers=20),\n... y = Boundary.pml(num_layers=30),\n... z = Boundary.periodic(),\n... ),\n... shutoff=1e-6,\n... courant=0.8,\n... subpixel=False,\n... )\n\nSee Also\n--------\n\n**Notebooks:**\n * `Quickstart <../../notebooks/StartHere.html>`_: Usage in a basic simulation flow.\n * `Using automatic nonuniform meshing <../../notebooks/AutoGrid.html>`_\n * See nearly all notebooks for :class:`Simulation` applications.\n\n**Lectures:**\n * `Introduction to FDTD Simulation `_: Usage in a basic simulation flow.\n * `Prelude to Integrated Photonics Simulation: Mode Injection `_\n\n**GUI:**\n * `FDTD Walkthrough `_",
"type": "object",
"properties": {
"attrs": {
@@ -604,7 +604,9 @@
"um",
"mm",
"cm",
- "m"
+ "m",
+ "mil",
+ "in"
],
"type": "string"
},
diff --git a/schemas/TerminalComponentModeler.json b/schemas/TerminalComponentModeler.json
index 3fcfb79d26..85f22b2334 100644
--- a/schemas/TerminalComponentModeler.json
+++ b/schemas/TerminalComponentModeler.json
@@ -17420,7 +17420,7 @@
},
"Simulation": {
"title": "Simulation",
- "description": "Custom implementation of Maxwell\u2019s equations which represents the physical model to be solved using the FDTD\nmethod.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (no symmetry), ``1`` (even, i.e. 'PMC' symmetry) or ``-1`` (odd, i.e. 'PEC' symmetry). Note that the vectorial nature of the fields must be taken into account to correctly determine the symmetry value.\nsources : Tuple[Annotated[Union[tidy3d.components.source.current.UniformCurrentSource, tidy3d.components.source.current.PointDipole, tidy3d.components.source.field.GaussianBeam, tidy3d.components.source.field.AstigmaticGaussianBeam, tidy3d.components.source.field.ModeSource, tidy3d.components.source.field.PlaneWave, tidy3d.components.source.field.CustomFieldSource, tidy3d.components.source.current.CustomCurrentSource, tidy3d.components.source.field.TFSF], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of electric current sources injecting fields into the simulation.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), y=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), z=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. If ``None``, PML boundary conditions are applied on all sides.\nmonitors : Tuple[Annotated[Union[tidy3d.components.monitor.FieldMonitor, tidy3d.components.monitor.FieldTimeMonitor, tidy3d.components.monitor.AuxFieldTimeMonitor, tidy3d.components.monitor.PermittivityMonitor, tidy3d.components.monitor.FluxMonitor, tidy3d.components.monitor.FluxTimeMonitor, tidy3d.components.monitor.ModeMonitor, tidy3d.components.monitor.ModeSolverMonitor, tidy3d.components.monitor.FieldProjectionAngleMonitor, tidy3d.components.monitor.FieldProjectionCartesianMonitor, tidy3d.components.monitor.FieldProjectionKSpaceMonitor, tidy3d.components.monitor.DiffractionMonitor, tidy3d.components.monitor.DirectivityMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_y=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_z=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), wavelength=None, override_structures=(), snapping_points=(), layer_refinement_specs=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nlumped_elements : Tuple[Annotated[Union[tidy3d.components.lumped_element.LumpedResistor, tidy3d.components.lumped_element.CoaxialLumpedResistor, tidy3d.components.lumped_element.LinearLumpedElement], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of lumped elements in the simulation. \nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3,, edge_singularity_correction=False), pmc=Staircasing(attrs={},, type='Staircasing'), lossy_metal=SurfaceImpedance(attrs={},, type='SurfaceImpedance',, timestep_reduction=0.0,, edge_singularity_correction=False), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\ncourant : ConstrainedFloatValue = 0.99\n Normalized Courant stability factor that is no larger than 1 when CFL stability condition is met. It controls time step to spatial step ratio. Lower values lead to more stable simulations for dispersive materials, but result in longer simulation times.\nprecision : Literal['hybrid', 'double'] = hybrid\n Floating point precision to use in the computations.\nnormalize_index : Optional[NonNegativeInt] = 0\n Index of the source in the tuple of sources whose spectrum will be used to normalize the frequency-dependent data. If ``None``, the raw field data is returned unnormalized.\nshutoff : NonNegativeFloat = 1e-05\n Ratio of the instantaneous integrated E-field intensity to the maximum value at which the simulation will automatically terminate time stepping. Used to prevent extraneous run time of simulations with fully decayed fields. Set to ``0`` to disable this feature.\nrun_time : Union[PositiveFloat, RunTimeSpec]\n [units = sec]. Total electromagnetic evolution time in seconds. Note: If simulation 'shutoff' is specified, simulation will terminate early when shutoff condition met. Alternatively, user may supply a :class:`RunTimeSpec` to this field, which will auto-compute the ``run_time`` based on the contents of the spec. If this option is used, the evaluated ``run_time`` value is available in the ``Simulation._run_time`` property.\n\nNotes\n-----\n\n A ``Simulation`` defines a custom implementation of Maxwell's equations which represents the physical model\n to be solved using `the Finite-Difference Time-Domain (FDTD) method\n `_. ``tidy3d`` simulations\n run very quickly in the cloud through GPU parallelization.\n\n .. image:: ../../_static/img/field_update_fdtd.png\n :width: 50%\n :align: left\n\n FDTD is a method for simulating the interaction of electromagnetic waves with structures and materials. It is\n the most widely used method in photonics design. The Maxwell's\n equations implemented in the ``Simulation`` are solved per time-step in the order shown in this image.\n\n The simplified input to FDTD solver consists of the permittivity distribution defined by :attr:`structures`\n which describe the device and :attr:`sources` of electromagnetic excitation. This information is used to\n computate the time dynamics of the electric and magnetic fields in this system. From these time-domain\n results, frequency-domain information of the simulation can also be extracted, and used for device design and\n optimization.\n\n If you are new to the FDTD method, we recommend you get started with the `FDTD 101 Lecture Series\n `_\n\n **Dimensions Selection**\n\n By default, simulations are defined as 3D. To make the simulation 2D, we can just set the simulation\n :attr:`size` in one of the dimensions to be 0. However, note that we still have to define a grid size (eg.\n ``tidy3d.Simulation(size=[size_x, size_y, 0])``) and specify a periodic boundary condition in that direction.\n\n .. TODO sort out inheritance problem https://aware-moon.cloudvent.net/tidy3d/examples/notebooks/RingResonator/\n\n See further parameter explanations below.\n\nExample\n-------\n>>> from tidy3d import Sphere, Cylinder, PolySlab\n>>> from tidy3d import UniformCurrentSource, GaussianPulse\n>>> from tidy3d import FieldMonitor, FluxMonitor\n>>> from tidy3d import GridSpec, AutoGrid\n>>> from tidy3d import BoundarySpec, Boundary\n>>> from tidy3d import Medium\n>>> sim = Simulation(\n... size=(3.0, 3.0, 3.0),\n... grid_spec=GridSpec(\n... grid_x = AutoGrid(min_steps_per_wvl = 20),\n... grid_y = AutoGrid(min_steps_per_wvl = 20),\n... grid_z = AutoGrid(min_steps_per_wvl = 20)\n... ),\n... run_time=40e-11,\n... structures=[\n... Structure(\n... geometry=Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=Medium(permittivity=2.0),\n... ),\n... ],\n... sources=[\n... UniformCurrentSource(\n... size=(0, 0, 0),\n... center=(0, 0.5, 0),\n... polarization=\"Hx\",\n... source_time=GaussianPulse(\n... freq0=2e14,\n... fwidth=4e13,\n... ),\n... )\n... ],\n... monitors=[\n... FluxMonitor(size=(1, 1, 0), center=(0, 0, 0), freqs=[2e14, 2.5e14], name='flux'),\n... ],\n... symmetry=(0, 0, 0),\n... boundary_spec=BoundarySpec(\n... x = Boundary.pml(num_layers=20),\n... y = Boundary.pml(num_layers=30),\n... z = Boundary.periodic(),\n... ),\n... shutoff=1e-6,\n... courant=0.8,\n... subpixel=False,\n... )\n\nSee Also\n--------\n\n**Notebooks:**\n * `Quickstart <../../notebooks/StartHere.html>`_: Usage in a basic simulation flow.\n * `Using automatic nonuniform meshing <../../notebooks/AutoGrid.html>`_\n * See nearly all notebooks for :class:`Simulation` applications.\n\n**Lectures:**\n * `Introduction to FDTD Simulation `_: Usage in a basic simulation flow.\n * `Prelude to Integrated Photonics Simulation: Mode Injection `_\n\n**GUI:**\n * `FDTD Walkthrough `_",
+ "description": "Custom implementation of Maxwell\u2019s equations which represents the physical model to be solved using the FDTD\nmethod.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (no symmetry), ``1`` (even, i.e. 'PMC' symmetry) or ``-1`` (odd, i.e. 'PEC' symmetry). Note that the vectorial nature of the fields must be taken into account to correctly determine the symmetry value.\nsources : Tuple[Annotated[Union[tidy3d.components.source.current.UniformCurrentSource, tidy3d.components.source.current.PointDipole, tidy3d.components.source.field.GaussianBeam, tidy3d.components.source.field.AstigmaticGaussianBeam, tidy3d.components.source.field.ModeSource, tidy3d.components.source.field.PlaneWave, tidy3d.components.source.field.CustomFieldSource, tidy3d.components.source.current.CustomCurrentSource, tidy3d.components.source.field.TFSF], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of electric current sources injecting fields into the simulation.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), y=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), z=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. If ``None``, PML boundary conditions are applied on all sides.\nmonitors : Tuple[Annotated[Union[tidy3d.components.monitor.FieldMonitor, tidy3d.components.monitor.FieldTimeMonitor, tidy3d.components.monitor.AuxFieldTimeMonitor, tidy3d.components.monitor.PermittivityMonitor, tidy3d.components.monitor.FluxMonitor, tidy3d.components.monitor.FluxTimeMonitor, tidy3d.components.monitor.ModeMonitor, tidy3d.components.monitor.ModeSolverMonitor, tidy3d.components.monitor.FieldProjectionAngleMonitor, tidy3d.components.monitor.FieldProjectionCartesianMonitor, tidy3d.components.monitor.FieldProjectionKSpaceMonitor, tidy3d.components.monitor.DiffractionMonitor, tidy3d.components.monitor.DirectivityMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_y=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_z=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), wavelength=None, override_structures=(), snapping_points=(), layer_refinement_specs=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm', 'mil', 'in']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nlumped_elements : Tuple[Annotated[Union[tidy3d.components.lumped_element.LumpedResistor, tidy3d.components.lumped_element.CoaxialLumpedResistor, tidy3d.components.lumped_element.LinearLumpedElement], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of lumped elements in the simulation. \nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3,, edge_singularity_correction=False), pmc=Staircasing(attrs={},, type='Staircasing'), lossy_metal=SurfaceImpedance(attrs={},, type='SurfaceImpedance',, timestep_reduction=0.0,, edge_singularity_correction=False), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\ncourant : ConstrainedFloatValue = 0.99\n Normalized Courant stability factor that is no larger than 1 when CFL stability condition is met. It controls time step to spatial step ratio. Lower values lead to more stable simulations for dispersive materials, but result in longer simulation times.\nprecision : Literal['hybrid', 'double'] = hybrid\n Floating point precision to use in the computations.\nnormalize_index : Optional[NonNegativeInt] = 0\n Index of the source in the tuple of sources whose spectrum will be used to normalize the frequency-dependent data. If ``None``, the raw field data is returned unnormalized.\nshutoff : NonNegativeFloat = 1e-05\n Ratio of the instantaneous integrated E-field intensity to the maximum value at which the simulation will automatically terminate time stepping. Used to prevent extraneous run time of simulations with fully decayed fields. Set to ``0`` to disable this feature.\nrun_time : Union[PositiveFloat, RunTimeSpec]\n [units = sec]. Total electromagnetic evolution time in seconds. Note: If simulation 'shutoff' is specified, simulation will terminate early when shutoff condition met. Alternatively, user may supply a :class:`RunTimeSpec` to this field, which will auto-compute the ``run_time`` based on the contents of the spec. If this option is used, the evaluated ``run_time`` value is available in the ``Simulation._run_time`` property.\n\nNotes\n-----\n\n A ``Simulation`` defines a custom implementation of Maxwell's equations which represents the physical model\n to be solved using `the Finite-Difference Time-Domain (FDTD) method\n `_. ``tidy3d`` simulations\n run very quickly in the cloud through GPU parallelization.\n\n .. image:: ../../_static/img/field_update_fdtd.png\n :width: 50%\n :align: left\n\n FDTD is a method for simulating the interaction of electromagnetic waves with structures and materials. It is\n the most widely used method in photonics design. The Maxwell's\n equations implemented in the ``Simulation`` are solved per time-step in the order shown in this image.\n\n The simplified input to FDTD solver consists of the permittivity distribution defined by :attr:`structures`\n which describe the device and :attr:`sources` of electromagnetic excitation. This information is used to\n computate the time dynamics of the electric and magnetic fields in this system. From these time-domain\n results, frequency-domain information of the simulation can also be extracted, and used for device design and\n optimization.\n\n If you are new to the FDTD method, we recommend you get started with the `FDTD 101 Lecture Series\n `_\n\n **Dimensions Selection**\n\n By default, simulations are defined as 3D. To make the simulation 2D, we can just set the simulation\n :attr:`size` in one of the dimensions to be 0. However, note that we still have to define a grid size (eg.\n ``tidy3d.Simulation(size=[size_x, size_y, 0])``) and specify a periodic boundary condition in that direction.\n\n .. TODO sort out inheritance problem https://aware-moon.cloudvent.net/tidy3d/examples/notebooks/RingResonator/\n\n See further parameter explanations below.\n\nExample\n-------\n>>> from tidy3d import Sphere, Cylinder, PolySlab\n>>> from tidy3d import UniformCurrentSource, GaussianPulse\n>>> from tidy3d import FieldMonitor, FluxMonitor\n>>> from tidy3d import GridSpec, AutoGrid\n>>> from tidy3d import BoundarySpec, Boundary\n>>> from tidy3d import Medium\n>>> sim = Simulation(\n... size=(3.0, 3.0, 3.0),\n... grid_spec=GridSpec(\n... grid_x = AutoGrid(min_steps_per_wvl = 20),\n... grid_y = AutoGrid(min_steps_per_wvl = 20),\n... grid_z = AutoGrid(min_steps_per_wvl = 20)\n... ),\n... run_time=40e-11,\n... structures=[\n... Structure(\n... geometry=Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=Medium(permittivity=2.0),\n... ),\n... ],\n... sources=[\n... UniformCurrentSource(\n... size=(0, 0, 0),\n... center=(0, 0.5, 0),\n... polarization=\"Hx\",\n... source_time=GaussianPulse(\n... freq0=2e14,\n... fwidth=4e13,\n... ),\n... )\n... ],\n... monitors=[\n... FluxMonitor(size=(1, 1, 0), center=(0, 0, 0), freqs=[2e14, 2.5e14], name='flux'),\n... ],\n... symmetry=(0, 0, 0),\n... boundary_spec=BoundarySpec(\n... x = Boundary.pml(num_layers=20),\n... y = Boundary.pml(num_layers=30),\n... z = Boundary.periodic(),\n... ),\n... shutoff=1e-6,\n... courant=0.8,\n... subpixel=False,\n... )\n\nSee Also\n--------\n\n**Notebooks:**\n * `Quickstart <../../notebooks/StartHere.html>`_: Usage in a basic simulation flow.\n * `Using automatic nonuniform meshing <../../notebooks/AutoGrid.html>`_\n * See nearly all notebooks for :class:`Simulation` applications.\n\n**Lectures:**\n * `Introduction to FDTD Simulation `_: Usage in a basic simulation flow.\n * `Prelude to Integrated Photonics Simulation: Mode Injection `_\n\n**GUI:**\n * `FDTD Walkthrough `_",
"type": "object",
"properties": {
"attrs": {
@@ -18024,7 +18024,9 @@
"um",
"mm",
"cm",
- "m"
+ "m",
+ "mil",
+ "in"
],
"type": "string"
},
@@ -21541,7 +21543,7 @@
},
"HeatChargeSimulation": {
"title": "HeatChargeSimulation",
- "description": "Defines thermoelectric simulations.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[MultiPhysicsMedium, Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium, Medium2D, AnisotropicMediumFromMedium2D, FluidSpec, SolidSpec, SolidMedium, FluidMedium, ChargeConductorMedium, ChargeInsulatorMedium, SemiconductorMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to a standard dispersion-less :class:`Medium` if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, 1], Literal[0, 1], Literal[0, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (symmetry off) or ``1`` (symmetry on).\nsources : Tuple[Annotated[Union[tidy3d.components.tcad.source.heat.HeatSource, tidy3d.components.tcad.source.coupled.HeatFromElectricSource, tidy3d.components.tcad.source.heat.UniformHeatSource], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of heat and/or charge sources.\nboundary_spec : Tuple[Annotated[Union[tidy3d.components.tcad.boundary.specification.HeatChargeBoundarySpec, tidy3d.components.tcad.boundary.specification.HeatBoundarySpec], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of boundary condition specifications.\nmonitors : Tuple[Annotated[Union[tidy3d.components.tcad.monitors.heat.TemperatureMonitor, tidy3d.components.tcad.monitors.charge.SteadyPotentialMonitor, tidy3d.components.tcad.monitors.charge.SteadyFreeCarrierMonitor, tidy3d.components.tcad.monitors.charge.SteadyEnergyBandMonitor, tidy3d.components.tcad.monitors.charge.SteadyElectricFieldMonitor, tidy3d.components.tcad.monitors.charge.SteadyCapacitanceMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Monitors in the simulation.\ngrid_spec : Union[UniformUnstructuredGrid, DistanceUnstructuredGrid]\n Grid specification for heat-charge simulation.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nanalysis_spec : Union[IsothermalSteadyChargeDCAnalysis, UnsteadyHeatAnalysis] = None\n The `analysis_spec` is used to specify the type of simulation. Currently, it is used to specify Charge simulations or transient Heat simulations.\n\nNotes\n-----\n A ``HeatChargeSimulation`` supports different types of simulations. It solves the\n heat and conduction equations using the Finite-Volume (FV) method. This solver\n determines the required computation physics according to the simulation scene definition.\n This is implemented in this way due to the strong multi-physics coupling.\n\nThe ``HeatChargeSimulation`` can solve multiple physics and the intention is to enable close thermo-electrical coupling.\n\nCurrently, this solver supports steady-state heat conduction where :math:`q` is the heat flux, :math:`k`\nis the thermal conductivity, and :math:`T` is the temperature.\n\n .. math::\n\n -\\nabla \\cdot (-k \\nabla T) = q\n\nIt is also possible to run transient heat simulations by specifying ``analysis_spec=UnsteadyHeatAnalysis(...)``. This adds\nthe temporal terms to the above equations:\n\n .. math::\n\n \\frac{\\partial \\rho c_p T}{\\partial t} -\\nabla \\cdot (k \\nabla(T)) = q\n\nwhere :math:`\\rho` is the density and :math:`c_p` is the specific heat capacity of the medium.\n\n\nThe steady-state electrical ``Conduction`` equation depends on the electric conductivity (:math:`\\sigma`) of a\nmedium, and the electric field (:math:`\\mathbf{E} = -\\nabla(\\psi)`) derived from electrical potential (:math:`\\psi`).\nCurrently, in this type of simulation, no current sources or sinks are supported.\n\n .. math::\n\n \\text{div}(\\sigma \\cdot \\nabla(\\psi)) = 0\n\n\nFor further details on what equations are solved in ``Charge`` simulations, refer to the :class:`SemiconductorMedium`.\n\nLet's understand how the physics solving is determined:\n\n .. list-table::\n :widths: 25 75\n :header-rows: 1\n\n * - Simulation Type\n - Example Configuration Settings\n * - ``Heat``\n - The heat equation is solved with specified heat sources,\n boundary conditions, etc. Structures should incorporate materials\n with defined heat properties.\n * - ``Conduction``\n - The electrical conduction equation is solved with\n specified boundary conditions such as ``SteadyVoltageBC``, ``SteadyCurrentBC``, ...\n * - ``Charge``\n - Drift-diffusion equations are solved for structures containing\n a defined :class:`SemiconductorMedium`. Insulators with a\n :class:`ChargeInsulatorMedium` can also be included. For these, only the\n electric potential field is calculated.\n\nExamples\n--------\nTo run a thermal (``Heat`` |:fire:|) simulation with a solid conductive structure:\n\n>>> import tidy3d as td\n>>> heat_sim = td.HeatChargeSimulation(\n... size=(3.0, 3.0, 3.0),\n... structures=[\n... td.Structure(\n... geometry=td.Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=td.Medium(\n... permittivity=2.0,\n... heat_spec=td.SolidSpec(\n... conductivity=1,\n... capacity=1,\n... )\n... ),\n... name=\"box\",\n... ),\n... ],\n... medium=td.Medium(permittivity=3.0, heat_spec=td.FluidSpec()),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.1),\n... sources=[td.HeatSource(rate=1, structures=[\"box\"])],\n... boundary_spec=[\n... td.HeatChargeBoundarySpec(\n... placement=td.StructureBoundary(structure=\"box\"),\n... condition=td.TemperatureBC(temperature=500),\n... )\n... ],\n... monitors=[td.TemperatureMonitor(size=(1, 2, 3), name=\"sample\")],\n... )\n\nTo run a drift-diffusion (``Charge`` |:zap:|) system:\n\n>>> import tidy3d as td\n>>> air = td.FluidMedium(\n... name=\"air\"\n... )\n>>> intrinsic_Si = td.material_library['cSi'].variants['Si_MultiPhysics'].medium.charge\n>>> Si_n = intrinsic_Si.updated_copy(N_d=1e16, name=\"Si_n\")\n>>> Si_p = intrinsic_Si.updated_copy(N_a=1e16, name=\"Si_p\")\n>>> n_side = td.Structure(\n... geometry=td.Box(center=(-0.5, 0, 0), size=(1, 1, 1)),\n... medium=Si_n,\n... name=\"n_side\"\n... )\n>>> p_side = td.Structure(\n... geometry=td.Box(center=(0.5, 0, 0), size=(1, 1, 1)),\n... medium=Si_p,\n... name=\"p_side\"\n... )\n>>> bc_v1 = td.HeatChargeBoundarySpec(\n... condition=td.VoltageBC(source=td.DCVoltageSource(voltage=[-1, 0, 0.5])),\n... placement=td.MediumMediumInterface(mediums=[air.name, Si_n.name]),\n... )\n>>> bc_v2 = td.HeatChargeBoundarySpec(\n... condition=td.VoltageBC(source=td.DCVoltageSource(voltage=0)),\n... placement=td.MediumMediumInterface(mediums=[air.name, Si_p.name]),\n... )\n>>> charge_sim = td.HeatChargeSimulation(\n... structures=[n_side, p_side],\n... medium=td.Medium(heat_spec=td.FluidSpec(), name=\"air\"),\n... monitors=[td.SteadyFreeCarrierMonitor(\n... center=(0, 0, 0), size=(td.inf, td.inf, 0), name=\"charge_mnt\", unstructured=True\n... )],\n... center=(0, 0, 0),\n... size=(3, 3, 3),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.05),\n... boundary_spec=[bc_v1, bc_v2],\n... analysis_spec=td.IsothermalSteadyChargeDCAnalysis(\n... tolerance_settings=td.ChargeToleranceSpec(rel_tol=1e5, abs_tol=3e3, max_iters=400),\n... convergence_dv=10),\n... )\n\n\nCoupling between ``Heat`` and electrical ``Conduction`` simulations is currently limited to 1-way.\nThis is specified by defining a heat source of type :class:`HeatFromElectricSource`. With this coupling, joule heating is\ncalculated as part of the solution to a ``Conduction`` simulation and translated into the ``Heat`` simulation.\n\nTwo common scenarios can use this coupling definition:\n 1. One in which BCs and sources are specified for both ``Heat`` and ``Conduction`` simulations.\n In this case one mesh will be generated and used for both the ``Conduction`` and ``Heat``\n simulations.\n 2. Only heat BCs/sources are provided. In this case, only the ``Heat`` equation will be solved.\n Before the simulation starts, it will try to load the heat source from file so a\n previously run ``Conduction`` simulations must have run previously. Since the Conduction\n and ``Heat`` meshes may differ, an interpolation between them will be performed prior to\n starting the ``Heat`` simulation.\n\nAdditional heat sources can be defined, in which case, they will be added on\ntop of the coupling heat source.",
+ "description": "Defines thermoelectric simulations.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[MultiPhysicsMedium, Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium, Medium2D, AnisotropicMediumFromMedium2D, FluidSpec, SolidSpec, SolidMedium, FluidMedium, ChargeConductorMedium, ChargeInsulatorMedium, SemiconductorMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to a standard dispersion-less :class:`Medium` if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, 1], Literal[0, 1], Literal[0, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (symmetry off) or ``1`` (symmetry on).\nsources : Tuple[Annotated[Union[tidy3d.components.tcad.source.heat.HeatSource, tidy3d.components.tcad.source.coupled.HeatFromElectricSource, tidy3d.components.tcad.source.heat.UniformHeatSource], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of heat and/or charge sources.\nboundary_spec : Tuple[Annotated[Union[tidy3d.components.tcad.boundary.specification.HeatChargeBoundarySpec, tidy3d.components.tcad.boundary.specification.HeatBoundarySpec], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of boundary condition specifications.\nmonitors : Tuple[Annotated[Union[tidy3d.components.tcad.monitors.heat.TemperatureMonitor, tidy3d.components.tcad.monitors.charge.SteadyPotentialMonitor, tidy3d.components.tcad.monitors.charge.SteadyFreeCarrierMonitor, tidy3d.components.tcad.monitors.charge.SteadyEnergyBandMonitor, tidy3d.components.tcad.monitors.charge.SteadyElectricFieldMonitor, tidy3d.components.tcad.monitors.charge.SteadyCapacitanceMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Monitors in the simulation.\ngrid_spec : Union[UniformUnstructuredGrid, DistanceUnstructuredGrid]\n Grid specification for heat-charge simulation.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm', 'mil', 'in']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nanalysis_spec : Union[IsothermalSteadyChargeDCAnalysis, UnsteadyHeatAnalysis] = None\n The `analysis_spec` is used to specify the type of simulation. Currently, it is used to specify Charge simulations or transient Heat simulations.\n\nNotes\n-----\n A ``HeatChargeSimulation`` supports different types of simulations. It solves the\n heat and conduction equations using the Finite-Volume (FV) method. This solver\n determines the required computation physics according to the simulation scene definition.\n This is implemented in this way due to the strong multi-physics coupling.\n\nThe ``HeatChargeSimulation`` can solve multiple physics and the intention is to enable close thermo-electrical coupling.\n\nCurrently, this solver supports steady-state heat conduction where :math:`q` is the heat flux, :math:`k`\nis the thermal conductivity, and :math:`T` is the temperature.\n\n .. math::\n\n -\\nabla \\cdot (-k \\nabla T) = q\n\nIt is also possible to run transient heat simulations by specifying ``analysis_spec=UnsteadyHeatAnalysis(...)``. This adds\nthe temporal terms to the above equations:\n\n .. math::\n\n \\frac{\\partial \\rho c_p T}{\\partial t} -\\nabla \\cdot (k \\nabla(T)) = q\n\nwhere :math:`\\rho` is the density and :math:`c_p` is the specific heat capacity of the medium.\n\n\nThe steady-state electrical ``Conduction`` equation depends on the electric conductivity (:math:`\\sigma`) of a\nmedium, and the electric field (:math:`\\mathbf{E} = -\\nabla(\\psi)`) derived from electrical potential (:math:`\\psi`).\nCurrently, in this type of simulation, no current sources or sinks are supported.\n\n .. math::\n\n \\text{div}(\\sigma \\cdot \\nabla(\\psi)) = 0\n\n\nFor further details on what equations are solved in ``Charge`` simulations, refer to the :class:`SemiconductorMedium`.\n\nLet's understand how the physics solving is determined:\n\n .. list-table::\n :widths: 25 75\n :header-rows: 1\n\n * - Simulation Type\n - Example Configuration Settings\n * - ``Heat``\n - The heat equation is solved with specified heat sources,\n boundary conditions, etc. Structures should incorporate materials\n with defined heat properties.\n * - ``Conduction``\n - The electrical conduction equation is solved with\n specified boundary conditions such as ``SteadyVoltageBC``, ``SteadyCurrentBC``, ...\n * - ``Charge``\n - Drift-diffusion equations are solved for structures containing\n a defined :class:`SemiconductorMedium`. Insulators with a\n :class:`ChargeInsulatorMedium` can also be included. For these, only the\n electric potential field is calculated.\n\nExamples\n--------\nTo run a thermal (``Heat`` |:fire:|) simulation with a solid conductive structure:\n\n>>> import tidy3d as td\n>>> heat_sim = td.HeatChargeSimulation(\n... size=(3.0, 3.0, 3.0),\n... structures=[\n... td.Structure(\n... geometry=td.Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=td.Medium(\n... permittivity=2.0,\n... heat_spec=td.SolidSpec(\n... conductivity=1,\n... capacity=1,\n... )\n... ),\n... name=\"box\",\n... ),\n... ],\n... medium=td.Medium(permittivity=3.0, heat_spec=td.FluidSpec()),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.1),\n... sources=[td.HeatSource(rate=1, structures=[\"box\"])],\n... boundary_spec=[\n... td.HeatChargeBoundarySpec(\n... placement=td.StructureBoundary(structure=\"box\"),\n... condition=td.TemperatureBC(temperature=500),\n... )\n... ],\n... monitors=[td.TemperatureMonitor(size=(1, 2, 3), name=\"sample\")],\n... )\n\nTo run a drift-diffusion (``Charge`` |:zap:|) system:\n\n>>> import tidy3d as td\n>>> air = td.FluidMedium(\n... name=\"air\"\n... )\n>>> intrinsic_Si = td.material_library['cSi'].variants['Si_MultiPhysics'].medium.charge\n>>> Si_n = intrinsic_Si.updated_copy(N_d=1e16, name=\"Si_n\")\n>>> Si_p = intrinsic_Si.updated_copy(N_a=1e16, name=\"Si_p\")\n>>> n_side = td.Structure(\n... geometry=td.Box(center=(-0.5, 0, 0), size=(1, 1, 1)),\n... medium=Si_n,\n... name=\"n_side\"\n... )\n>>> p_side = td.Structure(\n... geometry=td.Box(center=(0.5, 0, 0), size=(1, 1, 1)),\n... medium=Si_p,\n... name=\"p_side\"\n... )\n>>> bc_v1 = td.HeatChargeBoundarySpec(\n... condition=td.VoltageBC(source=td.DCVoltageSource(voltage=[-1, 0, 0.5])),\n... placement=td.MediumMediumInterface(mediums=[air.name, Si_n.name]),\n... )\n>>> bc_v2 = td.HeatChargeBoundarySpec(\n... condition=td.VoltageBC(source=td.DCVoltageSource(voltage=0)),\n... placement=td.MediumMediumInterface(mediums=[air.name, Si_p.name]),\n... )\n>>> charge_sim = td.HeatChargeSimulation(\n... structures=[n_side, p_side],\n... medium=td.Medium(heat_spec=td.FluidSpec(), name=\"air\"),\n... monitors=[td.SteadyFreeCarrierMonitor(\n... center=(0, 0, 0), size=(td.inf, td.inf, 0), name=\"charge_mnt\", unstructured=True\n... )],\n... center=(0, 0, 0),\n... size=(3, 3, 3),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.05),\n... boundary_spec=[bc_v1, bc_v2],\n... analysis_spec=td.IsothermalSteadyChargeDCAnalysis(\n... tolerance_settings=td.ChargeToleranceSpec(rel_tol=1e5, abs_tol=3e3, max_iters=400),\n... convergence_dv=10),\n... )\n\n\nCoupling between ``Heat`` and electrical ``Conduction`` simulations is currently limited to 1-way.\nThis is specified by defining a heat source of type :class:`HeatFromElectricSource`. With this coupling, joule heating is\ncalculated as part of the solution to a ``Conduction`` simulation and translated into the ``Heat`` simulation.\n\nTwo common scenarios can use this coupling definition:\n 1. One in which BCs and sources are specified for both ``Heat`` and ``Conduction`` simulations.\n In this case one mesh will be generated and used for both the ``Conduction`` and ``Heat``\n simulations.\n 2. Only heat BCs/sources are provided. In this case, only the ``Heat`` equation will be solved.\n Before the simulation starts, it will try to load the heat source from file so a\n previously run ``Conduction`` simulations must have run previously. Since the Conduction\n and ``Heat`` meshes may differ, an interpolation between them will be performed prior to\n starting the ``Heat`` simulation.\n\nAdditional heat sources can be defined, in which case, they will be added on\ntop of the coupling heat source.",
"type": "object",
"properties": {
"attrs": {
@@ -21980,7 +21982,9 @@
"um",
"mm",
"cm",
- "m"
+ "m",
+ "mil",
+ "in"
],
"type": "string"
},
@@ -22015,7 +22019,7 @@
},
"HeatSimulation": {
"title": "HeatSimulation",
- "description": "Contains all information about heat simulation.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[MultiPhysicsMedium, Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium, Medium2D, AnisotropicMediumFromMedium2D, FluidSpec, SolidSpec, SolidMedium, FluidMedium, ChargeConductorMedium, ChargeInsulatorMedium, SemiconductorMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to a standard dispersion-less :class:`Medium` if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, 1], Literal[0, 1], Literal[0, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (symmetry off) or ``1`` (symmetry on).\nsources : Tuple[Annotated[Union[tidy3d.components.tcad.source.heat.HeatSource, tidy3d.components.tcad.source.coupled.HeatFromElectricSource, tidy3d.components.tcad.source.heat.UniformHeatSource], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of heat and/or charge sources.\nboundary_spec : Tuple[Annotated[Union[tidy3d.components.tcad.boundary.specification.HeatChargeBoundarySpec, tidy3d.components.tcad.boundary.specification.HeatBoundarySpec], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of boundary condition specifications.\nmonitors : Tuple[Annotated[Union[tidy3d.components.tcad.monitors.heat.TemperatureMonitor, tidy3d.components.tcad.monitors.charge.SteadyPotentialMonitor, tidy3d.components.tcad.monitors.charge.SteadyFreeCarrierMonitor, tidy3d.components.tcad.monitors.charge.SteadyEnergyBandMonitor, tidy3d.components.tcad.monitors.charge.SteadyElectricFieldMonitor, tidy3d.components.tcad.monitors.charge.SteadyCapacitanceMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Monitors in the simulation.\ngrid_spec : Union[UniformUnstructuredGrid, DistanceUnstructuredGrid]\n Grid specification for heat-charge simulation.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nanalysis_spec : Union[IsothermalSteadyChargeDCAnalysis, UnsteadyHeatAnalysis] = None\n The `analysis_spec` is used to specify the type of simulation. Currently, it is used to specify Charge simulations or transient Heat simulations.\n\nExample\n-------\n>>> import tidy3d as td\n>>> heat_sim = td.HeatSimulation( # doctest: +SKIP\n... size=(3.0, 3.0, 3.0),\n... structures=[\n... td.Structure(\n... geometry=td.Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=td.Medium(\n... permittivity=2.0, heat_spec=td.SolidSpec(\n... conductivity=1,\n... capacity=1,\n... )\n... ),\n... name=\"box\",\n... ),\n... ],\n... medium=td.Medium(permittivity=3.0, heat_spec=td.FluidSpec()),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.1),\n... sources=[td.HeatSource(rate=1, structures=[\"box\"])],\n... boundary_spec=[\n... td.HeatChargeBoundarySpec(\n... placement=td.StructureBoundary(structure=\"box\"),\n... condition=td.TemperatureBC(temperature=500),\n... )\n... ],\n... monitors=[td.TemperatureMonitor(size=(1, 2, 3), name=\"sample\")],\n... )",
+ "description": "Contains all information about heat simulation.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[MultiPhysicsMedium, Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium, Medium2D, AnisotropicMediumFromMedium2D, FluidSpec, SolidSpec, SolidMedium, FluidMedium, ChargeConductorMedium, ChargeInsulatorMedium, SemiconductorMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to a standard dispersion-less :class:`Medium` if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, 1], Literal[0, 1], Literal[0, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (symmetry off) or ``1`` (symmetry on).\nsources : Tuple[Annotated[Union[tidy3d.components.tcad.source.heat.HeatSource, tidy3d.components.tcad.source.coupled.HeatFromElectricSource, tidy3d.components.tcad.source.heat.UniformHeatSource], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of heat and/or charge sources.\nboundary_spec : Tuple[Annotated[Union[tidy3d.components.tcad.boundary.specification.HeatChargeBoundarySpec, tidy3d.components.tcad.boundary.specification.HeatBoundarySpec], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of boundary condition specifications.\nmonitors : Tuple[Annotated[Union[tidy3d.components.tcad.monitors.heat.TemperatureMonitor, tidy3d.components.tcad.monitors.charge.SteadyPotentialMonitor, tidy3d.components.tcad.monitors.charge.SteadyFreeCarrierMonitor, tidy3d.components.tcad.monitors.charge.SteadyEnergyBandMonitor, tidy3d.components.tcad.monitors.charge.SteadyElectricFieldMonitor, tidy3d.components.tcad.monitors.charge.SteadyCapacitanceMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Monitors in the simulation.\ngrid_spec : Union[UniformUnstructuredGrid, DistanceUnstructuredGrid]\n Grid specification for heat-charge simulation.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm', 'mil', 'in']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nanalysis_spec : Union[IsothermalSteadyChargeDCAnalysis, UnsteadyHeatAnalysis] = None\n The `analysis_spec` is used to specify the type of simulation. Currently, it is used to specify Charge simulations or transient Heat simulations.\n\nExample\n-------\n>>> import tidy3d as td\n>>> heat_sim = td.HeatSimulation( # doctest: +SKIP\n... size=(3.0, 3.0, 3.0),\n... structures=[\n... td.Structure(\n... geometry=td.Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=td.Medium(\n... permittivity=2.0, heat_spec=td.SolidSpec(\n... conductivity=1,\n... capacity=1,\n... )\n... ),\n... name=\"box\",\n... ),\n... ],\n... medium=td.Medium(permittivity=3.0, heat_spec=td.FluidSpec()),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.1),\n... sources=[td.HeatSource(rate=1, structures=[\"box\"])],\n... boundary_spec=[\n... td.HeatChargeBoundarySpec(\n... placement=td.StructureBoundary(structure=\"box\"),\n... condition=td.TemperatureBC(temperature=500),\n... )\n... ],\n... monitors=[td.TemperatureMonitor(size=(1, 2, 3), name=\"sample\")],\n... )",
"type": "object",
"properties": {
"attrs": {
@@ -22454,7 +22458,9 @@
"um",
"mm",
"cm",
- "m"
+ "m",
+ "mil",
+ "in"
],
"type": "string"
},
@@ -23602,7 +23608,7 @@
},
"EMESimulation": {
"title": "EMESimulation",
- "description": "EigenMode Expansion (EME) simulation.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. \nsources : Tuple[NoneType, ...] = ()\n Sources in the simulation. NOTE: sources are not currently supported for EME simulations. Instead, the simulation performs full bidirectional propagation in the 'port_mode' basis. After running the simulation, use 'smatrix_in_basis' to use another set of modes or input field.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, minus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, type='Boundary'), y=Boundary(attrs={},, plus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, minus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, type='Boundary'), z=Boundary(attrs={},, plus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, minus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. By default, PEC boundary conditions are applied on all sides. This field is for consistency with FDTD simulations; however, please note that regardless of the 'boundary_spec', the mode solver terminates the mode plane with PEC boundary. The 'EMEModeSpec' can be used to apply PML layers in the mode solver.\nmonitors : Tuple[Annotated[Union[tidy3d.components.eme.monitor.EMEModeSolverMonitor, tidy3d.components.eme.monitor.EMEFieldMonitor, tidy3d.components.eme.monitor.EMECoefficientMonitor, tidy3d.components.monitor.ModeSolverMonitor, tidy3d.components.monitor.PermittivityMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_y=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_z=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), wavelength=None, override_structures=(), snapping_points=(), layer_refinement_specs=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions. This is distinct from 'eme_grid_spec', which defines the 1D EME grid in the propagation direction.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nlumped_elements : Tuple[Annotated[Union[tidy3d.components.lumped_element.LumpedResistor, tidy3d.components.lumped_element.CoaxialLumpedResistor, tidy3d.components.lumped_element.LinearLumpedElement], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of lumped elements in the simulation. Note: only :class:`tidy3d.LumpedResistor` is supported currently.\nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3,, edge_singularity_correction=False), pmc=Staircasing(attrs={},, type='Staircasing'), lossy_metal=SurfaceImpedance(attrs={},, type='SurfaceImpedance',, timestep_reduction=0.0,, edge_singularity_correction=False), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\nfreqs : Union[tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n Frequencies for the EME simulation. The field is propagated independently at each provided frequency. This can be slow when the number of frequencies is large. In this case, consider using the approximate 'EMEFreqSweep' as the 'sweep_spec' instead of providing all desired frequencies here.\naxis : Literal[0, 1, 2]\n Propagation axis (0, 1, or 2) for the EME simulation.\neme_grid_spec : Union[EMEUniformGrid, EMECompositeGrid, EMEExplicitGrid]\n Specification for the EME propagation grid. The simulation is divided into cells in the propagation direction; this parameter specifies the layout of those cells. Mode solving is performed in each cell, and then propagation between cells is performed to determine the complete solution. This is distinct from 'grid_spec', which defines the grid in the two tangential directions, as well as the grid used for field monitors.\nstore_port_modes : bool = True\n Whether to store the modes associated with the two ports. Required to find scattering matrix in basis besides the computational basis.\nnormalize : bool = True\n Whether to normalize the port modes to unity flux, thereby normalizing the scattering matrix and expansion coefficients.\nport_offsets : Tuple[NonNegativeFloat, NonNegativeFloat] = (0, 0)\n Offsets for the two ports, relative to the simulation bounds along the propagation axis.\nsweep_spec : Union[EMELengthSweep, EMEModeSweep, EMEFreqSweep, EMEPeriodicitySweep, NoneType] = None\n Specification for a parameter sweep to be performed during the EME propagation step. The results are stored in 'sim_data.smatrix'. Other simulation monitor data is not included in the sweep.\nconstraint : Optional[Literal['passive', 'unitary']] = passive\n Constraint for EME propagation, imposed at cell interfaces. A constraint of 'passive' means that energy can be dissipated but not created at interfaces. A constraint of 'unitary' means that energy is conserved at interfaces (but not necessarily within cells). The option 'none' may be faster for a large number of modes. The option 'passive' can serve as regularization for the field continuity requirement and give more physical results.\n\nNotes\n-----\n\n EME is a frequency-domain method for propagating the electromagnetic field along a\n specified axis. The method is well-suited for propagation of guided waves.\n The electromagnetic fields are expanded locally in the basis of eigenmodes of the\n waveguide; they are then propagated by imposing continuity conditions in this basis.\n\n The EME simulation is performed along the propagation axis ``axis`` at frequencies ``freqs``.\n The simulation is divided into cells along the propagation axis, as defined by\n ``eme_grid_spec``. Mode solving is performed at cell centers, and boundary conditions are\n imposed between cells. The EME ports are defined to be the boundaries of the first and last\n cell in the EME grid. These can be moved using ``port_offsets``.\n\n An EME simulation always computes the full scattering matrix of the structure.\n Additional data can be recorded by adding 'monitors' to the simulation.\n\n **Other Bases**\n\n By default, the scattering matrix is expressed in the basis of EME modes at the two ports. It is sometimes useful to use alternative bases. For example, in a waveguide splitter, we might want the scattering matrix in the basis of modes of the individual waveguides. The functions `smatrix_in_basis` and `field_in_basis` in :class:`.EMESimulationData` can be used for this purpose after the simulation has been run.\n\n **Frequency Sweeps**\n\n Frequency sweeps are supported by including multiple frequencies in the `freqs` field. However, our EME solver repeats the mode solving for each new frequency, so frequency sweeps involving a large number of frequencies can be slow and expensive. If a large number of frequencies are required, consider using our FDTD solver instead.\n\n **Passivity and Unitarity Constraints**\n\n Passivity and unitarity constraints can be imposed via the `constraint` field. These constraints are imposed at interfaces between cells, possibly at the expense of field continuity. Passivity means that the interface can only dissipate energy, and unitarity means the interface will conserve energy (energy may still be dissipated inside cells when the propagation constant is complex). Adding constraints can slow down the simulation significantly, especially for a large number of modes (more than 30 or 40).\n\n **Too Many Modes**\n\n It is important to use enough modes to capture the physics of the device and to ensure that the results have converged (see below). However, using too many modes can slow down the simulation and result in numerical issues. If too many modes are used, it is common to see a warning about invalid modes in the simulation log. While these modes are not included in the EME propagation, this can indicate some other issue with the setup, especially if the results have not converged. In this case, extending the simulation size in the transverse directions and increasing the grid resolution may help by creating more valid modes that can be used in convergence testing.\n\n **Mode Convergence Sweeps**\n\n It is a good idea to check that the number of modes is large enough by running a mode convergence sweep. This can be done using :class:`.EMEModeSweep`.\n\nExample\n-------\n>>> from tidy3d import Box, Medium, Structure, C_0, inf\n>>> from tidy3d import EMEModeSpec, EMEUniformGrid, GridSpec\n>>> from tidy3d import EMEFieldMonitor\n>>> lambda0 = 1550e-9\n>>> freq0 = C_0 / lambda0\n>>> sim_size = 3*lambda0, 3*lambda0, 3*lambda0\n>>> waveguide_size = (lambda0/2, lambda0, inf)\n>>> waveguide = Structure(\n... geometry=Box(center=(0,0,0), size=waveguide_size),\n... medium=Medium(permittivity=2)\n... )\n>>> eme_grid_spec = EMEUniformGrid(num_cells=5, mode_spec=EMEModeSpec(num_modes=10))\n>>> grid_spec = GridSpec(wavelength=lambda0)\n>>> field_monitor = EMEFieldMonitor(\n... size=(0, sim_size[1], sim_size[2]),\n... name=\"field_monitor\"\n... )\n>>> sim = EMESimulation(\n... size=sim_size,\n... monitors=[field_monitor],\n... structures=[waveguide],\n... axis=2,\n... freqs=[freq0],\n... eme_grid_spec=eme_grid_spec,\n... grid_spec=grid_spec\n... )\n\nSee Also\n--------\n\n**Notebooks:**\n * `EME Solver Demonstration <../../notebooks/docs/features/eme.rst>`_",
+ "description": "EigenMode Expansion (EME) simulation.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. \nsources : Tuple[NoneType, ...] = ()\n Sources in the simulation. NOTE: sources are not currently supported for EME simulations. Instead, the simulation performs full bidirectional propagation in the 'port_mode' basis. After running the simulation, use 'smatrix_in_basis' to use another set of modes or input field.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, minus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, type='Boundary'), y=Boundary(attrs={},, plus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, minus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, type='Boundary'), z=Boundary(attrs={},, plus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, minus=PECBoundary(attrs={},, name=None,, type='PECBoundary'),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. By default, PEC boundary conditions are applied on all sides. This field is for consistency with FDTD simulations; however, please note that regardless of the 'boundary_spec', the mode solver terminates the mode plane with PEC boundary. The 'EMEModeSpec' can be used to apply PML layers in the mode solver.\nmonitors : Tuple[Annotated[Union[tidy3d.components.eme.monitor.EMEModeSolverMonitor, tidy3d.components.eme.monitor.EMEFieldMonitor, tidy3d.components.eme.monitor.EMECoefficientMonitor, tidy3d.components.monitor.ModeSolverMonitor, tidy3d.components.monitor.PermittivityMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_y=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_z=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), wavelength=None, override_structures=(), snapping_points=(), layer_refinement_specs=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions. This is distinct from 'eme_grid_spec', which defines the 1D EME grid in the propagation direction.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm', 'mil', 'in']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nlumped_elements : Tuple[Annotated[Union[tidy3d.components.lumped_element.LumpedResistor, tidy3d.components.lumped_element.CoaxialLumpedResistor, tidy3d.components.lumped_element.LinearLumpedElement], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of lumped elements in the simulation. Note: only :class:`tidy3d.LumpedResistor` is supported currently.\nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3,, edge_singularity_correction=False), pmc=Staircasing(attrs={},, type='Staircasing'), lossy_metal=SurfaceImpedance(attrs={},, type='SurfaceImpedance',, timestep_reduction=0.0,, edge_singularity_correction=False), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\nfreqs : Union[tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n Frequencies for the EME simulation. The field is propagated independently at each provided frequency. This can be slow when the number of frequencies is large. In this case, consider using the approximate 'EMEFreqSweep' as the 'sweep_spec' instead of providing all desired frequencies here.\naxis : Literal[0, 1, 2]\n Propagation axis (0, 1, or 2) for the EME simulation.\neme_grid_spec : Union[EMEUniformGrid, EMECompositeGrid, EMEExplicitGrid]\n Specification for the EME propagation grid. The simulation is divided into cells in the propagation direction; this parameter specifies the layout of those cells. Mode solving is performed in each cell, and then propagation between cells is performed to determine the complete solution. This is distinct from 'grid_spec', which defines the grid in the two tangential directions, as well as the grid used for field monitors.\nstore_port_modes : bool = True\n Whether to store the modes associated with the two ports. Required to find scattering matrix in basis besides the computational basis.\nnormalize : bool = True\n Whether to normalize the port modes to unity flux, thereby normalizing the scattering matrix and expansion coefficients.\nport_offsets : Tuple[NonNegativeFloat, NonNegativeFloat] = (0, 0)\n Offsets for the two ports, relative to the simulation bounds along the propagation axis.\nsweep_spec : Union[EMELengthSweep, EMEModeSweep, EMEFreqSweep, EMEPeriodicitySweep, NoneType] = None\n Specification for a parameter sweep to be performed during the EME propagation step. The results are stored in 'sim_data.smatrix'. Other simulation monitor data is not included in the sweep.\nconstraint : Optional[Literal['passive', 'unitary']] = passive\n Constraint for EME propagation, imposed at cell interfaces. A constraint of 'passive' means that energy can be dissipated but not created at interfaces. A constraint of 'unitary' means that energy is conserved at interfaces (but not necessarily within cells). The option 'none' may be faster for a large number of modes. The option 'passive' can serve as regularization for the field continuity requirement and give more physical results.\n\nNotes\n-----\n\n EME is a frequency-domain method for propagating the electromagnetic field along a\n specified axis. The method is well-suited for propagation of guided waves.\n The electromagnetic fields are expanded locally in the basis of eigenmodes of the\n waveguide; they are then propagated by imposing continuity conditions in this basis.\n\n The EME simulation is performed along the propagation axis ``axis`` at frequencies ``freqs``.\n The simulation is divided into cells along the propagation axis, as defined by\n ``eme_grid_spec``. Mode solving is performed at cell centers, and boundary conditions are\n imposed between cells. The EME ports are defined to be the boundaries of the first and last\n cell in the EME grid. These can be moved using ``port_offsets``.\n\n An EME simulation always computes the full scattering matrix of the structure.\n Additional data can be recorded by adding 'monitors' to the simulation.\n\n **Other Bases**\n\n By default, the scattering matrix is expressed in the basis of EME modes at the two ports. It is sometimes useful to use alternative bases. For example, in a waveguide splitter, we might want the scattering matrix in the basis of modes of the individual waveguides. The functions `smatrix_in_basis` and `field_in_basis` in :class:`.EMESimulationData` can be used for this purpose after the simulation has been run.\n\n **Frequency Sweeps**\n\n Frequency sweeps are supported by including multiple frequencies in the `freqs` field. However, our EME solver repeats the mode solving for each new frequency, so frequency sweeps involving a large number of frequencies can be slow and expensive. If a large number of frequencies are required, consider using our FDTD solver instead.\n\n **Passivity and Unitarity Constraints**\n\n Passivity and unitarity constraints can be imposed via the `constraint` field. These constraints are imposed at interfaces between cells, possibly at the expense of field continuity. Passivity means that the interface can only dissipate energy, and unitarity means the interface will conserve energy (energy may still be dissipated inside cells when the propagation constant is complex). Adding constraints can slow down the simulation significantly, especially for a large number of modes (more than 30 or 40).\n\n **Too Many Modes**\n\n It is important to use enough modes to capture the physics of the device and to ensure that the results have converged (see below). However, using too many modes can slow down the simulation and result in numerical issues. If too many modes are used, it is common to see a warning about invalid modes in the simulation log. While these modes are not included in the EME propagation, this can indicate some other issue with the setup, especially if the results have not converged. In this case, extending the simulation size in the transverse directions and increasing the grid resolution may help by creating more valid modes that can be used in convergence testing.\n\n **Mode Convergence Sweeps**\n\n It is a good idea to check that the number of modes is large enough by running a mode convergence sweep. This can be done using :class:`.EMEModeSweep`.\n\nExample\n-------\n>>> from tidy3d import Box, Medium, Structure, C_0, inf\n>>> from tidy3d import EMEModeSpec, EMEUniformGrid, GridSpec\n>>> from tidy3d import EMEFieldMonitor\n>>> lambda0 = 1550e-9\n>>> freq0 = C_0 / lambda0\n>>> sim_size = 3*lambda0, 3*lambda0, 3*lambda0\n>>> waveguide_size = (lambda0/2, lambda0, inf)\n>>> waveguide = Structure(\n... geometry=Box(center=(0,0,0), size=waveguide_size),\n... medium=Medium(permittivity=2)\n... )\n>>> eme_grid_spec = EMEUniformGrid(num_cells=5, mode_spec=EMEModeSpec(num_modes=10))\n>>> grid_spec = GridSpec(wavelength=lambda0)\n>>> field_monitor = EMEFieldMonitor(\n... size=(0, sim_size[1], sim_size[2]),\n... name=\"field_monitor\"\n... )\n>>> sim = EMESimulation(\n... size=sim_size,\n... monitors=[field_monitor],\n... structures=[waveguide],\n... axis=2,\n... freqs=[freq0],\n... eme_grid_spec=eme_grid_spec,\n... grid_spec=grid_spec\n... )\n\nSee Also\n--------\n\n**Notebooks:**\n * `EME Solver Demonstration <../../notebooks/docs/features/eme.rst>`_",
"type": "object",
"properties": {
"attrs": {
@@ -24049,7 +24055,9 @@
"um",
"mm",
"cm",
- "m"
+ "m",
+ "mil",
+ "in"
],
"type": "string"
},
@@ -24414,7 +24422,7 @@
},
"ModeSimulation": {
"title": "ModeSimulation",
- "description": "Simulation class for solving electromagnetic eigenmodes in a 2D plane with\ntranslational invariance in the third dimension. If the field ``plane`` is\nspecified, the domain for mode solving is the intersection between the ``plane``\nand the simulation geometry. If the simulation geometry is 2D (has zero size\nin one dimension) and the ``plane`` is ``None``, then the domain for mode solving\nis the entire 2D geometry.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. \nsources : Tuple[] = ()\n Sources in the simulation. Note: sources are not supported in mode simulations.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), y=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), z=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. If ``None``, PML boundary conditions are applied on all sides. This behavior is for consistency with FDTD simulations; however, please note that the mode solver terminates the mode plane with PEC boundary. The 'ModeSpec' can be used to apply PML layers in the mode solver.\nmonitors : Tuple[PermittivityMonitor, ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_y=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_z=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), wavelength=None, override_structures=(), snapping_points=(), layer_refinement_specs=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nlumped_elements : Tuple[Annotated[Union[tidy3d.components.lumped_element.LumpedResistor, tidy3d.components.lumped_element.CoaxialLumpedResistor, tidy3d.components.lumped_element.LinearLumpedElement], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of lumped elements in the simulation. Note: only :class:`tidy3d.LumpedResistor` is supported currently.\nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3,, edge_singularity_correction=False), pmc=Staircasing(attrs={},, type='Staircasing'), lossy_metal=SurfaceImpedance(attrs={},, type='SurfaceImpedance',, timestep_reduction=0.0,, edge_singularity_correction=False), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\nmode_spec : ModeSpec\n Container with specifications about the modes to be solved for.\nfreqs : Union[tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n A list of frequencies at which to solve.\ndirection : Literal['+', '-'] = +\n Direction of waveguide mode propagation along the axis defined by its normal dimension.\ncolocate : bool = True\n Toggle whether fields should be colocated to grid cell boundaries (i.e. primal grid nodes). Default is ``True``.\nfields : Tuple[Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz'], ...] = ['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz']\n Collection of field components to store in the monitor. Note that some methods like ``flux``, ``dot`` require all tangential field components, while others like ``mode_area`` require all E-field components.\nplane : Union[Box, ModeSource, ModeMonitor, ModeSolverMonitor] = None\n Cross-sectional plane in which the mode will be computed. If provided, the computational domain will be the intersection between the provided ``plane`` and the simulation geometry. If ``None``, the simulation must be 2D, and the plane will be the entire simulation geometry.\n\nThe ``symmetry`` field can be used to enforce reflection symmetry across planes\nthrough the ``center`` of the simulation. Each component of the ``symmetry`` field\nis only used if the ``center`` of the ``plane`` and the simulation geometry\ncoincide in that component. Symmetry normal to the mode solving domain has no\neffect; the field ``filter_pol`` in :class:`.ModeSpec` can be used here instead.\n\nExample\n-------\n>>> from tidy3d import C_0, ModeSpec, BoundarySpec, Boundary\n>>> lambda0 = 1550e-9\n>>> freq0 = C_0 / lambda0\n>>> freqs = [freq0]\n>>> sim_size = lambda0, lambda0, 0\n>>> mode_spec = ModeSpec(num_modes=4)\n>>> boundary_spec = BoundarySpec(\n... x=Boundary.pec(),\n... y=Boundary.pec(),\n... z=Boundary.periodic()\n... )\n>>> sim = ModeSimulation(\n... size=sim_size,\n... freqs=freqs,\n... mode_spec=mode_spec,\n... boundary_spec=boundary_spec\n... )\n\nSee Also\n--------\n\n:class:`ModeSource`:\n Injects current source to excite modal profile on finite extent plane.\n\n**Notebooks:**\n * `Waveguide Y junction <../../notebooks/YJunction.html>`_\n * `Photonic crystal waveguide polarization filter <../../../notebooks/PhotonicCrystalWaveguidePolarizationFilter.html>`_\n\n**Lectures:**\n * `Prelude to Integrated Photonics Simulation: Mode Injection `_",
+ "description": "Simulation class for solving electromagnetic eigenmodes in a 2D plane with\ntranslational invariance in the third dimension. If the field ``plane`` is\nspecified, the domain for mode solving is the intersection between the ``plane``\nand the simulation geometry. If the simulation geometry is 2D (has zero size\nin one dimension) and the ``plane`` is ``None``, then the domain for mode solving\nis the entire 2D geometry.\n\nParameters\n----------\nattrs : dict = {}\n 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 an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to vacuum if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. \nsources : Tuple[] = ()\n Sources in the simulation. Note: sources are not supported in mode simulations.\nboundary_spec : BoundarySpec = BoundarySpec(attrs={}, x=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), y=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), z=Boundary(attrs={},, plus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, minus=PML(attrs={},, name=None,, type='PML',, num_layers=12,, parameters=PMLParams(attrs={},, sigma_order=3,, sigma_min=0.0,, sigma_max=1.5,, type='PMLParams',, kappa_order=3,, kappa_min=1.0,, kappa_max=3.0,, alpha_order=1,, alpha_min=0.0,, alpha_max=0.0)),, type='Boundary'), type='BoundarySpec')\n Specification of boundary conditions along each dimension. If ``None``, PML boundary conditions are applied on all sides. This behavior is for consistency with FDTD simulations; however, please note that the mode solver terminates the mode plane with PEC boundary. The 'ModeSpec' can be used to apply PML layers in the mode solver.\nmonitors : Tuple[PermittivityMonitor, ...] = ()\n Tuple of monitors in the simulation. Note: monitor names are used to access data after simulation is run.\ngrid_spec : GridSpec = GridSpec(attrs={}, grid_x=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_y=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), grid_z=AutoGrid(attrs={},, type='AutoGrid',, max_scale=1.4,, mesher=GradedMesher(attrs={},, type='GradedMesher'),, dl_min=None,, min_steps_per_wvl=10.0,, min_steps_per_sim_size=10.0), wavelength=None, override_structures=(), snapping_points=(), layer_refinement_specs=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm', 'mil', 'in']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nlumped_elements : Tuple[Annotated[Union[tidy3d.components.lumped_element.LumpedResistor, tidy3d.components.lumped_element.CoaxialLumpedResistor, tidy3d.components.lumped_element.LinearLumpedElement], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Tuple of lumped elements in the simulation. Note: only :class:`tidy3d.LumpedResistor` is supported currently.\nsubpixel : Union[bool, SubpixelSpec] = SubpixelSpec(attrs={}, dielectric=PolarizedAveraging(attrs={},, type='PolarizedAveraging'), metal=Staircasing(attrs={},, type='Staircasing'), pec=PECConformal(attrs={},, type='PECConformal',, timestep_reduction=0.3,, edge_singularity_correction=False), pmc=Staircasing(attrs={},, type='Staircasing'), lossy_metal=SurfaceImpedance(attrs={},, type='SurfaceImpedance',, timestep_reduction=0.0,, edge_singularity_correction=False), type='SubpixelSpec')\n Apply subpixel averaging methods of the permittivity on structure interfaces to result in much higher accuracy for a given grid size. Supply a :class:`SubpixelSpec` to this field to select subpixel averaging methods separately on dielectric, metal, and PEC material interfaces. Alternatively, user may supply a boolean value: ``True`` to apply the default subpixel averaging methods corresponding to ``SubpixelSpec()`` , or ``False`` to apply staircasing.\nsimulation_type : Optional[Literal['autograd_fwd', 'autograd_bwd', 'tidy3d', None]] = tidy3d\n Tag used internally to distinguish types of simulations for ``autograd`` gradient processing.\npost_norm : Union[float, FreqDataArray] = 1.0\n Factor to multiply the fields by after running, given the adjoint source pipeline used. Note: this is used internally only.\nmode_spec : ModeSpec\n Container with specifications about the modes to be solved for.\nfreqs : Union[tuple[float, ...], ArrayLike[dtype=float, ndim=1]]\n A list of frequencies at which to solve.\ndirection : Literal['+', '-'] = +\n Direction of waveguide mode propagation along the axis defined by its normal dimension.\ncolocate : bool = True\n Toggle whether fields should be colocated to grid cell boundaries (i.e. primal grid nodes). Default is ``True``.\nfields : Tuple[Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz'], ...] = ['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz']\n Collection of field components to store in the monitor. Note that some methods like ``flux``, ``dot`` require all tangential field components, while others like ``mode_area`` require all E-field components.\nplane : Union[Box, ModeSource, ModeMonitor, ModeSolverMonitor] = None\n Cross-sectional plane in which the mode will be computed. If provided, the computational domain will be the intersection between the provided ``plane`` and the simulation geometry. If ``None``, the simulation must be 2D, and the plane will be the entire simulation geometry.\n\nThe ``symmetry`` field can be used to enforce reflection symmetry across planes\nthrough the ``center`` of the simulation. Each component of the ``symmetry`` field\nis only used if the ``center`` of the ``plane`` and the simulation geometry\ncoincide in that component. Symmetry normal to the mode solving domain has no\neffect; the field ``filter_pol`` in :class:`.ModeSpec` can be used here instead.\n\nExample\n-------\n>>> from tidy3d import C_0, ModeSpec, BoundarySpec, Boundary\n>>> lambda0 = 1550e-9\n>>> freq0 = C_0 / lambda0\n>>> freqs = [freq0]\n>>> sim_size = lambda0, lambda0, 0\n>>> mode_spec = ModeSpec(num_modes=4)\n>>> boundary_spec = BoundarySpec(\n... x=Boundary.pec(),\n... y=Boundary.pec(),\n... z=Boundary.periodic()\n... )\n>>> sim = ModeSimulation(\n... size=sim_size,\n... freqs=freqs,\n... mode_spec=mode_spec,\n... boundary_spec=boundary_spec\n... )\n\nSee Also\n--------\n\n:class:`ModeSource`:\n Injects current source to excite modal profile on finite extent plane.\n\n**Notebooks:**\n * `Waveguide Y junction <../../notebooks/YJunction.html>`_\n * `Photonic crystal waveguide polarization filter <../../../notebooks/PhotonicCrystalWaveguidePolarizationFilter.html>`_\n\n**Lectures:**\n * `Prelude to Integrated Photonics Simulation: Mode Injection `_",
"type": "object",
"properties": {
"attrs": {
@@ -24917,7 +24925,9 @@
"um",
"mm",
"cm",
- "m"
+ "m",
+ "mil",
+ "in"
],
"type": "string"
},
diff --git a/tests/test_components/test_geometry.py b/tests/test_components/test_geometry.py
index 6fb6f6ae3d..abcbdd6746 100644
--- a/tests/test_components/test_geometry.py
+++ b/tests/test_components/test_geometry.py
@@ -96,6 +96,8 @@ def test_plot(component):
def test_plot_with_units():
_ = BOX.plot(z=0, ax=AX, plot_length_units="nm")
plt.close()
+ _ = BOX.plot(z=0, ax=AX, plot_length_units="mil")
+ plt.close()
def test_base_inside():
diff --git a/tidy3d/components/types.py b/tidy3d/components/types.py
index 0489d56797..56d5c037cd 100644
--- a/tidy3d/components/types.py
+++ b/tidy3d/components/types.py
@@ -199,7 +199,7 @@ def __modify_schema__(cls, field_schema):
PlanePosition = Literal["bottom", "middle", "top"]
ClipOperationType = Literal["union", "intersection", "difference", "symmetric_difference"]
BoxSurface = Literal["x-", "x+", "y-", "y+", "z-", "z+"]
-LengthUnit = Literal["nm", "μm", "um", "mm", "cm", "m"]
+LengthUnit = Literal["nm", "μm", "um", "mm", "cm", "m", "mil", "in"]
PriorityMode = Literal["equal", "conductor"]
""" medium """
diff --git a/tidy3d/components/viz/axes_utils.py b/tidy3d/components/viz/axes_utils.py
index 14f1aa3cab..85007e773c 100644
--- a/tidy3d/components/viz/axes_utils.py
+++ b/tidy3d/components/viz/axes_utils.py
@@ -8,6 +8,95 @@
from tidy3d.exceptions import Tidy3dKeyError
+def _create_unit_aware_locator():
+ """Create UnitAwareLocator lazily due to matplotlib import restrictions."""
+ import matplotlib.ticker as ticker
+
+ class UnitAwareLocator(ticker.Locator):
+ """Custom tick locator that places ticks at nice positions in the target unit."""
+
+ def __init__(self, scale_factor: float):
+ """
+ Parameters
+ ----------
+ scale_factor : float
+ Factor to convert from micrometers to the target unit.
+ """
+ super().__init__()
+ self.scale_factor = scale_factor
+
+ def __call__(self):
+ vmin, vmax = self.axis.get_view_interval()
+ return self.tick_values(vmin, vmax)
+
+ def view_limits(self, vmin, vmax):
+ """Override to prevent matplotlib from adjusting our limits."""
+ return vmin, vmax
+
+ def tick_values(self, vmin, vmax):
+ # convert the view range to the target unit
+ vmin_unit = vmin * self.scale_factor
+ vmax_unit = vmax * self.scale_factor
+
+ # tolerance for floating point comparisons in target unit
+ unit_range = vmax_unit - vmin_unit
+ unit_tol = unit_range * 1e-8
+
+ locator = ticker.MaxNLocator(nbins=11, prune=None, min_n_ticks=2)
+
+ ticks_unit = locator.tick_values(vmin_unit, vmax_unit)
+
+ # ensure we have ticks that cover the full range
+ if len(ticks_unit) > 0:
+ if ticks_unit[0] > vmin_unit + unit_tol or ticks_unit[-1] < vmax_unit - unit_tol:
+ # try with fewer bins to get better coverage
+ for n in [10, 9, 8, 7, 6, 5]:
+ locator = ticker.MaxNLocator(nbins=n, prune=None, min_n_ticks=2)
+ ticks_unit = locator.tick_values(vmin_unit, vmax_unit)
+ if (
+ len(ticks_unit) >= 3
+ and ticks_unit[0] <= vmin_unit + unit_tol
+ and ticks_unit[-1] >= vmax_unit - unit_tol
+ ):
+ break
+
+ # if still no good coverage, manually ensure edge coverage
+ if len(ticks_unit) > 0:
+ if (
+ ticks_unit[0] > vmin_unit + unit_tol
+ or ticks_unit[-1] < vmax_unit - unit_tol
+ ):
+ # find a reasonable step size from existing ticks
+ if len(ticks_unit) > 1:
+ step = ticks_unit[1] - ticks_unit[0]
+ else:
+ step = unit_range / 5
+
+ # extend the range to ensure coverage
+ extended_min = vmin_unit - step
+ extended_max = vmax_unit + step
+
+ # try one more time with extended range
+ locator = ticker.MaxNLocator(nbins=8, prune=None, min_n_ticks=2)
+ ticks_unit = locator.tick_values(extended_min, extended_max)
+
+ # filter to reasonable bounds around the original range
+ ticks_unit = [
+ t
+ for t in ticks_unit
+ if t >= vmin_unit - step / 2 and t <= vmax_unit + step / 2
+ ]
+
+ # convert the nice ticks back to the original data unit (micrometers)
+ ticks_um = ticks_unit / self.scale_factor
+
+ # filter to ensure ticks are within bounds (with small tolerance)
+ eps = (vmax - vmin) * 1e-8
+ return [tick for tick in ticks_um if vmin - eps <= tick <= vmax + eps]
+
+ return UnitAwareLocator
+
+
def make_ax() -> Ax:
"""makes an empty ``ax``."""
import matplotlib.pyplot as plt
@@ -72,14 +161,24 @@ def set_default_labels_and_title(
)
ax.set_xlabel(f"{xlabel} ({plot_length_units})")
ax.set_ylabel(f"{ylabel} ({plot_length_units})")
- # Formatter to help plot in arbitrary units
+
scale_factor = UnitScaling[plot_length_units]
+
+ # for imperial units, use custom tick locator for nice tick positions
+ if plot_length_units in ["mil", "in"]:
+ UnitAwareLocator = _create_unit_aware_locator()
+ x_locator = UnitAwareLocator(scale_factor)
+ y_locator = UnitAwareLocator(scale_factor)
+ ax.xaxis.set_major_locator(x_locator)
+ ax.yaxis.set_major_locator(y_locator)
+
formatter = ticker.FuncFormatter(lambda y, _: f"{y * scale_factor:.2f}")
+
ax.xaxis.set_major_formatter(formatter)
ax.yaxis.set_major_formatter(formatter)
- ax.set_title(
- f"cross section at {'xyz'[axis]}={position * scale_factor:.2f} ({plot_length_units})"
- )
+
+ position_scaled = position * scale_factor
+ ax.set_title(f"cross section at {'xyz'[axis]}={position_scaled:.2f} ({plot_length_units})")
else:
ax.set_xlabel(xlabel)
ax.set_ylabel(ylabel)
diff --git a/tidy3d/constants.py b/tidy3d/constants.py
index 7edcf22278..4d25f25c45 100644
--- a/tidy3d/constants.py
+++ b/tidy3d/constants.py
@@ -245,6 +245,7 @@
"mm": 1e-3,
"cm": 1e-4,
"m": 1e-6,
+ "mil": 1.0 / 25.4,
"in": 1.0 / 25400,
}
)