The Finite Element Method for the Wave Equation 1
The Wave Equation We consider the scalar wave equation modelling acoustic wave propagation in a bounded domain 3, with boundary Γ : 1 2 u c(x) 2 u 0, in (0, T ), t2 u u(, 0) 0, (, 0) f, in, t n u Γ1 0, on Γ (0, T ), (1) where u(x, t) is the pressure and c(x) is the wave speed depending on x (x 1, x 2, x 3 ), t is the time variable, T is a final time, and f is a load vector. 2
Finite Element Discretization We now formulate a finite element method for (1) based on using continuous piecewise linear functions in space and time. We discretise (0, T ) in the usual way denoting by K h {K} a partition of the domain into tetrahedra K (h h(x) being a mesh function representing the local diameter of the elements), and we let J k {J} be a partition of the time interval (0, T ) into time intervals J (t k 1, t k ] of uniform length t k t k 1, k 1,..., N. To formulate the finite element method for (1) we introduce the finite element space Wh u defined by : W u : {u H 1 ( J) : u(, 0) 0, n u Γ 0}, W u h : {u W u : u K J P 1 (K) P 1 (J), K K h, J J k }, (2) 3
where P 1 (K) and P 1 (J) are the set of piecewise linear functions on K and J, respectively. 4
Fully discrete scheme To obtain discrete scheme we apply CG(1) in space and time and seek a discrete solution in the space Wh u for u spanned by the functions u(x, t) N l0 M u l iϕ i (x)ψ l (t), i1 where ϕ i (x) and ψ l (t) are standard continuous piecewise linear functions in space and time, respectively. 5
Substituting this into (1), we obtain the following system of linear equations: M(u k+1 2u k +u k 1 ) 2 F k 2 A( 1 6 uk 1 + 2 3 uk + 1 6 uk+1 ), k 1,..., N 1, with initial conditions : u(0) u t (3) t0 0. (4) Here, M is the mass matrix in space, A is the stiffness matrix, F k is the load vector at time level t k, k 1, 2, 3..., u is the unknown discrete field values of u, and is the time step. 6
The explicit formulas for the entries in system (3) at each element e can be given as: M e i,j ( 1 c 2 ϕ i, ϕ j ) e, K e i,j ( ϕ i, ϕ j ) e, F e j (f, ϕ j ) e, (5) where (.,.) e denotes the L 2 (e) scalar product. The matrix M e is the contribution from element e to the global assembled matrix in space M, K e is the contribution from element e to the global assembled matrix K. 7
W u h is a finite dimensional vector space, dim W u h M N, with a basis consisting of the standard continuous piecewise linear functions{ϕ i } M i1 in space and hat functions {ψ l } N l1 in time, where: 0, if t / [, t l+1 ], t t ψ l (t) l 1 t i, if t [, t l ], (6) t l+1 t t l+1 t l, if t [t l, t l+1 ]; ψ l 1 ψ l ψ l+1 0 t 0 t 1 t l t l+1 t N+1 T 8
The discrete system of equations Using basis of functions {ϕ i } M i1 in space and {ψ l} N l1 in time we have: u h N M l0 i1 u h l i ϕ i(x)ψ l (t). Substituting into (1) we get: + N l0 N M l u hi i1 l0 i1 T M l u hi 0 1 tl+1 c 2 ϕ i(x) ψ l (t) t v(x, t) t ϕ i (x) v(x, t)ψ l (t) dxdt f(x)v(x, t) dxdt v W u h. dxdt (7) 9
We take v(x, t) ϕ j (x)ψ m (t) and get: + N l0 N M l u hi i1 l0 i1 T M l u hi 0 1 tl+1 c 2 ϕ i(x)ϕ j (x) ϕ i (x) ϕ j (x) f(x)v(x, t) dxdt v W u h. ψ l (t) t ψ m (t) t ψ l (t)ψ m (t) dxdt dxdt (8) 10
l Let U u hi denote the vector of unknown coefficients, M (m ij ), A (a ij ) are mass and stiffness matrices M M in space, correspondingly, with coefficients m ij ϕ i (x)ϕ j (x) dx, (9) a ij ϕ i (x) ϕ j (x) dx, P (p lm ), K (k lm ) are stiffness and mass matrices N N in time with coefficients k lm k lm ψ l (t) t ψ m (t) t ψ l (t)ψ m (t) dt, dt, (10) 11
and the load vector b (b jm ) with coefficients b jm f(x)ϕ j (x)ψ m (t) dxdt. (11) 12
First, we compute K (k lm ) and P (p lm ). Note, that k lm 0, p lm 0 unless l m 1, l m, l m + 1. Using the definition of test functions (6), we compute first diagonal elements k ll : k ll p ll tl ( 1 tl ψ l(t)ψ l(t) dt ) 2 dt + t l ψ l (t)ψ l (t) dt ( 1 t l ) 2 dt 2, ( t tl 1 ) 2 ( tl+1 t dt + ) 2 dt 2 3, (12) 13
Similarly, k l,l+1 t l ψ l(t)ψ l+1(t) dt 1 1 dt k l 1,l 1, tl ψ l 1(t)ψ l(t) dt 1 1 dt (13) 1. Verification: write (6) for ψ l+1 and ψ l 1 and insert then into (14). 14
p l,l+1 tl t l 1 ψ l (t)ψ l+1 (t) dt ( t tl 1 ) ( t tl ) dt p l 1,l 1 6, ψ l 1 (t)ψ l (t) dt (14) t l ( tl+1 t ) ( tl t ) dt 1 6. Verification: write (6) for ψ l+1 and ψ l 1 and insert then into (14). 15
We compute coefficients of b in the same way to get: tm+1 b jm f(x)ϕ j (x)ψ m (t) dxdt + t m 1 f(x)ϕ j (x) f(x)ϕ j (x) tm t m 1 tm+1 t m f(x j )ϕ j (x) dx. t t m 1 t m+1 t dxdt dxdt (15) 16
We substitude computed coefficients to (8) and get the system of linear equations (3): M(u k+1 2u k + u k 1 ) 2 F k 2 A( 1 6 uk 1 + 2 3 uk + 1 6 uk+1 ), k 1,..., N 1. (16) To obtain an explicit scheme we approximate M with the lumped mass matrix M L in space, the diagonal approximation obtained by taking the row sum of M, as well use mass lumping in time by replacing the terms 1 6 uk 1 + 2 3 uk + 1 6 uk+1 by u k. By multiplying (16) with (M L ) 1 we obtain an efficient explicit formulation: u k+1 2 F k +2u k 2 (M L ) 1 Ku k u k 1, k 1,..., N 1, (17) 17