tidy3d.AutoGrid#

class AutoGrid[source]#

Bases: GridSpec1d

Specification for non-uniform grid along a given dimension.

Parameters:
  • attrs (dict = {}) – Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, attrs are mutable. For example, the following is allowed for setting 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().

  • min_steps_per_wvl (ConstrainedFloatValue = 10.0) – Minimal number of steps per wavelength in each medium.

  • max_scale (ConstrainedFloatValue = 1.4) – Sets the maximum ratio between any two consecutive grid steps.

  • dl_min (NonNegativeFloat = 0) – [units = um]. Lower bound of the grid size along this dimension regardless of structures present in the simulation, including override structures with enforced=True. It is a soft bound, meaning that the actual minimal grid size might be slightly smaller.

  • mesher (GradedMesher = GradedMesher(attrs={}, type='GradedMesher')) – The type of mesher to use to generate the grid automatically.

Example

>>> grid_1d = AutoGrid(min_steps_per_wvl=16, max_scale=1.4)

See also

UniformGrid

Uniform 1D grid.

GridSpec

Collective grid specification for all three dimensions.

Notebooks:
Lectures:

Attributes

Methods

Inherited Common Usage

min_steps_per_wvl#
max_scale#
dl_min#
mesher#
__hash__()#

Hash method.