Solution (source code)

= Solution

Let
$$
\mathbf D=\frac12\left(\nabla\mathbf u+(\nabla\mathbf u)^T\right)
$$
be the <rate-of-strain tensor> and let $\dot{\boldsymbol\gamma}=2\mathbf D$. The invariant magnitude convention that reproduces the ordinary scalar rate in <simple shear flow> is
$$
\boxed{\dot\gamma
=\left(\frac12\dot{\boldsymbol\gamma}:
\dot{\boldsymbol\gamma}\right)^{1/2}
=\left(2\mathbf D:\mathbf D\right)^{1/2}}.
$$
The tensor contraction makes this definition independent of a rigid rotation of coordinates.