Skip to content

Layer-Based Grid Refinement

Layer-based grid refinement targets thin, planar structures such as PCB traces, ground planes, and laminate layers. Use LayerRefinementSpec to refine the grid near metallic corners and edges inside a specified layer.

from flex_rf.tidy3d import GridRefinement, GridSpec, LayerRefinementSpec
layer_refinement = LayerRefinementSpec(
axis=2,
center=(0, 0, 0),
size=(3, 2, 0.1),
min_steps_along_axis=2,
corner_refinement=GridRefinement(dl=100, num_cells=2),
)
grid_spec = GridSpec(
# Other grid settings.
layer_refinement_specs=[layer_refinement],
)

More than one LayerRefinementSpec can be used. Use separate specs for structures on different physical layers.

LayerRefinementSpec can be constructed from explicit layer bounds or from existing structures. The structure-based constructor is useful when the layer position, size, and normal axis should be inferred from geometry.

from flex_rf.tidy3d import LayerRefinementSpec
trace_refinement = LayerRefinementSpec.from_structures(
structures=[my_planar_structure],
min_steps_along_axis=2,
)
SymbolPurpose
LayerRefinementSpecDefines a layer where grid snapping and refinement are applied.
CornerFinderSpecConfigures corner detection on a 2D plane.
GridRefinementDefines local refinement step size and cell count.
GridSpecCollects grid settings for a simulation.
PageWhy open it
RF Material ModelsConfigure metals and dielectrics used in refined layers.
Lumped Ports and ElementsAdd lumped ports and elements to planar RF layouts.