Package Scientific :: Package Geometry :: Module TensorAnalysis :: Class TensorField
[hide private]
[frames] | no frames]

Class TensorField



Functions.Interpolation.InterpolatingFunction --+
                                                |
                                               TensorField
Known Subclasses:
ScalarField, VectorField

Tensor field of arbitrary rank

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.

Evaluation:

Nested Classes [hide private]

Instance Methods [hide private]
  __add__(self, other)
number __call__(self, *points)
Returns the function value obtained by linear interpolation
InterpolatingFunction or number __getitem__(self, index)
Returns an InterpolatingFunction whose number of variables is reduced, or a number if no variable is left
  __init__(self, rank, axes, values, default=None, check=True)
  __sub__(self, other)
  _checkCompatibility(self, other)
  _reduceAxis(self, variable)
(TensorField, TensorField, TensorField) allDerivatives(self)
Returns all three derivatives (x, y, z) on equal-sized grids
TensorField derivative(self, variable)
Returns the derivative with respect to variable
Scientifc.Geometry.Tensor zero(self)
Returns a tensor of the same rank as the field values with all elements equal to zero

Inherited from Functions.Interpolation.InterpolatingFunction: __abs__, __getattr__, __getslice__, __len__, arccos, arcsin, arctan, cos, cosh, definiteIntegral, exp, fitPolynomial, integral, log, selectInterval, sin, sinh, sqrt, tan, tanh


Method Details [hide private]

__add__(self, other)
(Addition operator)

 

__call__(self, *points)
(Call operator)

 
Returns: number
the function value obtained by linear interpolation
Overrides: Functions.Interpolation.InterpolatingFunction.__call__
(inherited documentation)

__getitem__(self, index)
(Indexing operator)

 
Returns: InterpolatingFunction or number
an InterpolatingFunction whose number of variables is reduced, or a number if no variable is left
Overrides: Functions.Interpolation.InterpolatingFunction.__getitem__
(inherited documentation)

__init__(self, rank, axes, values, default=None, check=True)
(Constructor)

 
Parameters:
  • rank (int) - the tensor rank
  • axes (sequence of Numeric.array of rank 1) - three arrays specifying the axis ticks for the three axes
  • values (Numeric.array of rank+3 dimensions) - an array containing the field values. 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.
  • default (Scientific.Geometry.Tensor or NoneType) - 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.
Raises:
  • ValueError - if the arguments are not consistent
Overrides: Functions.Interpolation.InterpolatingFunction.__init__

__sub__(self, other)
(Subtraction operator)

 

_checkCompatibility(self, other)

 

_reduceAxis(self, variable)

 

allDerivatives(self)

 
Returns: (TensorField, TensorField, TensorField)
all three derivatives (x, y, z) on equal-sized grids

derivative(self, variable)

 
Parameters:
  • variable (int) - 0 for x, 1 for y, 2 for z
Returns: TensorField
the derivative with respect to variable
Overrides: Functions.Interpolation.InterpolatingFunction.derivative

zero(self)

 
Returns: Scientifc.Geometry.Tensor
a tensor of the same rank as the field values with all elements equal to zero