Transformation Between Coordinate Systems
All spatial vectors and matrices can transform as tensors, when an operation involves two such objects defined in different coordinate systems.
Consider the example of the normal component of a flux,
where D is the flux vector. Using the Einstein summation convention,
where subscripts indicate covariant indices and superscripts indicate contravariant indices. The type of index determines how the components of a tensor transform between different coordinate systems. A non-orthonormal coordinate system has, among other, two sets of basis vectors known as the covariant and contravariant bases. Covariant tensor components refer to the contravariant basis vectors and contravariant tensor components refer to the covariant base vectors. For all orthonormal systems, these two sets of basis vectors, and these two sets of components, are identical. Now assume that Di is given in a different coordinate system than ni. To compute q properly, Di first has to be transformed as a contravariant (first order) tensor
where xi is the i:th coordinate in the desired system, and ui is the i:th coordinate in the original system. To separate tensor indices in different systems, they also include the coordinate name. If the tensor instead was covariant originally, the transformation would become
These transformations are used whenever there exists several systems in an expression or variable assignment. The most common example is when you use an input coordinate system for your user inputs that differs from the base vector system in which the variables are stored. A material tensor from the material library can, for example, undergo a rotation to align its z-axis with the y-axis of the system where the tensor variables that are used in the model are defined.
Another situation when a variable might undergo an automatic conversion is if you try to perform a scalar dot product between two tensors of the same type — for example, two covariant tensors. The expression parser then performs a raise-index operation on Dj before taking the dot product
This is essentially a multiplication with the contravariant metric tensor, gij. The metric tensor is the identity matrix for all orthonormal systems, where the covariant and contravariant components are identical.
Reference
1. G. B. Arfken, H. J. Weber, Mathematical Methods for Physicists, Academic Press, 1995.