Stiffness matrix 3D

Let us proceed to computing the stiffness matrix for the three-dimensional case. In three-dimensional space the gradient has the form ∇υ\nabla \upsilon​=(∂υ∂x,∂υ∂y,∂υ∂z){} = \left( \frac{\displaystyle \partial \upsilon}{\displaystyle \partial x}, \frac{\displaystyle \partial \upsilon}{\displaystyle \partial y}, \frac{\displaystyle \partial \upsilon}{\displaystyle \partial z} \right), and the dot product of the gradient with itself is ∇υ⋅∇υ\nabla \upsilon \cdot \nabla \upsilon​=(∂υ∂x)2{} = \left( \frac{\displaystyle \partial \upsilon}{\displaystyle \partial x} \right)^2​+(∂υ∂y)2{} + \left( \frac{\displaystyle \partial \upsilon}{\displaystyle \partial y} \right)^2​+(∂υ∂z)2{} + \left( \frac{\displaystyle \partial \upsilon}{\displaystyle \partial z} \right)^2. Since the three-dimensional computational domain MM is partitioned into tetrahedral simplices, the part of the functional under study for a single tetrahedron with vertices

(xi,yi,zi),\displaystyle (x_i, y_i, z_i),​(xi+1,yi+1,zi+1),\displaystyle (x_{i+1}, y_{i+1}, z_{i+1}),​(xi+2,yi+2,zi+2),\displaystyle (x_{i+2}, y_{i+2}, z_{i+2}),​(xi+3,yi+3,zi+3)\displaystyle (x_{i+3}, y_{i+3}, z_{i+3})

can be written as

∫tet[(∂υ∂x)2+(∂υ∂y)2+(∂υ∂z)2] dV.\int_{\text{tet}} \left[ \left( \frac{\displaystyle \partial \upsilon}{\displaystyle \partial x} \right)^2 + \left( \frac{\displaystyle \partial \upsilon}{\displaystyle \partial y} \right)^2 + \left( \frac{\displaystyle \partial \upsilon}{\displaystyle \partial z} \right)^2 \right] \,dV.
(6.12)

The function υ(x,y,z)\upsilon(x, y, z)​=∑i=1Nυi(x,y,z){} = \sum_{i=1}^N \upsilon_i(x, y, z). The trial function on the tetrahedron has the form υ(i)(i+3)(x,y,z)\upsilon_{(i)(i+3)}(x, y, z)​=qi⋅ϕi(x,y,z){} = q_i \cdot \phi_i(x, y, z)​+qi+1⋅ϕi+1(x,y,z){} + q_{i+1} \cdot \phi_{i+1}(x, y, z)​+qi+2⋅ϕi+2(x,y,z){} + q_{i+2} \cdot \phi_{i+2}(x, y, z)​+qi+3⋅ϕi+3(x,y,z){} + q_{i+3} \cdot \phi_{i+3}(x, y, z). Analogously to the two-dimensional case, the hat functions for the tetrahedron are linear

ϕi(x,y,z)\displaystyle \phi_i(x, y, z) =ai\displaystyle {} = a_i​+bi⋅x\displaystyle {} + b_i \cdot x​+ci⋅y\displaystyle {} + c_i \cdot y​+di⋅z\displaystyle {} + d_i \cdot zϕi+1(x,y,z)\displaystyle \phi_{i+1}(x, y, z) =ai+1\displaystyle {} = a_{i+1}​+bi+1⋅x\displaystyle {} + b_{i+1} \cdot x​+ci+1⋅y\displaystyle {} + c_{i+1} \cdot y​+di+1⋅z\displaystyle {} + d_{i+1} \cdot zϕi+2(x,y,z)\displaystyle \phi_{i+2}(x, y, z) =ai+2\displaystyle {} = a_{i+2}​+bi+2⋅x\displaystyle {} + b_{i+2} \cdot x​+ci+2⋅y\displaystyle {} + c_{i+2} \cdot y​+di+2⋅z\displaystyle {} + d_{i+2} \cdot zϕi+3(x,y,z)\displaystyle \phi_{i+3}(x, y, z) =ai+3\displaystyle {} = a_{i+3}​+bi+3⋅x\displaystyle {} + b_{i+3} \cdot x​+ci+3⋅y\displaystyle {} + c_{i+3} \cdot y​+di+3⋅z\displaystyle {} + d_{i+3} \cdot z
(6.13)

Let us compute the partial derivatives of the trial function

∂υ(i)(i+3)(x,y,z)∂x\displaystyle \frac{\displaystyle \partial \upsilon_{(i)(i+3)}(x, y, z)}{\displaystyle \partial x} =qi⋅bi\displaystyle {} = q_i \cdot b_i​+qi+1⋅bi+1\displaystyle {} + q_{i+1} \cdot b_{i+1}​+qi+2⋅bi+2\displaystyle {} + q_{i+2} \cdot b_{i+2}​+qi+3⋅bi+3\displaystyle {} + q_{i+3} \cdot b_{i+3}∂υ(i)(i+3)(x,y,z)∂y\displaystyle \frac{\displaystyle \partial \upsilon_{(i)(i+3)}(x, y, z)}{\displaystyle \partial y} =qi⋅ci\displaystyle {} = q_i \cdot c_i​+qi+1⋅ci+1\displaystyle {} + q_{i+1} \cdot c_{i+1}​+qi+2⋅ci+2\displaystyle {} + q_{i+2} \cdot c_{i+2}​+qi+3⋅ci+3\displaystyle {} + q_{i+3} \cdot c_{i+3}∂υ(i)(i+3)(x,y,z)∂z\displaystyle \frac{\displaystyle \partial \upsilon_{(i)(i+3)}(x, y, z)}{\displaystyle \partial z} =qi⋅di\displaystyle {} = q_i \cdot d_i​+qi+1⋅di+1\displaystyle {} + q_{i+1} \cdot d_{i+1}​+qi+2⋅di+2\displaystyle {} + q_{i+2} \cdot d_{i+2}​+qi+3⋅di+3\displaystyle {} + q_{i+3} \cdot d_{i+3}
(6.14)

Note that the derivatives do not depend on xx, yy and zz and are constants over the tetrahedron. Substituting (6.14) into (6.12)

∫tet[(∂υ(i)(i+3)∂x)2\displaystyle \int_{\text{tet}} \biggl[ \left( \frac{\displaystyle \partial \upsilon_{(i)(i+3)}}{\displaystyle \partial x} \right)^2​+(∂υ(i)(i+3)∂y)2\displaystyle {} + \left( \frac{\displaystyle \partial \upsilon_{(i)(i+3)}}{\displaystyle \partial y} \right)^2​+(∂υ(i)(i+3)∂z)2] dV\displaystyle {} + \left( \frac{\displaystyle \partial \upsilon_{(i)(i+3)}}{\displaystyle \partial z} \right)^2 \biggr] \,dV​=Vtet\displaystyle {} = \quad V_{\text{tet}}​⋅[(qi⋅bi+qi+1⋅bi+1+qi+2⋅bi+2+qi+3⋅bi+3)2+(qi⋅ci+qi+1⋅ci+1+qi+2⋅ci+2+qi+3⋅ci+3)2+(qi⋅di+qi+1⋅di+1+qi+2⋅di+2+qi+3⋅di+3)2],\displaystyle {} \cdot \Big[ (q_i \cdot b_i + q_{i+1} \cdot b_{i+1} + q_{i+2} \cdot b_{i+2} + q_{i+3} \cdot b_{i+3})^2 \quad + (q_i \cdot c_i + q_{i+1} \cdot c_{i+1} + q_{i+2} \cdot c_{i+2} + q_{i+3} \cdot c_{i+3})^2 \quad + (q_i \cdot d_i + q_{i+1} \cdot d_{i+1} + q_{i+2} \cdot d_{i+2} + q_{i+3} \cdot d_{i+3})^2 \Big],

where VtetV_{\text{tet}} is the volume of the tetrahedron, which is computed by the formula

Vtet\displaystyle V_{\text{tet}} =∣Δ∣6,\displaystyle {} = \frac{\displaystyle |\Delta|}{\displaystyle 6},
(6.15)

where Δ\Delta is the determinant of the matrix

Δ\displaystyle \Delta =∣xiyizi1xi+1yi+1zi+11xi+2yi+2zi+21xi+3yi+3zi+31∣.\displaystyle {} = \begin{vmatrix} x_i & y_i & z_i & 1\\ x_{i+1} & y_{i+1} & z_{i+1} & 1\\ x_{i+2} & y_{i+2} & z_{i+2} & 1\\ x_{i+3} & y_{i+3} & z_{i+3} & 1 \end{vmatrix}.
(6.16)

Let us expand the squares and regroup the terms

∫tet(∇υ(i)(i+3))2 dV\displaystyle \int_{\text{tet}} (\nabla \upsilon_{(i)(i+3)})^2 \,dV =Vtet\displaystyle {} = V_{\text{tet}}​⋅[qi2⋅[bi2+ci2+di2]+qi+12⋅[bi+12+ci+12+di+12]+qi+22⋅[bi+22+ci+22+di+22]+qi+32⋅[bi+32+ci+32+di+32]+2⋅qi⋅qi+1⋅(bi⋅bi+1+ci⋅ci+1+di⋅di+1)+2⋅qi⋅qi+2⋅(bi⋅bi+2+ci⋅ci+2+di⋅di+2)+2⋅qi⋅qi+3⋅(bi⋅bi+3+ci⋅ci+3+di⋅di+3)+2⋅qi+1⋅qi+2⋅(bi+1⋅bi+2+ci+1⋅ci+2+di+1⋅di+2)+2⋅qi+1⋅qi+3⋅(bi+1⋅bi+3+ci+1⋅ci+3+di+1⋅di+3)+2⋅qi+2⋅qi+3⋅(bi+2⋅bi+3+ci+2⋅ci+3+di+2⋅di+3)]\displaystyle {} \cdot \Big[ q_i^2 \cdot [b_i^2 + c_i^2 + d_i^2] + q_{i+1}^2 \cdot [b_{i+1}^2 + c_{i+1}^2 + d_{i+1}^2] + q_{i+2}^2 \cdot [b_{i+2}^2 + c_{i+2}^2 + d_{i+2}^2] + q_{i+3}^2 \cdot [b_{i+3}^2 + c_{i+3}^2 + d_{i+3}^2] + 2 \cdot q_i \cdot q_{i+1} \cdot (b_i \cdot b_{i+1} + c_i \cdot c_{i+1} + d_i \cdot d_{i+1}) + 2 \cdot q_i \cdot q_{i+2} \cdot (b_i \cdot b_{i+2} + c_i \cdot c_{i+2} + d_i \cdot d_{i+2}) + 2 \cdot q_i \cdot q_{i+3} \cdot (b_i \cdot b_{i+3} + c_i \cdot c_{i+3} + d_i \cdot d_{i+3}) + 2 \cdot q_{i+1} \cdot q_{i+2} \cdot (b_{i+1} \cdot b_{i+2} + c_{i+1} \cdot c_{i+2} + d_{i+1} \cdot d_{i+2}) + 2 \cdot q_{i+1} \cdot q_{i+3} \cdot (b_{i+1} \cdot b_{i+3} + c_{i+1} \cdot c_{i+3} + d_{i+1} \cdot d_{i+3}) + 2 \cdot q_{i+2} \cdot q_{i+3} \cdot (b_{i+2} \cdot b_{i+3} + c_{i+2} \cdot c_{i+3} + d_{i+2} \cdot d_{i+3}) \Big]

The coefficients bkb_k, ckc_k and dkd_k for each vertex kk of the tetrahedron are computed through the minors of the determinant Δ\Delta. For the vertex with index kk the coefficients have the form

bk\displaystyle b_k =(−1)k+1⋅Δk(x)Δ\displaystyle {} = (-1)^{k+1} \cdot \frac{\displaystyle \Delta_k^{(x)}}{\displaystyle \Delta}ck\displaystyle c_k =(−1)k+2⋅Δk(y)Δ\displaystyle {} = (-1)^{k+2} \cdot \frac{\displaystyle \Delta_k^{(y)}}{\displaystyle \Delta}dk\displaystyle d_k =(−1)k+3⋅Δk(z)Δ\displaystyle {} = (-1)^{k+3} \cdot \frac{\displaystyle \Delta_k^{(z)}}{\displaystyle \Delta}
(6.17)

where Δk(x)\Delta_k^{(x)}, Δk(y)\Delta_k^{(y)} and Δk(z)\Delta_k^{(z)} are the minors obtained by deleting the kk-th row and the corresponding column (xx, yy or zz) from the matrix (6.16).

We introduce the notation for the elements of the local stiffness matrix of the tetrahedron

kmn\displaystyle k_{mn} =Vtet\displaystyle {} = V_{\text{tet}}​⋅(bm⋅bn+cm⋅cn+dm⋅dn),\displaystyle {} \cdot (b_m \cdot b_n + c_m \cdot c_n + d_m \cdot d_n),​m,n\displaystyle m, n​∈{i,i\displaystyle {} \in \{i, i​+1,i\displaystyle {} +1, i​+2,i\displaystyle {} +2, i​+3}.\displaystyle {} +3\}.
(6.18)

Thus, the local stiffness matrix for a tetrahedral element has the form

Ktet\displaystyle \mathbf{K}_{\text{tet}} =[k(i)(i)k(i)(i+1)k(i)(i+2)k(i)(i+3)k(i+1)(i)k(i+1)(i+1)k(i+1)(i+2)k(i+1)(i+3)k(i+2)(i)k(i+2)(i+1)k(i+2)(i+2)k(i+2)(i+3)k(i+3)(i)k(i+3)(i+1)k(i+3)(i+2)k(i+3)(i+3)].\displaystyle {} = \begin{bmatrix} k_{(i)(i)} & k_{(i)(i+1)} & k_{(i)(i+2)} & k_{(i)(i+3)}\\ k_{(i+1)(i)} & k_{(i+1)(i+1)} & k_{(i+1)(i+2)} & k_{(i+1)(i+3)}\\ k_{(i+2)(i)} & k_{(i+2)(i+1)} & k_{(i+2)(i+2)} & k_{(i+2)(i+3)}\\ k_{(i+3)(i)} & k_{(i+3)(i+1)} & k_{(i+3)(i+2)} & k_{(i+3)(i+3)} \end{bmatrix}.
(6.19)

The local stiffness matrix is symmetric, that is kmnlock_{mn}^{\text{loc}}​=knmloc{} = k_{nm}^{\text{loc}}. The global stiffness matrix K\mathbf{K} is obtained by summing the contributions from all tetrahedral elements of the mesh by the assembly method: the elements of the local matrices are added to the corresponding elements of the global matrix according to the global node numbering. The dimension of the global stiffness matrix is N×NN \times N, where NN is the total number of mesh nodes.