{
  "title": "BoundarySpec",
  "public_path": "flex_rf.tidy3d.BoundarySpec",
  "lookup_path": "tidy3d.BoundarySpec",
  "slug": "flex_rf/tidy3d/BoundarySpec",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/boundaryspec/",
  "object_kind": "class",
  "introduction": "Specifies boundary conditions on each side of the domain and along each dimension.",
  "notes": "This `BoundarySpec` object defines the boundary conditions applied on each of the 6 domain edges,\nand is provided as an input to the simulation.\n\nA `BoundarySpec` consists of three `Boundary` objects, each defining the boundaries on the plus\nand minus side of each dimension. In most cases, one just wants to specify whether there are absorbing\n`PML` layers along any of the `x`, `y`, `z` dimensions. By default, `tidy3d` simulations have\n`PML` boundaries on all sides.\n\nIf we want to explicitly set the boundaries, we can use the `all_sides` method.\nThis can be used to set any type of boundary condition on all sides of the simulation. We can also set\n`PML` on specified sides only by calling the `pml` method, e.g. `BoundarySpec.pml(\nx=False, y=False, z=False)`. This will put `PML` along the dimensions defined as `True`,\nand set periodic boundaries along the other dimensions.\n\n**Practical Advice**\n\nCommon boundary configurations:\n\n- **PML on all sides**: Default for most devices (waveguides, resonators, scatterers).\n- **Periodic in x/y, PML in z**: Infinite planar arrays (gratings, metasurfaces).\n- **Bloch in x/y, PML in z**: Oblique incidence on periodic structures.\n\nUse `pml` as a convenience to set PML along selected dimensions and periodic\nalong the rest.",
  "examples": "",
  "references": "",
  "signature": "class BoundarySpec(Tidy3dBaseModel)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/boundary.py",
    "url": "",
    "lineno": 1367,
    "endlineno": 1573
  },
  "bases": [
    "Tidy3dBaseModel"
  ],
  "parameter_rows": [
    {
      "name": "x",
      "annotation": "Boundary",
      "default": "factory: Boundary",
      "description": "Boundary condition on the plus and minus sides along the x axis. If `None`, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.",
      "origin": "declared"
    },
    {
      "name": "y",
      "annotation": "Boundary",
      "default": "factory: Boundary",
      "description": "Boundary condition on the plus and minus sides along the y axis. If `None`, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.",
      "origin": "declared"
    },
    {
      "name": "z",
      "annotation": "Boundary",
      "default": "factory: Boundary",
      "description": "Boundary condition on the plus and minus sides along the z axis. If `None`, periodic boundaries are applied. Default will change to PML in 2.0 so explicitly setting the boundaries is recommended.",
      "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": "all_sides",
      "kind": "function",
      "signature": "all_sides(boundary: BoundaryEdge)",
      "description": "Set a given boundary condition on all six sides of the domain"
    },
    {
      "name": "dict_to_boundary",
      "kind": "function",
      "signature": "dict_to_boundary(v: Any)",
      "description": "Convert dict representation to Boundary object if needed."
    },
    {
      "name": "flipped_bloch_vecs",
      "kind": "function",
      "signature": "flipped_bloch_vecs()",
      "description": "Return a copy of the instance where all Bloch vectors are multiplied by -1."
    },
    {
      "name": "pec",
      "kind": "function",
      "signature": "pec(x: bool = False, y: bool = False, z: bool = False)",
      "description": "PEC along specified directions"
    },
    {
      "name": "pmc",
      "kind": "function",
      "signature": "pmc(x: bool = False, y: bool = False, z: bool = False)",
      "description": "PMC along specified directions"
    },
    {
      "name": "pml",
      "kind": "function",
      "signature": "pml(x: bool = False, y: bool = False, z: bool = False)",
      "description": "PML along specified directions"
    },
    {
      "name": "to_list",
      "kind": "function",
      "signature": "to_list()",
      "description": "Returns edge-wise boundary conditions along each dimension for internal use."
    }
  ],
  "group": "flex_rf.tidy3d"
}
