From e89d74ab1d8da8db894a0295391ad2108c1119f4 Mon Sep 17 00:00:00 2001 From: momchil Date: Wed, 21 Feb 2024 11:42:33 -0800 Subject: [PATCH] Changelog and pre release script run --- CHANGELOG.md | 38 ++++++++++-------------- tests/sims/simulation_sample.h5 | Bin 343216 -> 343216 bytes tests/sims/simulation_sample.json | 6 ++-- tidy3d/schema.json | 46 +++++++++++++++--------------- 4 files changed, 41 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75c07d64e..c5bba6b59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [2.6.0] - 2024-01-21 ### Added - Automatic subdivision of 2D materials with inhomogeneous substrate/superstrate. @@ -12,23 +12,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Free-carrier absorption (FCA) and free-carrier plasma dispersion (FCPD) nonlinearities inside `TwoPhotonAbsorption` class. - `log_path` argument in `set_logging_file`, set to `False` by default. - `ErosionDilationPenalty` to `tidy3d.plugins.adjoint.utils.penalty` to penalize parameter arrays that change under erosion and dilation. This is a simple and effective way to penalize features that violate minimum feature size or radius of curvature fabrication constraints in topology optimization. - -### Changed -- `DataArray.to_hdf5()` accepts both file handles and file paths. -- `ModeSolverMonitor` is deprecated. Mode field profiles can be retrieved directly from `ModeMonitor` with `store_fields_direction` set. -- The log file for a simulation run has been modified to include more information including warnings collected during execution. - -### Fixed -- Add dispersion information to dataframe output when available from mode solver under the column "dispersion (ps/(nm km))". -- Skip adjoint source for diffraction amplitudes of NaN. -- Helpful error message if `val` supplied to `SimulationData.plot_field` not supported. -- Fixed validator that warns if angled plane wave does not match simulation boundaries, which was not warning for periodic boundaries. -- Validates that no nans are present in `DataArray` values in custom components. -- Removed nans from Cartesian temperature monitors in thermal simulations by using nearest neighbor interpolation for values outside of heat simulation domain. - -## [2.6.0rc1] - 2024-01-11 - -### Added - `tidy3d.plugins.design` tool to explore user-defined design spaces. - `ModeData.dispersion` and `ModeSolverData.dispersion` are calculated together with the group index. - A utility function `td.medium_from_nk()` that automatically constructs a non-dispersive medium when permittivity>=1, and a single-pole Lorentz medium when permittivity<1. @@ -36,9 +19,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Integration of the `tidy3d-notebooks` repository. - `tidy3d develop` CLI and development guide on the main documentation. - Added a convenience method `Simulation.subsection()` to a create a new simulation based on a subregion of another one. -- Users can toggle task caching through `from tidy3d.web.core.environment import Env` and `Env.enable_caching(enableCaching: bool = True)` +- Users can toggle task caching through `from tidy3d.web.core.environment import Env` and `Env.enable_caching(True)` to enable, `Env.enable_caching(False)` to disable, or `Env.enable_caching(None)` to use global setting from web client account page. ### Changed +- `DataArray.to_hdf5()` accepts both file handles and file paths. +- `ModeSolverMonitor` is deprecated. Mode field profiles can be retrieved directly from `ModeMonitor` with `store_fields_direction` set. +- The log file for a simulation run has been modified to include more information including warnings collected during execution. - `poetry` based installation. Removal of `setup.py` and `requirements.txt`. - Upgrade to sphinx 6 for the documentation build, and change of theme. - Remote mode solver web api automatically reduces the associated `Simulation` object to the mode solver plane before uploading it to server. @@ -47,7 +33,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added an optional argument `field` in class method `.from_vtu()` of `TriangularGridDataset` and `TetrahedralGridDataset` for specifying the name of data field to load. ### Fixed -- Removed spurious warnings realted to reloading simulation containing `PerturbationMedium` with `CustomChargePerturbation`/`CustomHeatPerturbation` +- Add dispersion information to dataframe output when available from mode solver under the column "dispersion (ps/(nm km))". +- Skip adjoint source for diffraction amplitudes of NaN. +- Helpful error message if `val` supplied to `SimulationData.plot_field` not supported. +- Fixed validator that warns if angled plane wave does not match simulation boundaries, which was not warning for periodic boundaries. +- Validates that no nans are present in `DataArray` values in custom components. +- Removed nans from Cartesian temperature monitors in thermal simulations by using nearest neighbor interpolation for values outside of heat simulation domain. +- Removed spurious warnings realted to reloading simulation containing `PerturbationMedium` with `CustomChargePerturbation`/`CustomHeatPerturbation`. + ## [2.5.2] - 2024-01-11 ### Fixed @@ -1104,9 +1097,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.6.0rc1...pre/2.6 -[2.6.0rc1]: https://github.com/flexcompute/tidy3d/compare/v2.5.1...v2.6.0rc1 -[Unreleased]: https://github.com/flexcompute/tidy3d/compare/v2.5.1...develop +[Unreleased]: https://github.com/flexcompute/tidy3d/compare/v2.6.0...develop +[2.6.0]: https://github.com/flexcompute/tidy3d/compare/v2.5.2...v2.6.0 [2.5.2]: https://github.com/flexcompute/tidy3d/compare/v2.5.1...v2.5.2 [2.5.1]: https://github.com/flexcompute/tidy3d/compare/v2.5.0...v2.5.1 [2.5.0]: https://github.com/flexcompute/tidy3d/compare/v2.4.3...v2.5.0 diff --git a/tests/sims/simulation_sample.h5 b/tests/sims/simulation_sample.h5 index 477f5adab44ac14c220c751ab526b588071d68e0..0c3be47cf02760b17ef3842b5befceb3eceb49bb 100644 GIT binary patch delta 87 zcmdn+Q)B}W{VP;X&Mz%W%qvl{QZUf7&{0sz%P-1J%*m`ujnB+WNv!~hPv$Gq6eudq ji!aH{O$7=Vrs^6RHAfY-M-?#wF%u9oZ;vWs2|EP8$;?evvQjWi)ipGltXQNunXgEUH#xtwC^4@DC~lx<(HvFO T9#zB$#7scUygjOjCF~Rctc)2q diff --git a/tests/sims/simulation_sample.json b/tests/sims/simulation_sample.json index ab214c858..09c0c164d 100644 --- a/tests/sims/simulation_sample.json +++ b/tests/sims/simulation_sample.json @@ -2223,9 +2223,9 @@ "type": "GridSpec" }, "version": "2.6.0", - "run_time": 1e-12, + "courant": 0.8, + "normalize_index": 0, "shutoff": 0.0001, "subpixel": false, - "normalize_index": 0, - "courant": 0.8 + "run_time": 1e-12 } \ No newline at end of file diff --git a/tidy3d/schema.json b/tidy3d/schema.json index 94e768515..993360770 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----------\ncenter : Tuple[float, float, float] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Tuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat]\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(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(x=Boundary(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(grid_x=AutoGrid(type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(type='GradedMesher')), grid_y=AutoGrid(type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(type='GradedMesher')), grid_z=AutoGrid(type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(type='GradedMesher')), wavelength=None, override_structures=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.6.0\n String specifying the front end version number.\nrun_time : PositiveFloat\n [units = sec]. Total electromagnetic evolution time in seconds. Note: If simulation 'shutoff' is specified, simulation will terminate early when shutoff condition met. \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.\nsubpixel : bool = True\n If ``True``, uses subpixel averaging of the permittivity based on structure definition, resulting in much higher accuracy for a given grid size.\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.\ncourant : ConstrainedFloatValue = 0.99\n Courant stability factor, controls time step to spatial step ratio. Lower values lead to more stable simulations for dispersive materials, but result in longer simulation times. This factor is normalized to no larger than 1 when CFL stability condition is met in 3D.\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----------\ncenter : Tuple[float, float, float] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Tuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat]\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(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(x=Boundary(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(grid_x=AutoGrid(type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(type='GradedMesher')), grid_y=AutoGrid(type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(type='GradedMesher')), grid_z=AutoGrid(type='AutoGrid',, min_steps_per_wvl=10.0,, max_scale=1.4,, dl_min=0.0,, mesher=GradedMesher(type='GradedMesher')), wavelength=None, override_structures=(), type='GridSpec')\n Specifications for the simulation grid along each of the three directions.\nversion : str = 2.6.0\n String specifying the front end version number.\ncourant : ConstrainedFloatValue = 0.99\n Courant stability factor, controls time step to spatial step ratio. Lower values lead to more stable simulations for dispersive materials, but result in longer simulation times. This factor is normalized to no larger than 1 when CFL stability condition is met in 3D.\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.\nsubpixel : bool = True\n If ``True``, uses subpixel averaging of the permittivity based on structure definition, resulting in much higher accuracy for a given grid size.\nrun_time : PositiveFloat\n [units = sec]. Total electromagnetic evolution time in seconds. Note: If simulation 'shutoff' is specified, simulation will terminate early when shutoff condition met. \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": { "type": { @@ -478,13 +478,21 @@ "default": "2.6.0", "type": "string" }, - "run_time": { - "title": "Run Time", - "description": "Total electromagnetic evolution time in seconds. Note: If simulation 'shutoff' is specified, simulation will terminate early when shutoff condition met. ", - "units": "sec", - "exclusiveMinimum": 0, + "courant": { + "title": "Courant Factor", + "description": "Courant stability factor, controls time step to spatial step ratio. Lower values lead to more stable simulations for dispersive materials, but result in longer simulation times. This factor is normalized to no larger than 1 when CFL stability condition is met in 3D.", + "default": 0.99, + "exclusiveMinimum": 0.0, + "maximum": 1.0, "type": "number" }, + "normalize_index": { + "title": "Normalization index", + "description": "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.", + "default": 0, + "minimum": 0, + "type": "integer" + }, "shutoff": { "title": "Shutoff Condition", "description": "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.", @@ -498,19 +506,11 @@ "default": true, "type": "boolean" }, - "normalize_index": { - "title": "Normalization index", - "description": "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.", - "default": 0, - "minimum": 0, - "type": "integer" - }, - "courant": { - "title": "Courant Factor", - "description": "Courant stability factor, controls time step to spatial step ratio. Lower values lead to more stable simulations for dispersive materials, but result in longer simulation times. This factor is normalized to no larger than 1 when CFL stability condition is met in 3D.", - "default": 0.99, - "exclusiveMinimum": 0.0, - "maximum": 1.0, + "run_time": { + "title": "Run Time", + "description": "Total electromagnetic evolution time in seconds. Note: If simulation 'shutoff' is specified, simulation will terminate early when shutoff condition met. ", + "units": "sec", + "exclusiveMinimum": 0, "type": "number" } }, @@ -7236,12 +7236,12 @@ }, "BoundarySpec": { "title": "BoundarySpec", - "description": "Specifies boundary conditions on each side of the domain and along each dimension.\n\nParameters\n----------\nx : Boundary = Boundary(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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')\n Boundary condition on the plus and minus sides along the x axis. If `None`, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.\ny : Boundary = Boundary(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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')\n Boundary condition on the plus and minus sides along the y axis. If `None`, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.\nz : Boundary = Boundary(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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')\n Boundary condition on the plus and minus sides along the z axis. If `None`, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.\n\nNotes\n-----\n\n This :class:`BoundarySpec` object defines the boundary conditions applied on each of the 6 domain edges,\n and is provided as an input to the simulation.\n\n A :class:`BoundarySpec` consists of three :class:`Boundary` objects, each defining the boundaries on the plus\n and minus side of each dimension. In most cases, one just wants to specify whether there are absorbing\n :class:`PML` layers along any of the ``x``, ``y``, ``z`` dimensions. By default, ``tidy3d`` simulations have\n :class:`PML` boundaries on all sides.\n\n If we want to explicitly set the boundaries, we can use the :attr:`tidy3d.BoundarySpec.all_sides` method.\n This can be used to set any type of boundary condition on all sides of the simulation. We can also set\n :class:`PML` on specified sides only by calling the :attr:`tidy3d.BoundarySpec.pml` method, e.g. ``BoundarySpec.pml(\n x=False, y=False, z=False)``. This will put :class:`PML` along the dimensions defined as ``True``,\n and set periodic boundaries along the other dimensions.\n\n\nSee Also\n--------\n\n:class:`Boundary`\n Boundary conditions at the minus and plus extents along a dimension.\n\n**Notebooks**\n * `How to troubleshoot a diverged FDTD simulation <../../notebooks/DivergedFDTDSimulation.html>`_\n\n**Lectures**\n * `Using FDTD to Compute a Transmission Spectrum `__", + "description": "Specifies boundary conditions on each side of the domain and along each dimension.\n\nParameters\n----------\nx : Boundary = Boundary(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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')\n Boundary condition on the plus and minus sides along the x axis. If ``None``, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.\ny : Boundary = Boundary(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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')\n Boundary condition on the plus and minus sides along the y axis. If ``None``, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.\nz : Boundary = Boundary(plus=PML(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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(name=None,, type='PML',, num_layers=12,, parameters=PMLParams(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')\n Boundary condition on the plus and minus sides along the z axis. If ``None``, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.\n\nNotes\n-----\n\n This :class:`BoundarySpec` object defines the boundary conditions applied on each of the 6 domain edges,\n and is provided as an input to the simulation.\n\n A :class:`BoundarySpec` consists of three :class:`Boundary` objects, each defining the boundaries on the plus\n and minus side of each dimension. In most cases, one just wants to specify whether there are absorbing\n :class:`PML` layers along any of the ``x``, ``y``, ``z`` dimensions. By default, ``tidy3d`` simulations have\n :class:`PML` boundaries on all sides.\n\n If we want to explicitly set the boundaries, we can use the :attr:`tidy3d.BoundarySpec.all_sides` method.\n This can be used to set any type of boundary condition on all sides of the simulation. We can also set\n :class:`PML` on specified sides only by calling the :attr:`tidy3d.BoundarySpec.pml` method, e.g. ``BoundarySpec.pml(\n x=False, y=False, z=False)``. This will put :class:`PML` along the dimensions defined as ``True``,\n and set periodic boundaries along the other dimensions.\n\n\nSee Also\n--------\n\n:class:`Boundary`\n Boundary conditions at the minus and plus extents along a dimension.\n\n**Notebooks**\n * `How to troubleshoot a diverged FDTD simulation <../../notebooks/DivergedFDTDSimulation.html>`_\n\n**Lectures**\n * `Using FDTD to Compute a Transmission Spectrum `__", "type": "object", "properties": { "x": { "title": "Boundary condition along x.", - "description": "Boundary condition on the plus and minus sides along the x axis. If `None`, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.", + "description": "Boundary condition on the plus and minus sides along the x axis. If ``None``, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.", "default": { "plus": { "name": null, @@ -7287,7 +7287,7 @@ }, "y": { "title": "Boundary condition along y.", - "description": "Boundary condition on the plus and minus sides along the y axis. If `None`, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.", + "description": "Boundary condition on the plus and minus sides along the y axis. If ``None``, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.", "default": { "plus": { "name": null, @@ -7333,7 +7333,7 @@ }, "z": { "title": "Boundary condition along z.", - "description": "Boundary condition on the plus and minus sides along the z axis. If `None`, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.", + "description": "Boundary condition on the plus and minus sides along the z axis. If ``None``, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.", "default": { "plus": { "name": null,