Skip to content

flex_rf.tidy3d.Grid

Type: class Base(s): Tidy3dBaseModel

Contains all information about the spatial positions of the FDTD grid.

x = np.linspace(-1, 1, 10)
y = np.linspace(-1, 1, 11)
z = np.linspace(-1, 1, 12)
coords = Coords(x=x, y=y, z=z)
grid = Grid(boundaries=coords)
centers = grid.centers
sizes = grid.sizes
yee_grid = grid.yee
boundaries [Coords]

x,y,z coordinates of the boundaries between cells, defining the FDTD grid.

centers [Coords]

Return centers of the cells in the Grid.

fine_mesh_info [dict[tuple[str, float], float]]

Return locations where cell sizes are minimal or near-minimal.

info [dict]

Dictionary collecting various properties of the grids.

max_size [float]

Return maximal cells size in all dimensions.

min_size [float]

Return minimal cells size in all dimensions.

num_cells [tuple[int, int, int]]

Return sizes of the cells in the Grid.

sizes [Coords]

Return sizes of the cells in the Grid.

yee [YeeGrid]

Return the YeeGrid defining the yee cell locations for this Grid.

discretize_inds(box: Box, extend: bool = False, relax_precision: bool = False)

Start and stopping indexes for the cells that intersect with a Box.

extended_subspace(axis: Axis, ind_beg: int = 0, ind_end: int = 0, periodic: bool = True)

Pick a subspace of 1D boundaries within range(ind_beg, ind_end). If any indexes lie outside of the grid boundaries array, padding is used based on the boundary conditions. For periodic BCs, the zeroth and last element of the grid boundaries are identified. For other BCs, the zeroth and last element of the boundaries are a reflection plane.

snap_to_box_zero_dim(box: Box)

Snap a grid to an exact box position for dimensions for which the box is size 0. If the box location is outside of the grid, an error is raised.