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),(xi+1,yi+1,zi+1),(xi+2,yi+2,zi+2),(xi+3,yi+3,zi+3)(x_i, y_i, z_i), \quad (x_{i+1}, y_{i+1}, z_{i+1}), \quad (x_{i+2}, y_{i+2}, z_{i+2}), \quad (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 +bix\displaystyle + b_i \cdot x +ciy\displaystyle + c_i \cdot y +diz\displaystyle + d_i \cdot zϕi+1(x,y,z)\displaystyle \phi_{i+1}(x, y, z) =ai+1\displaystyle = a_{i+1} +bi+1x\displaystyle + b_{i+1} \cdot x +ci+1y\displaystyle + c_{i+1} \cdot y +di+1z\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+2x\displaystyle + b_{i+2} \cdot x +ci+2y\displaystyle + c_{i+2} \cdot y +di+2z\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+3x\displaystyle + b_{i+3} \cdot x +ci+3y\displaystyle + c_{i+3} \cdot y +di+3z\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} =qibi\displaystyle = q_i \cdot b_i +qi+1bi+1\displaystyle + q_{i+1} \cdot b_{i+1} +qi+2bi+2\displaystyle + q_{i+2} \cdot b_{i+2} +qi+3bi+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} =qici\displaystyle = q_i \cdot c_i +qi+1ci+1\displaystyle + q_{i+1} \cdot c_{i+1} +qi+2ci+2\displaystyle + q_{i+2} \cdot c_{i+2} +qi+3ci+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} =qidi\displaystyle = q_i \cdot d_i +qi+1di+1\displaystyle + q_{i+1} \cdot d_{i+1} +qi+2di+2\displaystyle + q_{i+2} \cdot d_{i+2} +qi+3di+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+(υ(i)(i+3)y)2+(υ(i)(i+3)z)2]dV\displaystyle \int_{\text{tet}} \left[ \left( \frac{\displaystyle \partial \upsilon_{(i)(i+3)}}{\displaystyle \partial x} \right)^2 + \left( \frac{\displaystyle \partial \upsilon_{(i)(i+3)}}{\displaystyle \partial y} \right)^2 + \left( \frac{\displaystyle \partial \upsilon_{(i)(i+3)}}{\displaystyle \partial z} \right)^2 \right] \,dV =Vtet[(qibi+qi+1bi+1+qi+2bi+2+qi+3bi+3)2+(qici+qi+1ci+1+qi+2ci+2+qi+3ci+3)2+(qidi+qi+1di+1+qi+2di+2+qi+3di+3)2],\displaystyle = \quad V_{\text{tet}} \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))2dV\displaystyle \int_{\text{tet}} (\nabla \upsilon_{(i)(i+3)})^2 \,dV =Vtet[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]+2qiqi+1(bibi+1+cici+1+didi+1)+2qiqi+2(bibi+2+cici+2+didi+2)+2qiqi+3(bibi+3+cici+3+didi+3)+2qi+1qi+2(bi+1bi+2+ci+1ci+2+di+1di+2)+2qi+1qi+3(bi+1bi+3+ci+1ci+3+di+1di+3)+2qi+2qi+3(bi+2bi+3+ci+2ci+3+di+2di+3)]\displaystyle = V_{\text{tet}} \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=(1)k+1Δk(x)Δck=(1)k+2Δk(y)Δdk=(1)k+3Δk(z)Δ\begin{split} &b_k = (-1)^{k+1} \cdot \frac{\displaystyle \Delta_k^{(x)}}{\displaystyle \Delta}\\ &c_k = (-1)^{k+2} \cdot \frac{\displaystyle \Delta_k^{(y)}}{\displaystyle \Delta}\\ &d_k = (-1)^{k+3} \cdot \frac{\displaystyle \Delta_k^{(z)}}{\displaystyle \Delta} \end{split}
(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(bmbn+cmcn+dmdn),m,n\displaystyle = V_{\text{tet}} \cdot (b_m \cdot b_n + c_m \cdot c_n + d_m \cdot d_n), \quad 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.