基本操作
\[\begin{split} \notag
\nabla p = \left[\begin{matrix}
\frac{\partial p}{\partial x} \\
\frac{\partial p}{\partial y} \\
\frac{\partial p}{\partial z}
\end{matrix}
\right],
\nabla \cdot(\nabla p)=\nabla ^2p=\frac{\partial^2p}{\partial x^2}+\frac{\partial^2p}{\partial y^2}+\frac{\partial^2p}{\partial z^2}
\end{split}\]
\[\begin{split} \notag
\mathbf{U} \cdot \mathbf{V} =[u_1, u_2, u_3] \left[\begin{matrix}
v_1 \\
v_2 \\
v_3
\end{matrix}
\right]=u_1v_1+u_2v_2+u_3v_3
\end{split}\]
\[\begin{split} \notag
\mathbf{U} \cdot \boldsymbol{\tau} = \left[\begin{matrix}
u_1\tau_{xx}+u_2\tau_{yx}+u_3\tau_{zx} \\
u_1\tau_{xy}+u_2\tau_{yy}+u_3\tau_{zy} \\
u_1\tau_{xz}+u_2\tau_{yz}+u_3\tau_{zz}
\end{matrix}
\right]
\neq \boldsymbol{\tau}\cdot\mathbf{U}
\end{split}\]
\[\begin{split} \notag
\boldsymbol{\tau}\cdot\mathbf{U} = \left[\begin{matrix}
\tau_{xx}u_1+\tau_{xy}u_2+\tau_{xz}u_3 \\
\tau_{yx}u_1+\tau_{yy}u_2+\tau_{yz}u_3 \\
\tau_{zx}u_1+\tau_{zy}u_2+\tau_{zz}u_3
\end{matrix}
\right]
\neq
\mathbf{U} \cdot \boldsymbol{\tau}
\end{split}\]
\[\begin{split} \notag
\mathbf{U}\mathbf{V}=\mathbf{U}\otimes\mathbf{V}=\left[
\begin{matrix}
u_1 v_1 & u_1 v_2 & u_1 v_3\\
u_2 v_1 & u_2 v_2 & u_2 v_3\\
u_3 v_1 & u_3 v_2 & u_3 v_3
\end{matrix}
\right]
\end{split}\]
\[\begin{split} \notag
\mathbf{U} \times \mathbf{V}=\left[
\begin{matrix}
u_2v_3-u_3v_2\\
u_3v_1-u_1v_3\\
u_1v_2-u_2v_1\\
\end{matrix}
\right]
\end{split}\]
\[ \notag
\nabla \cdot \mathbf{U} = \frac{\partial u_1}{\partial x}+\frac{\partial u_2}{\partial y}+\frac{\partial u_3}{\partial z}
\]
\[\begin{split} \notag
\nabla \mathbf{U} = \left[
\begin{matrix}
\frac{\partial u_1}{\partial x} & \frac{\partial u_2}{\partial x} & \frac{\partial u_3}{\partial x}\\
\frac{\partial u_1}{\partial y} & \frac{\partial u_2}{\partial y} & \frac{\partial u_3}{\partial y} \\
\frac{\partial u_1}{\partial z} & \frac{\partial u_2}{\partial z} & \frac{\partial u_3}{\partial z}\\
\end{matrix}
\right]
\end{split}\]
\[\begin{split} \notag
\nabla \cdot(\nabla \mathbf{U})=
\left[
\begin{matrix}
\frac{\partial}{\partial x}\left(\frac{\partial u_1}{\partial x}\right)+\frac{\partial}{\partial y}\left(\frac{\partial u_1}{\partial y}\right)+\frac{\partial}{\partial z}\left(\frac{\partial u_1}{\partial z}\right)\\
\frac{\partial}{\partial x}\left(\frac{\partial u_2}{\partial x}\right)+\frac{\partial}{\partial y}\left(\frac{\partial u_2}{\partial y}\right)+\frac{\partial}{\partial z}\left(\frac{\partial u_2}{\partial z}\right)\\
\frac{\partial}{\partial x}\left(\frac{\partial u_3}{\partial x}\right)+\frac{\partial}{\partial y}\left(\frac{\partial u_3}{\partial y}\right)+\frac{\partial}{\partial z}\left(\frac{\partial u_3}{\partial z}\right)\\
\end{matrix}
\right]
\end{split}\]
\[ \notag
\nabla \cdot(\nu \nabla \mathbf{U}^T)=\nu\nabla(\nabla\cdot\mathbf{U}) + \nabla\nu\cdot\nabla\mathbf{U}
\]
\[\begin{split} \notag
\nabla\times\mathbf{U}=\left[
\begin{matrix}
\frac{\partial u_3}{\partial y}-\frac{\partial u_2}{\partial z}\\
\frac{\partial u_1}{\partial z}-\frac{\partial u_3}{\partial x}\\
\frac{\partial u_2}{\partial x}-\frac{\partial u_1}{\partial y}\\
\end{matrix}
\right]
\end{split}\]
\[ \notag
\mathbf{U}\cdot\mathbf{V}=\mathbf{V}\cdot\mathbf{U}
\]
\[ \notag
\mathbf{U}\times\mathbf{V}=-\mathbf{V}\times\mathbf{U}
\]
\[ \notag
\mathbf{U}\times\left(\mathbf{V}\times\mathbf{W}\right)\neq\left(\mathbf{U}\times\mathbf{V}\right)\times\mathbf{W}
\]
\[ \notag
\nabla\cdot\left(\nabla\times\mathbf{U}\right)=0
\]
\[ \notag
\nabla\times\nabla\alpha=0
\]
\[ \notag
\nabla (\alpha p)=\alpha\nabla p+p\nabla\alpha
\]
\[ \notag
\nabla \cdot(\alpha \mathbf{U})=\alpha\nabla\cdot \mathbf{U}+\mathbf{U} \cdot \nabla\alpha=\alpha\nabla\cdot\mathbf{U}+\nabla\alpha\cdot\mathbf{U}
\]
\[ \notag
\nabla \times (\alpha \mathbf{U})=\alpha\nabla\times \mathbf{U}+\left(\nabla\alpha\right) \times\mathbf{U}
\]
\[ \notag
\nabla\cdot(\gamma \nabla(\alpha \beta)) =(\nabla\gamma)\cdot(\nabla\alpha\beta)+\gamma\nabla\cdot(\nabla(\alpha\beta))
\]
\[ \notag
\nabla\cdot(\nabla(\alpha \beta)) = \alpha \nabla^2 \beta+2(\nabla \alpha) \cdot(\nabla \beta)+\beta \nabla^2 \alpha
\]
\[ \notag
\nabla\cdot(\nabla(\alpha \mathbf{U})) = \alpha \nabla^2 \mathbf{U}+2(\nabla \alpha) \cdot(\nabla \mathbf{U})+\mathbf{U} \nabla^2 \alpha
\]
\[ \notag
\nabla (\alpha\bfU\cdot\bfV)=\alpha\bfU\cdot\nabla\bfV+\bfV\cdot\nabla\alpha\bfU
\]
\[ \notag
\nabla\alpha\bfU=\alpha\nabla\bfU+\bfU\nabla\alpha
\]
\[ \notag
\nabla\cdot(\mathbf{U} \mathbf{U})=\mathbf{U} \cdot \nabla \mathbf{U}+\mathbf{U} \nabla \cdot \mathbf{U}
\]
\[ \notag
\nabla\cdot(\alpha\boldsymbol{\tau})=\boldsymbol{\tau} \cdot\nabla \alpha + \alpha \nabla \cdot\boldsymbol{\tau}
\]
\[ \notag
\mathrm{tr}\left(\nabla\mathbf{U}\right)\bfI=\mathrm{tr}\left(\nabla\mathbf{U}^{\mathrm{T}}\right)\bfI=\left(\nabla\cdot\mathbf{U}\right)\bfI
\]
\[ \notag
\mathrm{tr}\left(\nabla\mathbf{U}+\nabla\mathbf{U}^{\mathrm{T}}\right)\bfI=2\mathrm{tr}\left(\nabla\mathbf{U}\right)\bfI=2\left(\nabla\cdot\mathbf{U}\right)\bfI
\]
\[ \notag
\nabla\cdot(\nabla\bfU)^T=\nabla(\nabla\cdot\bfU)
\]
\[ \notag
\nabla\cdot((\nabla\cdot\bfU)\bfI)=\nabla(\nabla\cdot\bfU)
\]
\[\begin{split} \notag
\nabla \cdot {\boldsymbol\tau} = \left[\begin{matrix}
\frac{\partial\tau_{xx}}{\partial x}+\frac{\partial\tau_{yx}}{\partial y}+\frac{\partial\tau_{zx}}{\partial z} \\
\frac{\partial\tau_{xy}}{\partial x}+\frac{\partial\tau_{yy}}{\partial y}+\frac{\partial\tau_{zy}}{\partial z} \\
\frac{\partial\tau_{xz}}{\partial x}+\frac{\partial\tau_{yz}}{\partial y}+\frac{\partial\tau_{zz}}{\partial z}
\end{matrix}\right]
\end{split}\]
\[ \notag
{\boldsymbol\tau}:{\boldsymbol\tau}=\tau_{11}\tau_{11}+\tau_{12}\tau_{12}+\tau_{13}\tau_{13}+
\tau_{21}\tau_{21}+\tau_{22}\tau_{22}+\tau_{23}\tau_{23}+
\tau_{31}\tau_{31}+\tau_{32}\tau_{32}+\tau_{33}\tau_{33}
\]
\[ \notag
|{\boldsymbol\tau}|=\sqrt{{\boldsymbol\tau}:{\boldsymbol\tau}}
\]
\[ \notag
|{\boldsymbol\tau}|^2={\boldsymbol\tau}:{\boldsymbol\tau}
\]
\[\begin{split}
\begin{equation}\notag
\begin{split}
|\nabla\nabla\bfU|^2
&=\left(\frac{\p u_i}{\p x_j \p x_k}\right)\left(\frac{\p u_i}{\p x_j \p x_k}\right)=|\nabla\nabla u_1|^2+|\nabla\nabla u_2|^2+|\nabla\nabla u_3|^2
\\\\
&=\left|\begin{matrix}
\frac{\p u_1}{\p x \p x},\frac{\p u_1}{\p x \p y},\frac{\p u_1}{\p x \p z} \\
\frac{\p u_1}{\p y \p x},\frac{\p u_1}{\p y \p y},\frac{\p u_1}{\p y \p z} \\
\frac{\p u_1}{\p z \p x},\frac{\p u_1}{\p z \p y},\frac{\p u_1}{\p z \p z}
\end{matrix}\right|^2
+
\left|\begin{matrix}
\frac{\p u_2}{\p x \p x},\frac{\p u_2}{\p x \p y},\frac{\p u_2}{\p x \p z} \\
\frac{\p u_2}{\p y \p x},\frac{\p u_2}{\p y \p y},\frac{\p u_2}{\p y \p z} \\
\frac{\p u_2}{\p z \p x},\frac{\p u_2}{\p z \p y},\frac{\p u_2}{\p z \p z}
\end{matrix}\right|^2
+
\left|\begin{matrix}
\frac{\p u_3}{\p x \p x},\frac{\p u_3}{\p x \p y},\frac{\p u_3}{\p x \p z} \\
\frac{\p u_3}{\p y \p x},\frac{\p u_3}{\p y \p y},\frac{\p u_3}{\p y \p z} \\
\frac{\p u_3}{\p z \p x},\frac{\p u_3}{\p z \p y},\frac{\p u_3}{\p z \p z}
\end{matrix}\right|^2
\end{split}
\end{equation}
\end{split}\]
代码操作
形变率 \(\mathbf{S}=\)symm(gradU)
\( =\frac{\nabla\bfU+\nabla\bfU^T}{2}\)
剪切应力\(\boldsymbol{\tau} =2\mu \left(\mathbf{S} -\frac{1}{3}\mathrm{tr}\left(\mathbf{S} \right)\mathbf{I}\right)\)
dev(tau)
\(=\boldsymbol{\tau}-\frac{1}{3}\mathrm{tr}\left(\boldsymbol{\tau}\right)\mathbf{I}\)
dev2(tau)
\(=\boldsymbol{\tau}-\frac{2}{3}\mathrm{tr}\left(\boldsymbol{\tau}\right)\mathbf{I}\)
twoSymm(gradU)
\( =\nabla\bfU+\nabla\bfU^T\)
dev(twoSymm(gradU))
\(=\nabla\bfU+\nabla\bfU^T-\frac{1}{3}\mathrm{tr}\left(\nabla\bfU+\nabla\bfU^T\right)\mathbf{I}=\nabla\bfU+\nabla\bfU^T-\frac{2}{3}\left(\nabla\cdot\mathbf{U}\right)\bfI\)
dev(symm(gradU))
\(=\frac{\nabla\bfU+\nabla\bfU^T}{2}-\frac{1}{3}\mathrm{tr}\left(\frac{\nabla\bfU+\nabla\bfU^T}{2}\right)\mathbf{I}=\frac{\nabla\bfU+\nabla\bfU^T}{2}-\frac{1}{3}\left(\nabla\cdot\mathbf{U}\right)\bfI\)
tr(tau)
\( =\tau_{xx}+\tau_{yy}+\tau_{zz}\)
sph(tau)
\(=\frac{1}{3}\left(\tau_{xx}+\tau_{yy}+\tau_{zz}\right)\)
skew(gradU)
\(=\frac{\nabla\bfU-\nabla\bfU^T}{2}\)
magSqrGradGrad(U)
\(=\left|\nabla\nabla\bfU\right|^2\)
det(tau)
\(=|\boldsymbol{\tau}|\)
innerSqr(tau)
\(=\boldsymbol{\tau}\cdot\boldsymbol{\tau}=\left[\begin{matrix}
\tau_{xx}\tau_{xx}+\tau_{xy}\tau_{xy}+\tau_{xz}\tau_{xz},
\tau_{xx}\tau_{xy}+\tau_{xy}\tau_{yy}+\tau_{xz}\tau_{yz},
\tau_{xx}\tau_{xz}+\tau_{xy}\tau_{yz}+\tau_{xz}\tau_{zz}
\\
\tau_{xx}\tau_{xy}+\tau_{xy}\tau_{yy}+\tau_{xz}\tau_{yz},
\tau_{xy}\tau_{xy}+\tau_{yy}\tau_{yy}+\tau_{yz}\tau_{yz},
\tau_{xy}\tau_{xz}+\tau_{yy}\tau_{yz}+\tau_{yz}\tau_{zz}
\\
\tau_{xx}\tau_{xz}+\tau_{xy}\tau_{yz}+\tau_{xz}\tau_{zz},
\tau_{xy}\tau_{xz}+\tau_{yy}\tau_{yz}+\tau_{yz}\tau_{zz},
\tau_{xz}\tau_{xz}+\tau_{yz}\tau_{yz}+\tau_{zz}\tau_{zz}
\end{matrix}\right]\)
cof(tau)
\(=\left[
\begin{matrix}
\tau_{yy}\tau_{zz} - \tau_{zy}\tau_{yz} & \tau_{zx}\tau_{yz} - \tau_{yx}\tau_{zz} & \tau_{yx}\tau_{zy} - \tau_{yy}\tau_{zx}\\
\tau_{xz}\tau_{zy} - \tau_{xy}\tau_{zz} & \tau_{xx}\tau_{zz} - \tau_{xz}\tau_{zx} & \tau_{xy}\tau_{zx} - \tau_{xx}\tau_{zy}\\
\tau_{xy}\tau_{yz} - \tau_{xz}\tau_{yy} & \tau_{yx}\tau_{xz} - \tau_{xx}\tau_{yz} & \tau_{xx}\tau_{yy} - \tau_{yx}\tau_{xy}\\
\end{matrix}
\right]
\)
inv(tau)
\(=\boldsymbol{\tau}^{-1}\)
invariantI(tau)
\( =\mathrm{tr} \left(\boldsymbol{\tau}\right)\)
invariantII(tau)
\(=\tau_{xx}\tau_{yy}+\tau_{yy}\tau_{zz}+
\tau_{xx}\tau_{zz}-\tau_{xy}\tau_{yx}-\tau_{yz}\tau_{zy}-\tau_{xz}\tau_{zx}
\)
invariantIII(tau)
\( =\mathrm{det} \left(\boldsymbol{\tau}\right)\)
tau.T()
\(=\boldsymbol{\tau}^{T}\)
U & V
\(=\bfU\cdot\bfV\)
U ^ V
\(=\bfU \times\bfV\)
U * V
\(=\bfU\bfV\)
tau & tau
\(=\boldsymbol{\tau}\cdot\boldsymbol{\tau}\)
tau && tau
\(=\boldsymbol{\tau} :\boldsymbol{\tau}\)
sign(a)
\(=\mathrm{sgn}(a)\)
log(a)
\(=\mathrm{ln}(a)\)
log10(a)
\(=\mathrm{log}(a)\)