{
  "title": "Grid",
  "public_path": "flex_rf.tidy3d.Grid",
  "lookup_path": "tidy3d.Grid",
  "slug": "flex_rf/tidy3d/Grid",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/grid/",
  "object_kind": "class",
  "introduction": "Contains all information about the spatial positions of the FDTD grid.",
  "notes": "",
  "examples": "```python\nx = np.linspace(-1, 1, 10)\ny = np.linspace(-1, 1, 11)\nz = np.linspace(-1, 1, 12)\ncoords = Coords(x=x, y=y, z=z)\ngrid = Grid(boundaries=coords)\ncenters = grid.centers\nsizes = grid.sizes\nyee_grid = grid.yee\n```",
  "references": "",
  "signature": "class Grid(Tidy3dBaseModel)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/grid/grid.py",
    "url": "",
    "lineno": 398,
    "endlineno": 909
  },
  "bases": [
    "Tidy3dBaseModel"
  ],
  "parameter_rows": [
    {
      "name": "boundaries",
      "annotation": "Coords",
      "default": "",
      "description": "x,y,z coordinates of the boundaries between cells, defining the FDTD grid.",
      "origin": "declared"
    },
    {
      "name": "attrs",
      "annotation": "dict",
      "default": "factory: dict",
      "description": "Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, `attrs` are mutable. For example, the following is allowed for setting an `attr` `obj.attrs['foo'] = bar`. Also note that Tidy3D will raise a `TypeError` if `attrs` contain objects that can not be serialized. One can check if `attrs` are serializable by calling `obj.model_dump_json()`.",
      "origin": "inherited"
    }
  ],
  "members": [
    {
      "name": "centers",
      "kind": "attribute",
      "signature": "centers: Coords",
      "description": "Return centers of the cells in the `Grid`."
    },
    {
      "name": "discretize_inds",
      "kind": "function",
      "signature": "discretize_inds(box: Box, extend: bool = False, relax_precision: bool = False)",
      "description": "Start and stopping indexes for the cells that intersect with a `Box`."
    },
    {
      "name": "extended_subspace",
      "kind": "function",
      "signature": "extended_subspace(axis: Axis, ind_beg: int = 0, ind_end: int = 0, periodic: bool = True)",
      "description": "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."
    },
    {
      "name": "fine_mesh_info",
      "kind": "attribute",
      "signature": "fine_mesh_info: dict[tuple[str, float], float]",
      "description": "Return locations where cell sizes are minimal or near-minimal."
    },
    {
      "name": "info",
      "kind": "attribute",
      "signature": "info: dict",
      "description": "Dictionary collecting various properties of the grids."
    },
    {
      "name": "max_size",
      "kind": "attribute",
      "signature": "max_size: float",
      "description": "Return maximal cells size in all dimensions."
    },
    {
      "name": "min_size",
      "kind": "attribute",
      "signature": "min_size: float",
      "description": "Return minimal cells size in all dimensions."
    },
    {
      "name": "num_cells",
      "kind": "attribute",
      "signature": "num_cells: tuple[int, int, int]",
      "description": "Return sizes of the cells in the `Grid`."
    },
    {
      "name": "sizes",
      "kind": "attribute",
      "signature": "sizes: Coords",
      "description": "Return sizes of the cells in the `Grid`."
    },
    {
      "name": "snap_to_box_zero_dim",
      "kind": "function",
      "signature": "snap_to_box_zero_dim(box: Box)",
      "description": "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."
    },
    {
      "name": "yee",
      "kind": "attribute",
      "signature": "yee: YeeGrid",
      "description": "Return the `YeeGrid` defining the yee cell locations for this `Grid`."
    }
  ],
  "group": "flex_rf.tidy3d"
}
