tidy3d.GridRefinement#
- class GridRefinement[source]#
Bases:
Tidy3dBaseModelSpecification for local mesh refinement that defines the grid step size and the number of grid cells in the refinement region.
- Parameters:
refinement_factor (Optional[PositiveFloat] = None) – Refine grid step size in vacuum by this factor.
dl (Optional[PositiveFloat] = None) – [units = um]. Grid step size in the refined region.
num_cells (PositiveInt = 3) – Number of grid cells in the refinement region.
Note
If both refinement_factor and dl are defined, the grid step size is upper bounded by the smaller value of the two. If neither is defined, default refinement_factor=2 is applied.
Example
>>> grid_refine = GridRefinement(refinement_factor = 2, num_cells = 7)
Attributes
Methods
override_structure(center, ...)Generate override structure for mesh refinement.
- refinement_factor#
- dl#
- num_cells#
- override_structure(center, grid_size_in_vacuum, drop_outside_sim)[source]#
Generate override structure for mesh refinement.
- Parameters:
- Returns:
Unshadowed override structures for mesh refinement. If refinement doesn’t need to be applied to an axis, the override geometry has size=inf and dl=None along this axis.
- Return type: