tidy3d.AutoGrid#
- class AutoGrid[source]#
Bases:
AbstractAutoGridSpecification 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,
attrsare mutable. For example, the following is allowed for setting anattrobj.attrs['foo'] = bar. Also note that Tidy3D` will raise aTypeErrorifattrscontain objects that can not be serialized. One can check ifattrsare serializable by callingobj.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. IfNoneor 0, a heuristic lower bound value will be applied.min_steps_per_wvl (ConstrainedFloatValue = 10.0) β Minimal number of steps per wavelength in each medium.
min_steps_per_sim_size (ConstrainedFloatValue = 10.0) β Minimal number of steps per longest edge length of simulation domain bounding box. This is useful when the simulation domain size is subwavelength.
Example
>>> grid_1d = AutoGrid(min_steps_per_wvl=16, max_scale=1.4)
See also
UniformGridUniform 1D grid.
GridSpecCollective grid specification for all three dimensions.
- Notebooks:
- Lectures:
Attributes
Methods
estimated_min_dl(wavelength,Β structure_list,Β ...)Estimated minimal grid size along the axis.
Inherited Common Usage
- min_steps_per_wvl#
- min_steps_per_sim_size#
- estimated_min_dl(wavelength, structure_list, sim_size)[source]#
Estimated minimal grid size along the axis. The actual minimal grid size from mesher might be smaller.
- 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:
Estimated minimal grid size from grid specification.
- Return type:
float
- __hash__()#
Hash method.