TENSORTRAN Function
Tensor transformations for tensors represented as lists of arrays.
Usage
u = TENSORTRAN( j, p, q, t )
Input Parameters
j—An n-element list of m-element lists of m-dimensional arrays all of the same dimensions di (i = 0 ... m-1): (j(i))(k) represents an m-variate function which is the ik componant of the Jacobian of a coordinate transformation x(z): Rm Ωz Ωx Rn. Note that Ωx is an m-dimensional surface (region) in Rn, so m n. For computational efficiency, if a componant of the Jacobian is constant then it should be given as a scalar instead of an array; the data structure of j arises naturally for functions represented as lists of arrays (see Jacobian).
p—The number of contravariant (upper) indices of the tensor to be transformed. If m < n and reverse = 1 then p must equal zero.
q—The number of covariant (lower) indices of the tensor to be transformed. If m < n and reverse = 0 then q must equal zero.
t—p+q nested m-element (n-element if reverse = 1) lists of m-dimensional arrays all of the same dimensions as those in j. Each array represents the m-variate function, which is one of the componants of a tensor of type (p, q). The tensor values are specified relative to coordinates z (x if reverse = 1). The simplest examples are rank 0 tensors (scalar functions) of type (0, 0) where t is an m-dimensional array. The next simplest are rank 1 tensors (vector functions) of type (0, 1) or (1, 0) where t is a list of m-dimensional arrays. These are followed by rank 2 tensors (matrix functions) of type (0, 2), (1, 1), or (2, 0) where t is a list of lists of m-dimensional arrays. For rank 3 tensors, t is a triply nested list; for rank 4 tensors, it is quadruply nested; and so forth. For tensors with both covariant and contravariant componants, the lists for covariant componants must be nested inside the lists for contravariant components. For computational efficiency, a constant componant of the tensor should be given as a scalar instead of an array.
Keywords
reverse—If not set or set to 0 then the tensor transformation is in the direction defined by the Jacobian. Otherwise, the transformation is in the opposite direction.
Returned Value
up+q nested n-element (m-element if reverse = 1) lists of m-dimensional arrays all of the same dimensions as those in j. u represents the transformed components of t. (Refer to the input parameter t for a description of the t data structure.)
Discussion
As described above, TENSORTRAN can be used when the data is defined relative to some parametric grid and thus stored as lists of arrays of dimensionality equal to that of the parametric space. This dimensionality condition can be relaxed however, since TENSORTRAN only requires that all arrays have the same dimensions. Thus all tensor componants could equally well be stored as 1-dimensional arrays of uniform length, so TENSORTRAN can still be used even when the data is scattered and lacking grid structure.
Example
For extensive examples, see the file wave/lib/user/examples/tensortran_ex.pro.
See Also