VectorGrid#
- class streamtracer.VectorGrid(
- vectors,
- grid_spacing=None,
- origin_coord=None,
- cyclic=None,
- *,
- grid_coords=None,
Bases:
objectA grid of vectors.
Note
If any of cyclic are
True, then the grid values on each side of the cyclic dimension must match, e.g. ifcyclic=[False, True, False],vectors[:, 0, :, :]must equalvectors[:, -1, :, :].- Parameters:
vectors (array-like) – A (nx, ny, nz, 3) shaped array. The three values at (i, j, k, :) specify the (x, y, z) components of the vector at index (i, j, k).
grid_spacing (array-like, optional) – A (3,) shaped array, that contains the grid spacings in the (x, y, z) directions. If not specified
grid_coordsmust be specified.origin_coord ([
float,float,float], optional) – The coordinate of thevectors[0, 0, 0, :]vector at the corner of the box. Defaults to[0, 0, 0]. This is not used ifgrid_coordsis specified.cyclic ([
bool,bool,bool], optional) – Whether to have cyclic boundary conditions in each of the (x, y, z) directions. Defaults to[False, False, False].grid_coords (list[array], optional) – A list of length 3 storing the (x, y, z) coordinates of the grid. If not specified
grid_spacingmust be specified.
Attributes Summary
The physical coordinates along each axis of the grid.
Boolean describing whether to have cyclic boundary conditions in each of the (x, y, z) directions.
Physical spacing between grid points along each axis.
The physical coordinate corresponding to the index at
(0,0,0).Three-dimensional vector field through which the streamlines will be traced.
Physical coordinates corresponding to grid points in the x-direction.
Physical coordinates corresponding to grid points in the y-direction.
Physical coordinates corresponding to grid points in the z-direction.
Attributes Documentation
- coords#
The physical coordinates along each axis of the grid.
- cyclic#
Boolean describing whether to have cyclic boundary conditions in each of the (x, y, z) directions.
- grid_spacing#
Physical spacing between grid points along each axis.
- origin_coord#
The physical coordinate corresponding to the index at
(0,0,0).
- vectors#
Three-dimensional vector field through which the streamlines will be traced.
- xcoords#
Physical coordinates corresponding to grid points in the x-direction.
- ycoords#
Physical coordinates corresponding to grid points in the y-direction.
- zcoords#
Physical coordinates corresponding to grid points in the z-direction.