A tensor field is described by a tensor at each point of a three-dimensional rectangular grid. The grid spacing may be non-uniform. Tensor fields are implemented as a subclass of InterpolatingFunction from the module Scientific.Functions.Interpolation and thus share all methods defined in that class.
Constructor: TensorField(rank, axes, values, default=None)
a non-negative integer indicating the tensor rank
a sequence of three one-dimensional arrays, each of which specifies one coordinate (x, y, z) of the grid points
an array of rank+3 dimensions. Its first three dimensions correspond to the x, y, z directions and must have lengths compatible with the axis arrays. The remaining dimensions must have length 3.
the value of the field for points outside the grid. A value of None means that an exception will be raised for an attempt to evaluate the field outside the grid. Any other value must a tensor of the correct rank.
Evaluation:
tensorfield(x, y, z) (three coordinates)
tensorfield(coordinates) (any sequence containing three coordinates)
Returns a tensor of the correct rank with zero elements.
Returns the derivative with respect to variable, which must be one of 0, 1, or 2.
Returns all three derivatives (x, y, z).
Constructor: ScalarField(axes, values, default=None)
A subclass of TensorField.
Methods:Returns the gradient (a vector field).
Returns the laplacian (a scalar field).
Constructor: VectorField(axes, values, default=None)
A subclass of TensorField.
Methods:Returns the divergence (a scalar field).
Returns the curl (a vector field).
Returns the strain (a tensor field of rank 2).
Returns all derivative fields: divergence, curl, and strain.
Returns the laplacian (a vector field).
Returns a scalar field corresponding to the length (norm) of the vector field.