{
  "title": "GridRefinement",
  "public_path": "flex_rf.tidy3d.GridRefinement",
  "lookup_path": "tidy3d.GridRefinement",
  "slug": "flex_rf/tidy3d/GridRefinement",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/gridrefinement/",
  "object_kind": "class",
  "introduction": "Specification for local mesh refinement that defines the grid step size and the number of grid\ncells in the refinement region.",
  "notes": "If both `refinement_factor` and `dl` are defined, the grid step size is upper bounded by the smaller value of the two.\nIf neither is defined, default `refinement_factor=2` is applied.",
  "examples": "```python\ngrid_refine = GridRefinement(refinement_factor = 2, num_cells = 7)\n```",
  "references": "",
  "signature": "class GridRefinement(Tidy3dBaseModel)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/grid/grid_spec.py",
    "url": "",
    "lineno": 1126,
    "endlineno": 1224
  },
  "bases": [
    "Tidy3dBaseModel"
  ],
  "parameter_rows": [
    {
      "name": "refinement_factor",
      "annotation": "PositiveFloat | None",
      "default": "None",
      "description": "Refine grid step size in vacuum by this factor.",
      "origin": "declared"
    },
    {
      "name": "dl",
      "annotation": "PositiveFloat | None",
      "default": "None",
      "description": "Grid step size in the refined region.",
      "origin": "declared"
    },
    {
      "name": "num_cells",
      "annotation": "PositiveInt",
      "default": "3",
      "description": "Number of grid cells in the refinement region.",
      "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": "override_structure",
      "kind": "function",
      "signature": "override_structure(center: CoordinateOptional, grid_size_in_vacuum: float, drop_outside_sim: bool)",
      "description": "Generate override structure for mesh refinement."
    }
  ],
  "group": "flex_rf.tidy3d"
}
