diff --git a/CHANGELOG.md b/CHANGELOG.md
index 00482b47e..4b173d795 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [2.7.6] - 2024-10-30
+
### Added
- Users can pass the `shading` argument in the `SimulationData.plot_field` to `Xarray.plot` method. When `shading='gouraud'`, the image is interpolated, producing a smoother visualization.
- Users can manually specify the background medium for a structure to be used for geometry gradient calculations by supplying `Structure.background_permittivity`. This is useful when there are overlapping structures or structures embedded in other mediums.
@@ -1355,7 +1357,8 @@ which fields are to be projected is now determined automatically based on the me
- Job and Batch classes for better simulation handling (eventually to fully replace webapi functions).
- A large number of small improvements and bug fixes.
-[Unreleased]: https://github.com/flexcompute/tidy3d/compare/v2.7.5...develop
+[Unreleased]: https://github.com/flexcompute/tidy3d/compare/v2.7.6...develop
+[2.7.6]: https://github.com/flexcompute/tidy3d/compare/v2.7.5...v2.7.6
[2.7.5]: https://github.com/flexcompute/tidy3d/compare/v2.7.4...v2.7.5
[2.7.4]: https://github.com/flexcompute/tidy3d/compare/v2.7.3...v2.7.4
[2.7.3]: https://github.com/flexcompute/tidy3d/compare/v2.7.2...v2.7.3
diff --git a/docs/notebooks b/docs/notebooks
index 86b0310c5..3ad84c09b 160000
--- a/docs/notebooks
+++ b/docs/notebooks
@@ -1 +1 @@
-Subproject commit 86b0310c55af92be71c04d7e2c6865d1090c3534
+Subproject commit 3ad84c09bfa80ceb3cb4cdf894472430acf2a1fb
diff --git a/tests/sims/simulation_sample.h5 b/tests/sims/simulation_sample.h5
index 8fef253cb..25142049c 100644
Binary files a/tests/sims/simulation_sample.h5 and b/tests/sims/simulation_sample.h5 differ
diff --git a/tests/sims/simulation_sample.json b/tests/sims/simulation_sample.json
index 1444999d5..2154786a3 100644
--- a/tests/sims/simulation_sample.json
+++ b/tests/sims/simulation_sample.json
@@ -41,6 +41,7 @@
"length": 1.0
},
"name": "traced_dieletric_cylinder",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -72,6 +73,7 @@
]
},
"name": "traced_dieletric_box",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -115,6 +117,7 @@
]
},
"name": "traced custom polyslab",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -149,6 +152,7 @@
]
},
"name": "dieletric_box",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -180,6 +184,7 @@
]
},
"name": "lossy_box",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -207,6 +212,7 @@
]
},
"name": "sellmeier_sphere",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -246,6 +252,7 @@
]
},
"name": "lorentz_box",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -283,6 +290,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -314,6 +322,7 @@
}
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -350,6 +359,7 @@
]
},
"name": "drude_box",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -386,6 +396,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -461,6 +472,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -510,6 +522,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -579,6 +592,7 @@
]
},
"name": "pec_group",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -608,6 +622,7 @@
"length": 2.0
},
"name": "anisotopic_cylinder",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -685,6 +700,7 @@
]
},
"name": "pole_slab",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -727,6 +743,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -761,6 +778,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -799,6 +817,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -838,6 +857,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -876,6 +896,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -914,6 +935,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -951,6 +973,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -991,6 +1014,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -1047,6 +1071,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -1110,6 +1135,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -1166,6 +1192,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -1222,6 +1249,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -1271,6 +1299,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -1307,6 +1336,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -1384,6 +1414,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -1421,6 +1452,7 @@
}
},
"name": "dieletric_mesh",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -1462,6 +1494,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -1512,6 +1545,7 @@
}
},
"name": "clip_operation",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -1573,6 +1607,7 @@
]
},
"name": "transformed_box",
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -2807,6 +2842,7 @@
]
},
"name": null,
+ "background_permittivity": null,
"type": "Structure",
"medium": {
"attrs": {},
@@ -2825,7 +2861,7 @@
"snapping_points": [],
"type": "GridSpec"
},
- "version": "2.7.5",
+ "version": "2.7.6",
"lumped_elements": [],
"subpixel": false,
"simulation_type": null,
diff --git a/tidy3d/schema.json b/tidy3d/schema.json
index ddfba8d0d..5da498676 100644
--- a/tidy3d/schema.json
+++ b/tidy3d/schema.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, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_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.UniformCurrentSource, tidy3d.components.source.PointDipole, tidy3d.components.source.GaussianBeam, tidy3d.components.source.AstigmaticGaussianBeam, tidy3d.components.source.ModeSource, tidy3d.components.source.PlaneWave, tidy3d.components.source.CustomFieldSource, tidy3d.components.source.CustomCurrentSource, tidy3d.components.source.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.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], 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',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(attrs={},, type='GradedMesher')), grid_y=AutoGrid(attrs={},, type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(attrs={},, type='GradedMesher')), grid_z=AutoGrid(attrs={},, type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(attrs={},, type='GradedMesher')), wavelength=None, override_structures=(), snapping_points=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.7.5\n String specifying the front end version number.\nlumped_elements : Tuple[Union[LumpedResistor, CoaxialLumpedResistor], ...] = ()\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), 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', None]] = None\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.\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, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_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.UniformCurrentSource, tidy3d.components.source.PointDipole, tidy3d.components.source.GaussianBeam, tidy3d.components.source.AstigmaticGaussianBeam, tidy3d.components.source.ModeSource, tidy3d.components.source.PlaneWave, tidy3d.components.source.CustomFieldSource, tidy3d.components.source.CustomCurrentSource, tidy3d.components.source.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.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], 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',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(attrs={},, type='GradedMesher')), grid_y=AutoGrid(attrs={},, type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(attrs={},, type='GradedMesher')), grid_z=AutoGrid(attrs={},, type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(attrs={},, type='GradedMesher')), wavelength=None, override_structures=(), snapping_points=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.7.6\n String specifying the front end version number.\nlumped_elements : Tuple[Union[LumpedResistor, CoaxialLumpedResistor], ...] = ()\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), 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', None]] = None\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.\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": {
@@ -570,7 +570,7 @@
"version": {
"title": "Version",
"description": "String specifying the front end version number.",
- "default": "2.7.5",
+ "default": "2.7.6",
"type": "string"
},
"lumped_elements": {
@@ -6378,7 +6378,7 @@
},
"Structure": {
"title": "Structure",
- "description": "Defines a physical object that interacts with the electromagnetic fields.\nA :class:`Structure` is a combination of a material property (:class:`AbstractMedium`)\nand a :class:`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()``.\ngeometry : Union[Box, Transformed, ClipOperation, GeometryGroup, Sphere, Cylinder, PolySlab, ComplexPolySlabBase, TriangleMesh]\n Defines geometric properties of the structure.\nname : Optional[str] = None\n Optional name for the structure.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D, AnisotropicMediumFromMedium2D]\n Defines the electromagnetic properties of the structure's medium.\n\nNotes\n------\n\n Structures can indeed be larger than the simulation domain in ``tidy3d``. In such cases, ``tidy3d`` will\n automatically truncate the geometry that goes beyond the domain boundaries. For best results, structures that\n intersect with absorbing boundaries or simulation edges should extend all the way through. In many such\n cases, an \u201cinfinite\u201d size :class:`td.inf` can be used to define the size along that dimension.\n\nExample\n-------\n>>> from tidy3d import Box, Medium\n>>> box = Box(center=(0,0,1), size=(2, 2, 2))\n>>> glass = Medium(permittivity=3.9)\n>>> struct = Structure(geometry=box, medium=glass, name='glass_box')\n\nSee Also\n--------\n\n**Notebooks:**\n\n* `Quickstart <../../notebooks/StartHere.html>`_: Usage in a basic simulation flow.\n* `First walkthrough <../../notebooks/Simulation.html>`_: Usage in a basic simulation flow.\n* `Visualizing geometries in Tidy3D <../../notebooks/VizSimulation.html>`_\n\n**Lectures:**\n\n* `Using FDTD to Compute a Transmission Spectrum `_\n\n**GUI:**\n\n* `Structures `_",
+ "description": "Defines a physical object that interacts with the electromagnetic fields.\nA :class:`Structure` is a combination of a material property (:class:`AbstractMedium`)\nand a :class:`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()``.\ngeometry : Union[Box, Transformed, ClipOperation, GeometryGroup, Sphere, Cylinder, PolySlab, ComplexPolySlabBase, TriangleMesh]\n Defines geometric properties of the structure.\nname : Optional[str] = None\n Optional name for the structure.\nbackground_permittivity : Optional[ConstrainedFloatValue] = None\n Relative permittivity used for the background of this structure when performing shape optimization with autograd.\nmedium : Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D, AnisotropicMediumFromMedium2D]\n Defines the electromagnetic properties of the structure's medium.\n\nNotes\n------\n\n Structures can indeed be larger than the simulation domain in ``tidy3d``. In such cases, ``tidy3d`` will\n automatically truncate the geometry that goes beyond the domain boundaries. For best results, structures that\n intersect with absorbing boundaries or simulation edges should extend all the way through. In many such\n cases, an \u201cinfinite\u201d size :class:`td.inf` can be used to define the size along that dimension.\n\nExample\n-------\n>>> from tidy3d import Box, Medium\n>>> box = Box(center=(0,0,1), size=(2, 2, 2))\n>>> glass = Medium(permittivity=3.9)\n>>> struct = Structure(geometry=box, medium=glass, name='glass_box')\n\nSee Also\n--------\n\n**Notebooks:**\n\n* `Quickstart <../../notebooks/StartHere.html>`_: Usage in a basic simulation flow.\n* `First walkthrough <../../notebooks/Simulation.html>`_: Usage in a basic simulation flow.\n* `Visualizing geometries in Tidy3D <../../notebooks/VizSimulation.html>`_\n\n**Lectures:**\n\n* `Using FDTD to Compute a Transmission Spectrum `_\n\n**GUI:**\n\n* `Structures `_",
"type": "object",
"properties": {
"attrs": {
@@ -6439,6 +6439,12 @@
"description": "Optional name for the structure.",
"type": "string"
},
+ "background_permittivity": {
+ "title": "Background Permittivity",
+ "description": "Relative permittivity used for the background of this structure when performing shape optimization with autograd.",
+ "minimum": 1.0,
+ "type": "number"
+ },
"type": {
"title": "Type",
"default": "Structure",
@@ -8611,7 +8617,7 @@
},
"TFSF": {
"title": "TFSF",
- "description": "Total-field scattered-field (TFSF) source that can inject a plane wave in a finite region.\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()``.\nname : Optional[str] = None\n Optional name for the source.\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.\nsource_time : Union[GaussianPulse, ContinuousWave, CustomSourceTime]\n Specification of the source time-dependence.\ndirection : Literal['+', '-']\n Specifies propagation in the positive or negative direction of the injection axis.\nangle_theta : float = 0.0\n [units = rad]. Polar angle of the propagation axis from the injection axis.\nangle_phi : float = 0.0\n [units = rad]. Azimuth angle of the propagation axis in the plane orthogonal to the injection axis.\npol_angle : float = 0\n [units = rad]. Specifies the angle between the electric field polarization of the source and the plane defined by the injection axis and the propagation axis (rad). ``pol_angle=0`` (default) specifies P polarization, while ``pol_angle=np.pi/2`` specifies S polarization. At normal incidence when S and P are undefined, ``pol_angle=0`` defines: - ``Ey`` polarization for propagation along ``x``.- ``Ex`` polarization for propagation along ``y``.- ``Ex`` polarization for propagation along ``z``.\ninjection_axis : Literal[0, 1, 2]\n Specifies the injection axis. The plane of incidence is defined via this ``injection_axis`` and the ``direction``. The popagation axis is defined with respect to the ``injection_axis`` by ``angle_theta`` and ``angle_phi``.\n\nNotes\n-----\n\n The TFSF source injects :math:`\\frac{1 W}{\\mu m^2}` of power along the :attr:`injection_axis`. Note that in the\n case of angled incidence, :math:`\\frac{1 W}{\\mu m^2}` is still injected along the source's :attr:`injection_axis`,\n and not the propagation direction, unlike a :class:`PlaneWave` source. This allows computing\n scattering and absorption cross-sections without the need for additional normalization.\n\n The TFSF source allows specifying a box region into which a plane wave is injected. Fields inside this region\n can be interpreted as the superposition of the incident field and the scattered field due to any scatterers\n present in the simulation domain. The fields at the edges of the TFSF box are modified at each time step such\n that the incident field is cancelled out, so that all fields outside the TFSF box are scattered fields only.\n This is useful in scenarios where one is interested in computing scattered fields only, for example when\n computing scattered cross-sections of various objects.\n\n It is important to note that when a non-uniform grid is used in the directions transverse to the\n :attr:`injection_axis` of the TFSF source, the suppression of the incident field outside the TFSF box may not be as\n close to zero as in the case of a uniform grid. Because of this, a warning may be issued when nonuniform grid\n TFSF setup is detected. In some cases, however, the accuracy may be only weakly affected, and the warnings\n can be ignored.\n\nSee Also\n--------\n\n**Notebooks**:\n * `Defining a total-field scattered-field (TFSF) plane wave source <../../notebooks/TFSF.html>`_\n * `Nanoparticle Scattering <../../notebooks/PlasmonicNanoparticle.html>`_: To force a uniform grid in the TFSF region and avoid the warnings, a mesh override structure can be used as illustrated here.",
+ "description": "Total-field scattered-field (TFSF) source that can inject a plane wave in a finite region.\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()``.\nname : Optional[str] = None\n Optional name for the source.\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.\nsource_time : Union[GaussianPulse, ContinuousWave, CustomSourceTime]\n Specification of the source time-dependence.\ndirection : Literal['+', '-']\n Specifies propagation in the positive or negative direction of the injection axis.\nangle_theta : float = 0.0\n [units = rad]. Polar angle of the propagation axis from the injection axis.\nangle_phi : float = 0.0\n [units = rad]. Azimuth angle of the propagation axis in the plane orthogonal to the injection axis.\npol_angle : float = 0\n [units = rad]. Specifies the angle between the electric field polarization of the source and the plane defined by the injection axis and the propagation axis (rad). ``pol_angle=0`` (default) specifies P polarization, while ``pol_angle=np.pi/2`` specifies S polarization. At normal incidence when S and P are undefined, ``pol_angle=0`` defines: - ``Ey`` polarization for propagation along ``x``.- ``Ex`` polarization for propagation along ``y``.- ``Ex`` polarization for propagation along ``z``.\ninjection_axis : Literal[0, 1, 2]\n Specifies the injection axis. The plane of incidence is defined via this ``injection_axis`` and the ``direction``. The popagation axis is defined with respect to the ``injection_axis`` by ``angle_theta`` and ``angle_phi``.\n\nNotes\n-----\n\n The TFSF source injects :math:`1 W` of power per :math:`\\mu m^2` of source area along the :attr:`injection_axis`.\n Hence, the normalization for the incident field is :math:`|E_0|^2 = \\frac{2}{c\\epsilon_0}`, for any source size.\n Note that in the case of angled incidence, the same power is injected along the source's :attr:`injection_axis`,\n and not the propagation direction. This allows computing scattering and absorption cross-sections\n without the need for additional normalization.\n\n The TFSF source allows specifying a box region into which a plane wave is injected. Fields inside this region\n can be interpreted as the superposition of the incident field and the scattered field due to any scatterers\n present in the simulation domain. The fields at the edges of the TFSF box are modified at each time step such\n that the incident field is cancelled out, so that all fields outside the TFSF box are scattered fields only.\n This is useful in scenarios where one is interested in computing scattered fields only, for example when\n computing scattered cross-sections of various objects.\n\n It is important to note that when a non-uniform grid is used in the directions transverse to the\n :attr:`injection_axis` of the TFSF source, the suppression of the incident field outside the TFSF box may not be as\n close to zero as in the case of a uniform grid. Because of this, a warning may be issued when nonuniform grid\n TFSF setup is detected. In some cases, however, the accuracy may be only weakly affected, and the warnings\n can be ignored.\n\nSee Also\n--------\n\n**Notebooks**:\n * `Defining a total-field scattered-field (TFSF) plane wave source <../../notebooks/TFSF.html>`_\n * `Nanoparticle Scattering <../../notebooks/PlasmonicNanoparticle.html>`_: To force a uniform grid in the TFSF region and avoid the warnings, a mesh override structure can be used as illustrated here.",
"type": "object",
"properties": {
"attrs": {
@@ -12784,7 +12790,7 @@
},
"MeshOverrideStructure": {
"title": "MeshOverrideStructure",
- "description": "Defines an object that is only used in the process of generating the mesh.\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()``.\ngeometry : Union[Box, Transformed, ClipOperation, GeometryGroup, Sphere, Cylinder, PolySlab, ComplexPolySlabBase, TriangleMesh]\n Defines geometric properties of the structure.\nname : Optional[str] = None\n Optional name for the structure.\ndl : Tuple[PositiveFloat, PositiveFloat, PositiveFloat]\n [units = um]. Grid size along x, y, z directions.\nenforce : bool = False\n If ``True``, enforce the grid size setup inside the structure even if the structure is inside a structure of smaller grid size. In the intersection region of multiple structures of ``enforce=True``, grid size is decided by the last added structure of ``enforce=True``.\n\nNotes\n-----\n\n A :class:`MeshOverrideStructure` is a combination of geometry :class:`Geometry`,\n grid size along ``x``, ``y``, ``z`` directions, and a boolean on whether the override\n will be enforced.\n\nExample\n-------\n>>> from tidy3d import Box\n>>> box = Box(center=(0,0,1), size=(2, 2, 2))\n>>> struct_override = MeshOverrideStructure(geometry=box, dl=(0.1,0.2,0.3), name='override_box')",
+ "description": "Defines an object that is only used in the process of generating the mesh.\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()``.\ngeometry : Union[Box, Transformed, ClipOperation, GeometryGroup, Sphere, Cylinder, PolySlab, ComplexPolySlabBase, TriangleMesh]\n Defines geometric properties of the structure.\nname : Optional[str] = None\n Optional name for the structure.\nbackground_permittivity : Optional[ConstrainedFloatValue] = None\n Relative permittivity used for the background of this structure when performing shape optimization with autograd.\ndl : Tuple[PositiveFloat, PositiveFloat, PositiveFloat]\n [units = um]. Grid size along x, y, z directions.\nenforce : bool = False\n If ``True``, enforce the grid size setup inside the structure even if the structure is inside a structure of smaller grid size. In the intersection region of multiple structures of ``enforce=True``, grid size is decided by the last added structure of ``enforce=True``.\n\nNotes\n-----\n\n A :class:`MeshOverrideStructure` is a combination of geometry :class:`Geometry`,\n grid size along ``x``, ``y``, ``z`` directions, and a boolean on whether the override\n will be enforced.\n\nExample\n-------\n>>> from tidy3d import Box\n>>> box = Box(center=(0,0,1), size=(2, 2, 2))\n>>> struct_override = MeshOverrideStructure(geometry=box, dl=(0.1,0.2,0.3), name='override_box')",
"type": "object",
"properties": {
"attrs": {
@@ -12845,6 +12851,12 @@
"description": "Optional name for the structure.",
"type": "string"
},
+ "background_permittivity": {
+ "title": "Background Permittivity",
+ "description": "Relative permittivity used for the background of this structure when performing shape optimization with autograd.",
+ "minimum": 1.0,
+ "type": "number"
+ },
"type": {
"title": "Type",
"default": "MeshOverrideStructure",