{
  "title": "AutoGrid",
  "public_path": "flex_rf.tidy3d.AutoGrid",
  "lookup_path": "tidy3d.AutoGrid",
  "slug": "flex_rf/tidy3d/AutoGrid",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/autogrid/",
  "object_kind": "class",
  "introduction": "Specification for non-uniform grid along a given dimension.",
  "notes": "**Practical Advice**\n\nRecommended `min_steps_per_wvl` values:\n\n- **10** (default): Quick estimates and sanity checks only.\n- **15-20**: Good accuracy for most simulations. Verify convergence by comparing results\n  at two resolutions.\n- **Higher**: Only if convergence tests show the result hasn't settled. Can be expensive —\n  use judiciously.\n\nEnsure that geometric features (thin slabs, narrow gaps) are covered by at least 2 grid cells.\nFor a typical 220 nm SOI waveguide, fewer than 10 cells in z is often sufficient.",
  "examples": "```python\ngrid_1d = AutoGrid(min_steps_per_wvl=16, max_scale=1.4)\n```",
  "references": "",
  "signature": "class AutoGrid(AbstractAutoGrid)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/grid/grid_spec.py",
    "url": "",
    "lineno": 1010,
    "endlineno": 1120
  },
  "bases": [
    "AbstractAutoGrid"
  ],
  "parameter_rows": [
    {
      "name": "min_steps_per_wvl",
      "annotation": "float",
      "default": "10.0",
      "description": "Minimal number of steps per wavelength in each medium.",
      "origin": "declared"
    },
    {
      "name": "min_steps_per_sim_size",
      "annotation": "float",
      "default": "10.0",
      "description": "Minimal number of steps per longest edge length of simulation domain bounding box. This is useful when the simulation domain size is subwavelength.",
      "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"
    },
    {
      "name": "max_scale",
      "annotation": "float",
      "default": "1.4",
      "description": "Sets the maximum ratio between any two consecutive grid steps.",
      "origin": "inherited"
    },
    {
      "name": "mesher",
      "annotation": "MesherType",
      "default": "factory: GradedMesher",
      "description": "The type of mesher to use to generate the grid automatically.",
      "origin": "inherited"
    },
    {
      "name": "dl_min",
      "annotation": "NonNegativeFloat | None",
      "default": "None",
      "description": "Lower bound of the grid size along this dimension regardless of structures present in the simulation, including override structures with `enforced=True`. It is a soft bound, meaning that the actual minimal grid size might be slightly smaller. If `None` or 0, a heuristic lower bound value will be applied.",
      "origin": "inherited"
    }
  ],
  "members": [
    {
      "name": "estimated_min_dl",
      "kind": "function",
      "signature": "estimated_min_dl(wavelength: float, structure_list: list[Structure], sim_size: tuple[float, 3])",
      "description": "Estimated minimal grid size along the axis. The actual minimal grid size from mesher might be smaller."
    }
  ],
  "group": "flex_rf.tidy3d"
}
