flex_rf.tidy3d.LayerRefinementSpec
Type: class │ Base(s): Box
Description
Section titled “Description”Specification for automatic mesh refinement and snapping in layered structures. Structure corners on the cross section perpendicular to layer thickness direction can be automatically identified. Subsequently, mesh is snapped and refined around the corners. Mesh can also be refined and snapped around the bounds along the layer thickness direction.
Corner detection is performed on a 2D plane sitting in the middle of the layer. If the layer is finite along inplane axes, corners outside the bounds are discarded.
This class only takes effect when AutoGrid is applied.
Example(s)
Section titled “Example(s)”layer_spec = LayerRefinementSpec(axis=2, center=(0,0,0), size=(2, 3, 1))Parameters
Section titled “Parameters”size [TracedSize] |
|
Size in x, y, and z directions. |
axis [Axis] |
|
Specifies dimension of the layer normal axis (0,1,2) -> (x,y,z). |
center [TracedCoordinate] = (0.0, 0.0, 0.0) |
|
Center of object in x, y, and z. |
min_steps_along_axis [PositiveFloat | None] = None |
|
If not |
bounds_refinement [GridRefinement | None] = None |
|
If not |
bounds_snapping [Literal['bounds', 'lower', 'upper', 'center'] | None] = 'lower' |
|
If not |
corner_finder [CornerFinderSpec | None] = factory: CornerFinderSpec |
|
Specification for inplane corner detection. Inplane mesh refinement is based on the coordinates of those corners. |
corner_snapping [bool] = True |
|
If |
corner_refinement [GridRefinement | None] = factory: GridRefinement |
|
If not |
refinement_inside_sim_only [bool] = True |
|
If |
gap_meshing_iters [NonNegativeInt] = 1 |
|
Number of recursive iterations for resolving thin gaps. The underlying algorithm detects gaps contained in a single cell and places a snapping plane at the gaps’s centers. |
dl_min_from_gap_width [bool] = True |
|
Take into account autodetected minimal PEC gap width when determining |
interior_disjoint_geometries [bool] = True |
|
If |
Methods
Section titled “Methods”center_axis() |
|
Gets the position of the center of the layer along the layer dimension. |
from_bounds(rmin: Coordinate, rmax: Coordinate, axis: Axis = None, min_steps_along_axis: PositiveFloat = None, bounds_refinement: GridRefinement = None, bounds_snapping: Literal['bounds', 'lower', 'upper', 'center'] = 'lower', corner_finder: CornerFinderSpec = Undefined, corner_snapping: bool = True, corner_refinement: GridRefinement = Undefined, refinement_inside_sim_only: bool = True, gap_meshing_iters: NonNegativeInt = 1, dl_min_from_gap_width: bool = True, **kwargs: Any) |
|
Constructs a |
from_layer_bounds(axis: Axis, bounds: tuple[float, float], min_steps_along_axis: PositiveFloat = None, bounds_refinement: GridRefinement = None, bounds_snapping: Literal['bounds', 'lower', 'upper', 'center'] = 'lower', corner_finder: CornerFinderSpec | None | object = Undefined, corner_snapping: bool = True, corner_refinement: GridRefinement | None | object = Undefined, refinement_inside_sim_only: bool = True, gap_meshing_iters: NonNegativeInt = 1, dl_min_from_gap_width: bool = True, **kwargs: Any) |
|
Constructs a |
from_structures(structures: list[Structure], axis: Axis = None, min_steps_along_axis: PositiveFloat = None, bounds_refinement: GridRefinement = None, bounds_snapping: Literal['bounds', 'lower', 'upper', 'center'] = 'lower', corner_finder: CornerFinderSpec = Undefined, corner_snapping: bool = True, corner_refinement: GridRefinement = Undefined, refinement_inside_sim_only: bool = True, gap_meshing_iters: NonNegativeInt = 1, dl_min_from_gap_width: bool = True, **kwargs: Any) |
|
Constructs a |
generate_override_structures(grid_size_in_vacuum: float, structure_list: list[Structure], sim_bounds: tuple, boundary_type: tuple, cached_corners_and_convexity: CornersAndConvexity | None = None, cached_merged_geos: list[tuple[Any, Shapely]] | None = None) |
|
Generate mesh override structures for mesh refinement. |
generate_snapping_points(structure_list: list[Structure], sim_bounds: tuple, boundary_type: tuple, cached_corners_and_convexity: CornersAndConvexity | None = None, cached_merged_geos: list[tuple[Any, Shapely]] | None = None) |
|
generate snapping points for mesh refinement. |
length_axis() |
|
Gets the thickness of the layer. |
suggested_dl_min(grid_size_in_vacuum: float, structures: list[Structure], sim_bounds: tuple, boundary_type: tuple, cached_merged_geos: list[tuple[Any, Shapely]] | None = None, cached_corners_and_convexity: CornersAndConvexity | None = None) |
|
Suggested lower bound of grid step size for this layer. |