Force computation in FEM
证明1
首先,已知
\[ \vec {\mathbf{x}} = \begin{bmatrix} \vec x_1 & \vec x_2 & \vec x_3 \end{bmatrix}\\ D_s = \begin{bmatrix} \vec x_1-\vec x_4 & \vec x_2-\vec x_4 & \vec x_3-\vec x_4 \end{bmatrix}\\ \begin{aligned} &\frac{\partial (D_s)_{kl}}{\partial \vec {\mathbf{x}_{ij}}} e_i\otimes e_j\otimes e_k\otimes e_l\\ &=\frac{\partial \vec {\mathbf{x}}_{kl}}{\partial \vec {\mathbf{x}}_{ij}} e_i\otimes e_j\otimes e_k\otimes e_l\\ &= \delta_{ik}\delta_{jl} e_i\otimes e_j\otimes e_k\otimes e_l \end{aligned} \] 这里把\(\vec {\mathbf{x}}\)后三列写成一个3x3的矩阵。\(D_m^{-1}\)的分量表示为\(d_{mn}\),\(P\)的分量表示为\(P_{rs}\),则能量密度函数\(\Psi\)关于位置\(\vec {\mathbf{x}}\) 的梯度为:
\[ \begin{aligned} \frac{\partial \Psi}{\partial \vec {\mathbf{x}}} &= \frac{\partial F}{\partial \vec {\mathbf{x}}} : \frac{\partial \Psi}{\partial F}\\ &= \frac{\partial F}{\partial \vec {\mathbf{x}}}: P \\ &= (\frac{\partial D_s}{\partial \vec {\mathbf{x}}} D_m^{-1}): P \\ &= (\delta_{ik}\delta_{jl} e_i\otimes e_j\otimes e_k\otimes e_l\cdot (d_{mn} e_m\otimes e_n)): P_{rs} e_r\otimes e_s \\ &= (\delta_{ik}\delta_{jl}\delta_{lm} d_{mn} e_i\otimes e_j\otimes e_k\otimes e_n): P_{rs} e_r\otimes e_s \\ &= (\delta_{ik} d_{jn} e_i\otimes e_j\otimes e_k\otimes e_n): P_{rs} e_r\otimes e_s \\ &= P_{kn} \delta_{ik} d_{jn} e_i\otimes e_j\\ &= P_{in} d_{jn} e_i\otimes e_j\\ &= P D_m^{-T} \end{aligned} \]
证明2
\[ \frac{\partial F}{\partial x} = \frac{\partial D_s}{\partial x}D_m^{-1}\\ \text{vec}(\frac{\partial F}{\partial x}) = (\begin{bmatrix} -1 & -1 & -1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix} Dm^{-1})^T \otimes I_{3\times 3}\\ \]
\[ \begin{aligned} \frac{\partial \Psi}{\partial \vec {\mathbf{x}}} &= \frac{\partial F}{\partial \vec {\mathbf{x}}} : \frac{\partial \Psi}{\partial F}\\ &= \frac{\partial F}{\partial \vec {\mathbf{x}}}: P \\ &= \text{vec}(\frac{\partial F}{\partial \vec {\mathbf{x}}})^T\text{vec}(P) \\ &= (\begin{bmatrix} -1 & -1 & -1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix} Dm^{-1}) \otimes I_{3\times 3}\cdot \text{vec}(P)\\ &= \text{vec}(P (\begin{bmatrix} -1 & -1 & -1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix} Dm^{-1})^{T})\\ &= \text{vec}(P D_m^{-T} \begin{bmatrix} -1 & 1 & 0 & 0 \\ -1 & 0 & 1 & 0 \\ -1 & 0 & 0 & 1 \end{bmatrix})\\ \end{aligned} \]
倒数第二个等式是因为Kronecker积的性质:
给定矩阵\(A,B,X\):
\[ B^T \otimes A \cdot \text{vec}(X) = \text{vec}(AXB) \]
Matlab验证
下面的验证里将\(\vec {\mathbf{x}}\)展开为一个12维的向量。 \[ F=D_s D_m^{-1}\\ D_s = \begin{bmatrix} \vec x_1-\vec x_4 & \vec x_2-\vec x_4 & \vec x_3-\vec x_4 \end{bmatrix}\\ D_m = \begin{bmatrix} \vec x_{10}-\vec x_{40} & \vec x_{20}-\vec x_{40} & \vec x_{30}-\vec x_{40} \end{bmatrix}\\ \vec {\mathbf{x}} = \begin{bmatrix} \vec x_1 \\ \vec x_2 \\ \vec x_3 \\ \vec x_4 \end{bmatrix}\in \mathbb{R}^{12} \]
所以
\[ \frac{\partial F}{\partial \vec {\mathbf{x}}} = \frac{\partial D_s}{\partial \vec {\mathbf{x}}} D_m^{-1} \]
\(\frac{\partial D_s}{\partial \vec {\mathbf{x}}}\)是一个\(12\times 3\times 3\)的张量。
因为\(D_m, P\)都是固定的,所以把他们用符号表示就可以验证了:
1 | syms p11 p12 p13 p21 p22 p23 p31 p32 p33 real |
附录:张量计算的matlab代码
代码由claude.ai生成。
双点积
1 | function C = doubleDotProd(A, B, contractionDims) |
张量点积
1 | function C = tensorDot(A, B, dims) |
Force computation in FEM