Load vector 3D

Now we compute the load vector for the three-dimensional case. The load vector is related to the integral of the product of the source function and the trial function. Consider the integral 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})
tetf(x,y,z)υdV.\int_{\text{tet}} f(x, y, z) \cdot \upsilon \,dV.
(6.45)

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). To evaluate the integral, the source function f(x,y,z)f(x, y, z) must be interpolated on the tetrahedron by a linear function. Let us represent f(x,y,z)f(x, y, z) in the form f~(x,y,z)\widetilde{f}(x, y, z) =e1= e_1 +e2x+ e_2 \cdot x +e3y+ e_3 \cdot y +e4z+ e_4 \cdot z. The coefficients e1,e2,e3,e4e_1, e_2, e_3, e_4 are determined from the interpolation conditions at the nodes

e1\displaystyle e_1 +e2xi\displaystyle + e_2 \cdot x_i +e3yi\displaystyle + e_3 \cdot y_i +e4zi\displaystyle + e_4 \cdot z_i =fi\displaystyle = f_ie1\displaystyle e_1 +e2xi+1\displaystyle + e_2 \cdot x_{i+1} +e3yi+1\displaystyle + e_3 \cdot y_{i+1} +e4zi+1\displaystyle + e_4 \cdot z_{i+1} =fi+1\displaystyle = f_{i+1}e1\displaystyle e_1 +e2xi+2\displaystyle + e_2 \cdot x_{i+2} +e3yi+2\displaystyle + e_3 \cdot y_{i+2} +e4zi+2\displaystyle + e_4 \cdot z_{i+2} =fi+2\displaystyle = f_{i+2}e1\displaystyle e_1 +e2xi+3\displaystyle + e_2 \cdot x_{i+3} +e3yi+3\displaystyle + e_3 \cdot y_{i+3} +e4zi+3\displaystyle + e_4 \cdot z_{i+3} =fi+3\displaystyle = f_{i+3}
(6.46)

Since the hat functions ϕn\phi_n equal one at their own node and zero at the others, the linear interpolant of the source function, expressed through them, takes the form

f~(x,y,z)\displaystyle \widetilde{f}(x, y, z) =fiϕi\displaystyle = f_i \cdot \phi_i +fi+1ϕi+1\displaystyle + f_{i+1} \cdot \phi_{i+1} +fi+2ϕi+2\displaystyle + f_{i+2} \cdot \phi_{i+2} +fi+3ϕi+3,\displaystyle + f_{i+3} \cdot \phi_{i+3},
(6.47)

where fi,fi+1,fi+2,fi+3f_i, f_{i+1}, f_{i+2}, f_{i+3} are the values of the source function at the vertices of the tetrahedron.

Substitute the interpolated source function and the trial function into (6.45). We take into account (6.30) from the section on hat functions

tetf(x,y,z)υdV\displaystyle \int_{\text{tet}} f(x, y, z) \cdot \upsilon \,dV =tet(nfnϕn)(mqmϕm)dV\displaystyle = \int_{\text{tet}} \left( \sum_{n} f_n \cdot \phi_n \right) \cdot \left( \sum_{m} q_m \cdot \phi_m \right) \,dV =mnqmfntetϕmϕndV,\displaystyle = \sum_{m} \sum_{n} q_m \cdot f_n \cdot \int_{\text{tet}} \phi_m \cdot \phi_n \,dV,

where the indices mm and nn run over the vertices of the tetrahedron {i,i\{i, i +1,i+1, i +2,i+2, i +3}+3\}.

We use the relations (6.31) for the integrals of products of hat functions, derived when computing the damping matrix, where VtetV_{\text{tet}} is the volume of the tetrahedron, which is computed by formula (6.15). After collecting like terms we obtain

tetf(x,y,z)υdV\displaystyle \int_{\text{tet}} f(x, y, z) \cdot \upsilon \,dV =Vtet20[qi(2fi+fi+1+fi+2+fi+3)+qi+1(fi+2fi+1+fi+2+fi+3)+qi+2(fi+fi+1+2fi+2+fi+3)+qi+3(fi+fi+1+fi+2+2fi+3)]\displaystyle = \frac{\displaystyle V_{\text{tet}}}{\displaystyle 20} \cdot \Big[ q_i \cdot (2 \cdot f_i + f_{i+1} + f_{i+2} + f_{i+3}) + q_{i+1} \cdot (f_i + 2 \cdot f_{i+1} + f_{i+2} + f_{i+3}) + q_{i+2} \cdot (f_i + f_{i+1} + 2 \cdot f_{i+2} + f_{i+3}) + q_{i+3} \cdot (f_i + f_{i+1} + f_{i+2} + 2 \cdot f_{i+3}) \Big]

We introduce the notation for the elements of the local load vector of the tetrahedron

ri=Vtet20(2fi+fi+1+fi+2+fi+3)ri+1=Vtet20(fi+2fi+1+fi+2+fi+3)ri+2=Vtet20(fi+fi+1+2fi+2+fi+3)ri+3=Vtet20(fi+fi+1+fi+2+2fi+3)\begin{split} &r_i = \frac{\displaystyle V_{\text{tet}}}{\displaystyle 20} \cdot (2 \cdot f_i + f_{i+1} + f_{i+2} + f_{i+3})\\ &r_{i+1} = \frac{\displaystyle V_{\text{tet}}}{\displaystyle 20} \cdot (f_i + 2 \cdot f_{i+1} + f_{i+2} + f_{i+3})\\ &r_{i+2} = \frac{\displaystyle V_{\text{tet}}}{\displaystyle 20} \cdot (f_i + f_{i+1} + 2 \cdot f_{i+2} + f_{i+3})\\ &r_{i+3} = \frac{\displaystyle V_{\text{tet}}}{\displaystyle 20} \cdot (f_i + f_{i+1} + f_{i+2} + 2 \cdot f_{i+3}) \end{split}
(6.48)

Thus, the local load vector for a three-dimensional tetrahedral element has the form

Rtet=[riri+1ri+2ri+3]=Vtet20[2111121111211112][fifi+1fi+2fi+3].\begin{aligned}\mathbf{R}_{\text{tet}} = \begin{bmatrix} r_i\\ r_{i+1}\\ r_{i+2}\\ r_{i+3} \end{bmatrix} = \frac{\displaystyle V_{\text{tet}}}{\displaystyle 20} \begin{bmatrix} 2 & 1 & 1 & 1\\ 1 & 2 & 1 & 1\\ 1 & 1 & 2 & 1\\ 1 & 1 & 1 & 2 \end{bmatrix} \begin{bmatrix} f_i\\ f_{i+1}\\ f_{i+2}\\ f_{i+3} \end{bmatrix}.\end{aligned}
(6.49)

Note that the resulting load vector coincides with the product of the local damping matrix (6.33) and the vector of nodal source values, that is Rtet\mathbf{R}_{\text{tet}} =Ctetf= \mathbf{C}_{\text{tet}} \cdot \mathbf{f}.

The global load vector R\mathbf{R} is obtained by summing the contributions from all tetrahedral elements of the mesh using the assembly method: the elements of the local vectors are added to the corresponding elements of the global vector according to the global node numbering. The dimension of the global load vector equals NN, where NN is the total number of nodes in the mesh. It is important to note that for interior nodes the contributions from all adjacent tetrahedral elements containing the given node are summed. For boundary nodes the element contributions are assembled in the same way, but the corresponding components of the system may be modified when boundary conditions are imposed.