VectorGrid¶
-
class
streamtracer.
VectorGrid
(vectors, grid_spacing, origin_coord=None, cyclic=None)¶ Bases:
object
A grid of vectors.
- Parameters
- vectorsarray
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_spacingarray
A (3,) shaped array, that contains the grid spacings in the (x, y, z) directions.
- origin_coord = [float, float, float], optional
The coordinate of the
vectors[0, 0, 0, :]
vector at the corner of the box. Defaults to[0, 0, 0]
.- cyclic[bool, bool, bool], optional
Whether to have cyclic boundary conditions in each of the (x, y, z) directions. Defaults to
[False, False, False]
.
Notes
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, :, :]
.Attributes Summary
Coordinates of the x grid points.
Coordinates of the x grid points.
Coordinates of the x grid points.
Attributes Documentation
-
cyclic
¶
-
xcoords
¶ Coordinates of the x grid points.
-
ycoords
¶ Coordinates of the x grid points.
-
zcoords
¶ Coordinates of the x grid points.