tidy3d.QuasiUniformGrid#

class QuasiUniformGrid[source]#

Bases: AbstractAutoGrid

Similar to UniformGrid that generates uniform 1D grid, but grid positions are locally fine tuned to be snaped to snapping points and the edges of structure bounding boxes. Internally, it is using the same meshing method as AutoGrid, but it ignores material information in favor for a user-defined grid size.

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().

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

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

  • dl_min (Optional[NonNegativeFloat] = None) โ€“ [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. If None or 0, a heuristic lower bound value will be applied.

  • dl (PositiveFloat) โ€“ [units = um]. Grid size for quasi-uniform grid generation. Grid size at some locations can be slightly smaller.

Example

>>> grid_1d = QuasiUniformGrid(dl=0.1)

See also

UniformGrid

Uniform 1D grid.

AutoGrid

Specification for non-uniform grid along a given dimension.

Notebooks:

Attributes

Methods

estimated_min_dl(wavelength,ย structure_list,ย ...)

Estimated minimal grid size, which equals grid size here.

Inherited Common Usage

dl#
estimated_min_dl(wavelength, structure_list, sim_size)[source]#

Estimated minimal grid size, which equals grid size here.

Parameters:
  • wavelength (float) โ€“ Wavelength to use for the step size and for dispersive media epsilon.

  • structure_list (List[Structure]) โ€“ List of structures present in the simulation.

  • sim_size (Tuple[float, 3]) โ€“ Simulation domain size.

Returns:

Minimal grid size from grid specification.

Return type:

float

__hash__()#

Hash method.