tidy3d.FieldGrid#

class tidy3d.FieldGrid#

Holds the grid data for a single field.

Parameters
  • x (Coords) – x,y,z coordinates of the locations of the x-component of a vector field.

  • y (Coords) – x,y,z coordinates of the locations of the y-component of a vector field.

  • z (Coords) – x,y,z coordinates of the locations of the z-component of a vector field.

Example

>>> 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)
>>> field_grid = FieldGrid(x=coords, y=coords, z=coords)

Show JSON schema
{
   "title": "FieldGrid",
   "description": "Holds the grid data for a single field.\n\nParameters\n----------\nx : Coords\n    x,y,z coordinates of the locations of the x-component of a vector field.\ny : Coords\n    x,y,z coordinates of the locations of the y-component of a vector field.\nz : Coords\n    x,y,z coordinates of the locations of the z-component of a vector field.\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 10)\n>>> y = np.linspace(-1, 1, 11)\n>>> z = np.linspace(-1, 1, 12)\n>>> coords = Coords(x=x, y=y, z=z)\n>>> field_grid = FieldGrid(x=coords, y=coords, z=coords)",
   "type": "object",
   "properties": {
      "x": {
         "title": "X Positions",
         "description": "x,y,z coordinates of the locations of the x-component of a vector field.",
         "allOf": [
            {
               "$ref": "#/definitions/Coords"
            }
         ]
      },
      "y": {
         "title": "Y Positions",
         "description": "x,y,z coordinates of the locations of the y-component of a vector field.",
         "allOf": [
            {
               "$ref": "#/definitions/Coords"
            }
         ]
      },
      "z": {
         "title": "Z Positions",
         "description": "x,y,z coordinates of the locations of the z-component of a vector field.",
         "allOf": [
            {
               "$ref": "#/definitions/Coords"
            }
         ]
      },
      "type": {
         "title": "Type",
         "default": "FieldGrid",
         "enum": [
            "FieldGrid"
         ],
         "type": "string"
      }
   },
   "required": [
      "x",
      "y",
      "z"
   ],
   "additionalProperties": false,
   "definitions": {
      "Coords": {
         "title": "Coords",
         "description": "Holds data about a set of x,y,z positions on a grid.\n\nParameters\n----------\nx : Array\n    1-dimensional array of x coordinates.\ny : Array\n    1-dimensional array of y coordinates.\nz : Array\n    1-dimensional array of z coordinates.\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 10)\n>>> y = np.linspace(-1, 1, 11)\n>>> z = np.linspace(-1, 1, 12)\n>>> coords = Coords(x=x, y=y, z=z)",
         "type": "object",
         "properties": {
            "x": {
               "title": "Array Like",
               "description": "Accepts sequence (tuple, list, numpy array) and converts to tuple.",
               "type": "tuple",
               "properties": {},
               "required": []
            },
            "y": {
               "title": "Array Like",
               "description": "Accepts sequence (tuple, list, numpy array) and converts to tuple.",
               "type": "tuple",
               "properties": {},
               "required": []
            },
            "z": {
               "title": "Array Like",
               "description": "Accepts sequence (tuple, list, numpy array) and converts to tuple.",
               "type": "tuple",
               "properties": {},
               "required": []
            },
            "type": {
               "title": "Type",
               "default": "Coords",
               "enum": [
                  "Coords"
               ],
               "type": "string"
            }
         },
         "required": [
            "x",
            "y",
            "z"
         ],
         "additionalProperties": false
      }
   }
}

attribute x: tidy3d.components.grid.grid.Coords [Required]#

x,y,z coordinates of the locations of the x-component of a vector field.

attribute y: tidy3d.components.grid.grid.Coords [Required]#

x,y,z coordinates of the locations of the y-component of a vector field.

attribute z: tidy3d.components.grid.grid.Coords [Required]#

x,y,z coordinates of the locations of the z-component of a vector field.