Lecture 30: Irregular Sparsity

1.Finite element discretization

For the steady-state heat equation -(αu)=f with spatially-varying diffusivity, symmetric discretizations on uniform grids lead to systems 𝑨𝒖=𝒄 with 𝑨=𝑨T, and a regular sparsity pattern. Irregular domain discretization will lead to more complicated sparsity patterns that require different approaches to solving the linear system. It is important to link the changes in the structure of 𝑨 to specific aspects of the approximation procedure. Consider the difficulties of applying finite difference discretization on a domain Ω of arbitrary shape with boundary Γ=Ω (Fig. 1). At grid node (i,j) closer to the boundary than the uniform spacing h, centered finite difference formulas would refer to undefined values outside the domain. One-sided finite difference formulas would fail to take into account boundary values for the problem. Taylor series expansions could be used,

uA=u(ξh,jh)=ui,j+(ux)i,j(ξh)+12(2ux2)i,j(ξh)2+
ui+1,j=ui,j+(ux)i,jh+12(2ux2)i,jh2+

from which elimination of the second derivative leads to an approximation of the first derivative as

(ux)i,j=uA-ξ2ui+1,j-(1-ξ2)ui,jξh(1-ξ). (1)

Note that setting ξ=-1 would place A at a grid node, uA=ui-1,j and from (1) the familiar centered finite difference approximation of the first derivative

(ux)i,j=ui+1,j-ui-1,j2h,

is recovered. For an arbitrary domain the values of ξ,η would vary and the resulting linear system 𝑨𝒖=𝒄 would no longer be symmetric. From a physical perspective this might be surprising at first since the operator =-(α) is isotropic, but this is true for an inifinitesimal domain. Upon irregular discretization the problem 𝑨𝒖=𝒄 is only an approximation of the physical problem u=f, and can exhibit different behavior, in this case loss of isotropy near the boundaries.

Figure 1. Left: Modified finite difference stencil near a boundary not aligned with the grid. Boundary points A,B are distances ξh, ηh from the nearest interior node, with ξ,η(-1,1). Right: Triangles covering the domain.

Computing the appropriate mesh size fractions (ξh,ηh) for all grid points near a boundary is an onerous task, and suggests seeking a different approach. A frutiful idea is to separate the problem of geometric description from that of physics expressed by some operator . Domains within d of arbitrary complexity can be approximated to any desired precision by a simplicial covering. Simplicia are the simplest geometric objects with non-zero measure μ in a space. For d=1 these are line segments that can approximate arbitrary curves. The corresponding simplicia for d=2 and d=3 are triangles and tetrahedra, respectively. Consider d=2 and specify a set of triangles {Tk|k=1,2,,n.} with vertices Vj, j=1,,m, that form a partition of precision ε0 of the domain Ω,

k,l{1,2,,n},μ(TkTl)=0,|μ(k=1nTk)-μ(Ω)|ε.

The above state that intersections of triangles must have zero measure in d=2, i.e., triangles can share edges or vertices but cannot overlap over a non-zero area. The area of the union of triangles approximates the area of the overall domain Ω.

Figure 2. Left: Triangulation of a domain with a hole. Right: Triangle form function

In a finite difference discretization the function u:Ω is approximated by a set of values {ui,j}, often referred to as a grid function. Similarly, a set of values uju(xj,yj) can be defined at the triangle vertices Vj(xj,yj). Denote the vertex coordinates of triangle T by (xj,yj), j=1,2,3. Values of u(x,y) within the triangle T are determined through piecewise interpolation, a generalization of one-dimensional B-splines, using the form functions

N1(x,y)=12A| 1 1 1 x x2 x3 y y2 y3 |,N2(x,y)=12A| 1 1 1 x1 x x3 y1 y y3 |,N3(x,y)=12A| 1 1 1 x1 x2 x y1 y2 y |,

with A the triangle area

A=12| 1 1 1 x1 x2 x3 y1 y2 y3 |.

Note that for (x,y)T the form functions give the fraction of the overall area occupied by the interior triangles such that Nj(x,y)[0,1]. The linear spline interpolation p1 of u based upon the vertex values u1,u2,u3 is

u(x,y)p1(x,y)=j=13ujNj(x,y), (2)

the familiar form of a linear combination. It is customary to set Nj(x,y)=0 if (x,y)T, recovering the framework of B-splines. Since u(x,y) thus approximated is non-zero only over the single triangle T, such an approach is commonly referred to as a finite element method (FEM).

Various approaches can be applied to derive an algebraic system for the vertex values from the conservation law of interest. Consider the operator =-(α) and the static equilibrium equation u=f in Ω with Dirichlet boundary conditions u=g on Γ=Ω. When u denotes temperature, this is a statement of thermal equilibrium where heat fluxes q=-αu balance out external heating f and imposed temperature values on the boundary. One commonly used approach closely resembles the least squares approximation of 𝒃n,

min𝒙n||𝒃-𝑨𝒙||.

The approximant 𝒃 of 𝒃 in this case is its projection onto C(𝑨), 𝒃=𝑸𝑸T𝒃, with 𝑨=𝑸𝑹 the (incomplete) QR decomposition of 𝑨. The error of this approximation is 𝒆=𝒃-𝒃N(𝑨T) is orthogonal to C(𝑨)

𝑸T𝒆=𝑸T(𝑸𝑸T𝒃-𝒃)=𝟎. (3)

The generalization of (3) in which the finite-dimensional vector 𝒃n is replaced by the function uC(2)(Ω) that satisfies u=f is

(Ni,j=13ujNj(x,y)-f)=0,i=1,2,3, (4)

for each triangle Tk with (u,v) denoting the scalar product

(u,v)=Ωu(x,y)v(x,y)dω.

The analogy can be understood by recognizing that finite element approximants lie within the span of the form functions {Nik} for all triangles Tk and their vertices j=1,2,3. This known as a Galerkin method with (4) expressing orthogonality of the error e=u-f and all form functions {Nik}, leading to

(Ni,j=13ujNj(x,y)-f)=0j=13(TNi(x,y)Nj(x,y)dω)uj=TNi(x,y)f(x,y)dω.

The null result of applying the second-order differential operator =-(α) onto a linear form function Nj is avoided through integration by parts (divergence theorem

TkNi(x,y)Nj(x,y)dω=-TkNi(x,y)[(α)Nj(x,y)]dω=Tkα[Ni(x,y)][Nj(x,y)]dω=aij(k).

Assembling contributions from all triangles Tk results in a linear system 𝑨𝒖=𝒄, expressing an approximation of the steady-state heat equation u=f.

It is illuminating to note that though the physical process itself is isotropic, the FEM approximation typically leads to a non-symmetric system matrix 𝑨 due to the different sizes of the triangularization elements. The fact that the approximation depends on the domain discretization is not surprising; this also occurred for finite difference approximations as evidenced by the eigenvalue dependency on grid spacing h, e.g., vl=4sin2(lπh/2). The particularity of FEM discretization is that the single parameter h has been replaced by the individual geometry of all triangles within the domain partition. It is to be expected that the resulting matrices will exhibit condition numbers that are monotonic with respect to maxkμ(Tk)/minkμ(Tk), the ratio of the area of the largest triangle area to the smallest. This is readily understood: when minkμ(Tk)0 the spanning set {Nik} becomes linearly dependent since one of its members approaches the zero element. The same effect is obtained if the aspect ratio of a triangle becomes large (i.e., one of its angles is close to zero), since again the spanning set is close to linearly dependent. A finite element system matrix 𝑨 will still exhibit sparsity since the form functions are non-zero on only one triangle. The sparsity pattern is however determined by the connectivity, i.e., the number of triangles at each shared vertex. A typical sparsity matrix is shown in Fig. 3. If the physical principle of action and reaction (Newton's third law) is respected by discretization the matrix will still be symmetric, a considerable advantage with respect to the use of Taylor series to extend finite difference methods to arbitrary domains.

Figure 3. Non-zero elements with 𝑨m×m, m=3948 of a matrix from the Boeing-Harwell collection.

2.Krylov methods, Arnoldi iteration

From the above general observations it becomes apparent that solution techniques considered up to now are inadequate. Factorization methods such as LU or QR would lead to fill-in and loss of sparsity. Additive splitting is no longer trivially implemented since connectivity has be accounted for other than by simple loops. The already slow convergence rate of methods based upon additive splitting is likely to degrade further or perhaps diverge due to the influence the spatial discretization has upon eigenvalues of the iteration matrix 𝑴=𝑰-𝑩𝑨. Similar considerations apply to gradient descent.

An alternative approach is to seek a suitable basis ={𝒒1,𝒒2,,𝒒m} in which to iteratively construct improved approximations 𝒖k of the solution 𝒖 of the discretized system 𝑨𝒖=𝒄,

𝒖𝒖k=𝑸n𝒙,𝑸=[ 𝒒1 𝒒2 𝒒n ]m×n.

Vectors within the basis set should be economical to compute and also lead to fast convergence in the sense that the coefficient vector 𝒙 should have components that rapidly decrease in absolute value. One idea is to recognize that for a sparse system matrix 𝑨 with an average of pm nonzero elements per row the cost to evaluate the matrix-vector product 𝑨𝒖 is only 𝒪(mp) as opposed to 𝒪(m2) for a full system with p=m. This suggests considering a vector set

{𝒃,𝑨𝒃,𝑨2𝒃,},

starting from some arbitrary vector 𝒃. The resulting sequence of vectors has been encountered already in the power iteration method for computing eigenvalues and eigenvectors of 𝑨, and for large n, 𝑨n𝒃 will tend to belong to the null space associated with the largest eigenvalue, leading to the ill-conditioned matrices

𝑽n=[ 𝒃 𝑨𝒃 𝑨n-1𝒃 ]m×n.

As in the development of power iteration into the QR method for eigenvalue approximation, the ill-conditioning of 𝑽n can be eliminating by orthogonalization of 𝑽n. In fact, the procedure can be organized so as to iteratively add one more vector 𝒒n+1 to the vectors 𝑸n=[ 𝒒1 𝒒2 𝒒n ] already obtained from orthogonalization of 𝑽n . Start in iteration n=1 from 𝒒1=𝒃/||𝒃||. A new direction is obtained through multiplication by 𝑨, 𝒗2=𝑨𝒒1. Gram-Schmidt orthogonalization leads to

𝒗2=h11𝒒1+h21𝒒2,h11=𝒒1T𝒗2,h21=||𝒗2-h11𝒒1||,𝒒2=(𝒗2-h11𝒒1)/h21.

The above can be written as.

𝑨[𝒒1]=[ 𝒒1 𝒒2 ][ h11 h21 ],𝑨𝑸1=𝑸2𝑯1. (5)

Note that

C(𝑽n)=C(𝑸n)=span{𝒃,𝑨𝒃,𝑨2𝒃,,𝑨n-1𝒃},

thus constructing a sequence of vector spaces of increasing dimension C(𝑸1)C(𝑸2)C(𝑸n) when 𝒃 is not an eigenvector of 𝑨. These are known as Krylov spaces 𝒦n=C(𝑸n). In the nth iteration (5) generalizes to

𝑨𝑸n=𝑨[ 𝒒1 𝒒2 𝒒n ]=[ 𝑨𝒒1 𝑨𝒒2 𝑨𝒒n ]=[ 𝒒1 𝒒2 𝒒n 𝒒n+1 ][ h11 h21 h1,n h21 h22 h2,n 0 h32 hn,n 0 0 hn+1,n ]=𝑸n+1𝑯n. (6)

The resulting algorithm is known as the Arnoldi iteration.

Algorithm (Arnoldi)

𝒃, 𝒒1=𝒃/||𝒃||

for n=1,2,

𝒗=𝑨𝒒n

for j=1 to n

hjn=𝒒jT𝒗

𝒗=𝒗-hjn𝒒j

end

hn+1,n=||𝒗||

𝒒n+1=𝒗/hn+1,n

end

3.GMRES

Approximate solutions 𝒖nC(𝑸n) to the system 𝑨𝒖=𝒄 can now be obtained by choosing the starting vector of the embedded Krylov spaces as 𝒃=𝒄 and solving the least squares problem

min𝒖n||𝑨𝑸n𝒖n-𝒄||. (7)

Problem (7) is reformulated using (6) as

min𝒖n||𝑸n+1𝑯n𝒖n-𝒄||min𝒖n||𝑯n𝒖n-𝒘||,

with 𝒘=||𝒄||𝒆1 since ||𝑸n+1𝑯n𝒖n-𝒄||=||𝑸n+1T(𝑸n+1𝑯n𝒖n-𝒄)||. This is known as the generalized minimal residual algorithm (GMRES).

Algorithm (GMRES)

𝒄, s=||𝒄||, 𝒒1=𝒄/s

for n=1,2,

𝒗=𝑨𝒒n

for j=1 to n

hjn=𝒒jT𝒗

𝒗=𝒗-hjn𝒒j

end

hn+1,n=||𝒗||

# Least squares approximation 𝑯n𝒖ns𝒆1

𝑷𝑹=qr(𝑯n); 𝒘=s𝑷T𝒆1; 𝒖n=𝑹\𝒘

if ||𝒖n-𝒖n-1||ε return(𝒖n)

𝒒n+1=𝒗/hn+1,n

end