Physics Builder Design > Entering Names and Expressions > Tensor Parser

Tensor Parser
All Expression fields supports tensor variables and operators for tensors. If you, for example, want the cross product between two vectors, simply type
directly in the Expression field. The symbol for the cross product is among the standard mathematical symbols defined by the Unicode standard. The other special symbols used by expressions are the (inner) dot product, A · B, and the nabla operator, A. Press Ctrl+Space to get a list of the supported operations that includes any special characters. The system font must support the special symbols to display them properly; otherwise, the expression might not look correct. It is always possible to copy-paste them from an editor that supports Unicode input or directly from a Unicode character map.
There are also some functions that you can use to perform tensor operations — for example, the transpose of a matrix or the inverse of a matrix.
The following table lists the operator symbols and operations that the tensor parser supports.
or cross(a,b)
or dot(a,b)
a : b
a or gradient(a)
or divergence(a)
or curl(a)
or transpose(a)
Let r = {x,y,z}
f(r.1..n)
becomes f(x,y,z)
g(r.1..2)
becomes g(x,y)
Let M be a matrix that is symmetric, M = {{u*u, u*v, u*w}, {v*u, v*v, v*w}, {w*u, w*v, w*w}}. Symmetry cannot be detected because v*u is different than u*v by string comparison. The symmetric operator forces symmetry: symmetric(M) = {{u*u, u*v, u*w} , {u*v, v*v, v*w} , {u*w, v*w, w*w}}
Let r = {r,phi,z} in 2D axial symmetry
Let r = {r,phi,z} in 2D axial symmetry
(a+b)*2*pi*r in 2D axial symmetry
(a+b)*ie1.detInvT for an infinite element domain
Let T0 be a global parameter set to 300K,
evalConst(k_B_const*T0/e_const) becomes 0.025851997154882865
evalConst(1[µm]) becomes 1e-6 if the base unit is meter.
Let u be a vector-valued dependent variable with components u, v, and w and the coordinate names x, y, and z. Then
The double dot product is a summation over two indices:
Unfortunately, there are two definitions of the double dot product, and the above is referred to the Frobenius inner product or the colon product. The other definition has flipped order for the indices in the second factor
The former definition is used by the tensor parser.
The gradient operator can be suffixed with s, m, g, or M to specify in regard to which coordinate variables (spatial, material, geometry, or mesh frame, respectively) it should take its derivatives. Example .m.u is the gradient of the variable u in the material frame.