To enable numerical evaluation of the integrals in the weak form, the first step is to discretize the smooth vector fields x and Q. This allows them to be represented by a finite set of samples, along with appropriate interpolation functions.
Example 17.1.1 (1D Function Interpolation).
In 1D, to approximate a function f(x) using three sample points x1=1, x2=2, x3=3 (Figure 17.1.1), we can use interpolation functions Ni(x)=1−∣x−xi∣ and form f(x)≈∑if(xi)Ni(x).
Figure 17.1.1. With interpolation functions N1(x), N2(x), N3(x) and sample points x1=1, x2=2, x3=3, a function f(x) can be approximated as ∑if(xi)Ni(x).
Given a set of sample points indexed by a or b in the simulation domain, we can approximate the test function Q and the DOF x as:
Qi(X,tn)xi(X,tn)≈a∑Qa∣i(tn)Na(X)=a∑Qa∣inNa(X),≈b∑xb∣i(tn)Nb(X)=b∑xb∣inNb(X),
where Qa∣in=Qa∣i(tn) refers to the i-th dimension of Q evaluated at sample point a at time tn, and Na(X):Ω0→R is the interpolation function at sample point a. In this way, we similarly have:
Ai(X,tn)≈b∑Ab∣i(tn)Nb(X)=b∑Ab∣inNb(X).(17.1.1)
Plugging these discretizations into the weak form (Equation (17.1)) and expressing summations with the index notation, we obtain:
∫Ω0R(X,0)Qa∣inNa(X)Ab∣inNb(X)dX=∫∂Ω0Qa∣inNa(X)Ti(X,tn)ds(X)−∫Ω0Qa∣inNa,j(X)Pij(X,tn)dX.
On the left-hand side, we see that the sample values Qa∣in and Ab∣in are in fact independent of X, so we can move them out of the integral and obtain:
MabQa∣inAb∣in=∫∂Ω0Qa∣inNa(X)Ti(X,tn)ds(X)−∫Ω0Qa∣inNa,j(X)Pij(X,tn)dX
where
Mab=∫Ω0R(X,0)Na(X)Nb(X)dX(17.1.2)
is the mass matrix.
Remark 17.1.1 (Mass Matrix Properties).
The mass matrix M (Equation (17.1.2)) is symmetric and positive semi-definite because it can be expressed as:
∫Ω0BBTdX,
where Bi=R(X,0)Ni(X). Thus, for any vector z,
zTMz=∫Ω0(zTB)2dX≥0.
In practice, this mass matrix may be singular. To address this, we typically use a "mass lumping" strategy to approximate the mass matrix with a diagonal and positive definite form. This is achieved by summing each row and defining:
Mablump=δabc∑Mac.
After spatial discretization, the solution of the weak form (Equation (17.1)) is confined to dn-dimensional function spaces, where n represents the number of sample points, assuming all interpolation functions are mutually orthogonal. This means that there could be continuous solutions to the weak form outside of our solution space. In such cases, we can only provide an approximate solution based on the chosen sample points and interpolation functions.
Definition 17.1.1 (Orthogonal Functions).
Similar to the orthogonality of two vectors a and b, defined as aTb=0, the orthogonality of two functions f(x) and g(x) is defined as:
∫f(x)g(x)dx=0.
Just as a basis of vectors can span a finite-dimensional space, orthogonal functions can form an infinite basis for a function space. Conceptually, the integral above is analogous to a vector dot product.
That being said, to generate equations solvable for the unknowns, the arbitrary test function Q does not need to cover all possibilities to produce an infinite number of equations. Instead, we only need to produce a finite set of equations that spans the entire solution space. Therefore, for a^ traversing all sample points, and i^=1,2,…,d, we can assign the test function:
Qa∣in={1,0,a=a^ and i=i^otherwise
to obtain nd equations:
Ma^bAb∣i^n=∫∂Ω0Na^(X)Ti^(X,tn)ds(X)−∫Ω0Na^,j(X)Pi^j(X,tn)dX,(17.1.3)
resulting in nd unknowns and nd equations, bringing us closer to the discrete form.
The two integrals on the right side of Equation (17.1.3) can be evaluated analytically or using quadrature rules, depending on the specific choice of interpolation functions. We will discuss these in detail in future lectures.