Layer-based Grid Refinement#
Specification for automatic mesh refinement and snapping in layered structures. |
|
Specification for corner detection on a 2D plane. |
|
Specification for local mesh refinement that defines the grid step size and the number of grid cells in the refinement region. |
The LayerRefinementSpec class allows the user to specify automated refinement within a layered region, for instance, the metallic trace plane of a printed circuit board. The grid will be automatically refined near any metallic corners and edges in that layer.
import tidy3d as td
# Define layer refinement spec
my_layer_refinement_spec = td.LayerRefinementSpec(
axis=2, # layer normal axis
center=(0, 0, 0), # layer center
size=(3, 2, 0.1), # layer size
min_steps_along_axis=2, # minimum number of grid points along normal axis
corner_refinement=td.GridRefinement(dl=100, num_cells=2) # metal corner refinement specification
)
# Add layer refinement spec to overall grid specification
my_grid_spec = td.GridSpec(
...,
layer_refinement_specs = [my_layer_refinement_spec]
)
More than one LayerRefinementSpec is permitted. In addition to manually defining the center and size of the LayerRefinementSpec, one can alternatively use the from_bounds(), from_layer_bounds(), or from_structures() convenience methods.
my_layer_refinement_spec_2 = LayerRefinementSpec.from_structures(
structures=[my_planar_structure], # position, size, and axis automatically determined based on structure
...
)
Note that different LayerRefinementSpec instances are recommended for structures on different physical layers.
See also
For more explanation and examples, please refer to the following pages:
Example applications: