Controllability method for the Helmholtz equation with higher-order discretizations

We consider a controllability technique for the numerical solution of the Helmholtz equation. The original time-harmonic equation is represented as an exact control-lability problem for the time-dependent wave equation. This problem is then formulated as a least-squares optimization problem, which is solved by the conjugate gradient method. Such an approach was ﬁrst suggested and developed in the 1990s by French researchers and we introduce some improvements to its practical realization. We use higher-order spectral elements for spatial discretization, which leads to high accuracy and lumped mass matrices. Higher-order approximation reduces the pollution eﬀect associated with ﬁnite element approximation of time-harmonic wave equations, and mass lumping makes explicit time-stepping schemes for the wave equation very eﬃcent. We also derive a new way to compute the gradient of the least-squares functional and use algebraic multigrid method for preconditioning the conjugate gradient algorithm. Numerical results demonstrate the signiﬁcant improvements in eﬃciency due to the higher-order spectral elements. For a given accuracy, spectral element method requires fewer computational operations than conventional ﬁnite element method. In addition, by using higher-order polynomial basis the inﬂuence of the pollution eﬀect is reduced.


Introduction
The Helmholtz equation is a fundamental equation for time-harmonic wave propagation. It occurs in a number of physical applications such as underwater acoustics, medicine, and geophysics. It can also be used to model the scattering of time-harmonic acoustic waves by an obstacle. In this paper, we concentrate on scattering problems but the same method can be used for other types of Helmholtz problems as well.
A wide range of numerical methods have been used for solving the Helmholtz equation. These methods can be divided into boundary and domain based methods. We are especially interested to solve problems with varying material parameters. For such problems, boundary based methods are not directly applicable whereas domain based methods are more flexible in this respect. Thus, we focus our attention to domain based methods.
In the FEM solution of the Helmholtz equation, the discretization mesh needs to be adjusted to the wavelength of the wave. Higher frequencies require finer meshes to reach sufficient accuracy and a typical rule is to keep a fixed number of grid points in a wavelength. This means keeping the quantity κh fixed, where κ is the wavenumber and h the mesh step size. Therefore, high frequency problems often lead to large-scale linear systems to be solved for which conventional solution methods can not be used.
In addition to approximation error, an important consideration in the finite element solution of Helmholtz problems is the so-called pollution effect (see, e.g., [2,19,20,21] and references there in). In [20], it is shown that the relative error of the hp-version of finite element solutions in the H 1 -seminorm consists of two parts. One of these is the approximation error, which is of order κh 2p p and the other is the pollution error, which is of order κ κh 2p 2p , where p is the order of the basis functions. Consequently, the relative error increases as the wavenumber increases, even if κh is kept constant. The pollution part becomes the dominant source of the relative error at high wavenumbers.
It is known that the pollution effect can not be avoided in two-and threedimensional problems [21]. Thus, fixed error level would require keeping the quantity κ 2 h fixed, which leads to unacceptable computational costs for high frequency problems. One way to reduce the influence of the pollution effect is to use higher-order polynomial basis, and we shall pursue this direction in this article. The controllability techniques studied in this article provide an efficient method to Helmholtz equations with higher-order approximations. Higher-order approximations are considered on a general level, for example, in [22]. We apply specifically the spectral element method, which is considered in the book [23].
To reduce the pollution error, especially in large scale problems, modifications of the classical FEM are needed. One way to decrease the pollution effect is to modify the polynomial basis of standard FEM so that the local basis will consist of nonpolynomial shape functions. This is done in discontinuous Galerkin method [24,25,26].
Ultra weak variational formulation (UWVF) [27,28] uses standard finite element meshes and a new kind of variational formulation on the interfaces between the elements. It reduces the memory requirement compared to the standard FEM, but might suffer from numerical instability. Also spectral [29,30] and collocation methods [19] are used to reduce the pollution effect.
The discretization and solution methods mentioned above are based on handling directly the time-harmonic equation. They all lead to large-scale discrete problems with indefinite linear equations for which it is difficult to develop efficient iterative methods. An alternative is to simulate the time-dependent equation with respect to time until time-harmonic solution is reached (asymptotic approach). However, this approach suffers from poor convergence at least in the case of large wavenumbers and complicated domains.
In this paper, we use the idea of Bristeau, Glowinski, and Périaux (see, e.g., [31,32,33,34,35]) to formulate the Helmholtz problem as an exact controllability problem for the time-dependent wave equation. Exact controllability approach is introduced by Lions [36] as a systematic method to address controllability problems for partial differential equations. This controllability technique was used also in [37], where it was combined with a fictitious domain method, and Lagrange multipliers were used to handle the Dirichlet condition.
As in [23], we discretize the wave equation in space domain with spectral elements, which combines the geometric flexibility of finite elements with the high accuracy of spectral methods. The basis functions are higher-order Lagrange interpolation polynomials, and the nodes of these functions are placed at Gauss-Lobatto (GL) collocation points. The integrals in the weak form of the equation are evaluated with the corresponding Gauss-Lobatto quadrature formulas. As a consequence of the choice, the mass matrix is diagonal.
In [38], we used the central finite difference scheme for time discretization. That scheme is second order accurate and with a diagonal mass matrix also fully explicit, which are both essential properties for computational efficiency. Only matrix-vector products are needed in time-dependent simulation, but the scheme needs to satisfy the CFL condition, which limits the length of the time step. When higher-order elements are used with the second order time discretization, the temporal error is larger than the spatial error, unless very small time steps are used (see [23] for details). Now, we improve the accuracy of the method by using the fourth order accurate Runge-Kutta method. Explicitness of the method can be maintained with diagonal mass matrices, but still, the method is only conditionally stable.
After discretization, exact controllability problem is reformulated as a least squares problem, which is solved with the preconditioned conjugate gradient (CG) algorithm. Computation of the gradient of the function to be minimized is an essential stage of the method. In [35], the gradient was derived on the continuous level, and the same formula was used also on the discrete level. We discretize first the wave equation and the function to be minimized. Then, we compute the gradient directly for the discretized problem.
The rest of the paper is organized as follows: First, we present the Helmholtz equation for scattering problems in Section 2. The formulation of the exact controllability problem is considered in Section 3. The discretization of the exact controllability problem is described in Section 4. In Section 5, we present the least-squares problem and consider its conjugate gradient solution in Section 6. Finally, in Section 7, we study the performance of the method with numerical experiments. Also comparison with the method presented in [38] is done.

Helmholtz equation
We consider the scattering of a time-harmonic acoustic plane wave by a bounded obstacle in the two-dimensional case. The scattering can be modelled by the Helmholtz equation with an absorbing boundary condition Figure 1. Obstacle Θ, domain Ω = Π 1 ∪ Π 2 , and the two parts of the boundary where U (x) denotes the (complex-valued) total acoustic pressure field. The total field is sum of the scattered wave U scat and the incident plane wave U inc . Operator W sets the boundary condition on Γ 0 , and F and Y ext are source terms due to the incident plane wave. The Helmholtz equation describes the linear propagation of acoustic waves in an isotropic and inviscid fluid.
The problem setting is illustrated in Fig. 1, where Θ denotes the obstacle and Ω is the domain between the obstacle and the absorbing boundary Γ ext . The boundary of the obstacle is denoted by Γ 0 . Domain Ω is divided into two parts by a closed curve Γ c (collection curve), which is chosen such that all the inhomogenities in Ω are inside Γ c . The two parts of Ω are denoted by Π 1 and Π 2 (see Fig. 1). Vector n denotes the outward normal vector to Ω and ν denotes the outward normal to Γ c (points away from obstacle). The wavenumber and density of the material are denoted by κ(x) and ρ(x), respectively, and they may be varying in Π 1 . The wavenumber is related to the angular frequency ω and to the speed of sound c(x) by the formula κ(x) = ω c(x) . The corresponding wavelength is given by The boundary condition on the surface of the obstacle depends on its acoustic properties. With sound-soft obstacle the total pressure is zero on the surface Γ 0 , which implies Dirichlet boundary condition with W equal to the identity operator. Sound-hard obstacle leads to Neumann boundary condition with W = ∂ ∂n . Third alternative is Robin boundary condition, which means a linear combination of the previous conditions. On the absorbing boundary Γ ext , we impose the conventional first-order boundary condition [39]. This is the simplest alternative and not accurate in approximating the Sommerfeld radiation condition. However, it is sufficient for the presentation of the controllability method of this article. We shall consider more sophisticated boundary conditions and absorbing layers in future.
The time-harmonic incident plane wave is given by U inc (x) = exp(i ω · x), where i is the imaginary unit and the vector ω gives the propagation direction (ω = ω 2 ). Then, the functions Y ext and F in the equations above are of the form In general, function F is non-zero, but if material is homogeneous, it becomes zero. By the choice of Γ c , F is zero in the domain Π 2 .

Exact controllability problem
Hilbert Uniqueness Method (HUM) was introduced by J.L. Lions 1986 [36] as a systematic method to address controllability problems for partial differential equations. It is based on the construction of appropriate Hilbert space structures on the initial data. These Hilbert structures are connected with uniqueness properties. We use a method which is inspired by HUM, and introduced in [31], to find time periodic solutions to the wave equation.
With exact controllability, it is possible, to find a time periodic solution to wave equation without solving the Helmholtz equation. If we have a system in a given initial state (u(0), ∂u ∂t (0)) and a control e = (e 0 , e 1 ) such that the given final state (u(τ ), ∂u ∂t (τ )) can be achieved, the system is said to be exactly controllable [40]. Thus, the basic idea of exact controllability is to have preassigned initial and final states of the wave equation such that beginning from the initial state, the final state can be achieved by some control. Exact controllability is well-known and extensively researched topic within classical wave equations [35].
Solution of the time-harmonic equation (1)-(3) is equivalent to finding a periodic solution for the corresponding time-dependent wave equation. The period τ corresponding to the angular frequency ω is given by 2π ω , and the τ -periodic solution can be achieved by controlling the initial conditions such that the solution at time τ coincides with the initial conditions. In what follows, we restrict our attention to Dirichlet problem (i.e., W = I) although Neumann and Robin boundary conditions could be treated in a related way. We also introduce the Hilbert space Z for the the initial conditions e = (e 0 , e 1 ) ∈ Z by where Then, we have the following exact controllability problem: Find initial conditions e ∈ Z such that equations u(x, 0) = e 0 in Ω, (11) ∂u ∂t (x, 0) = e 1 in Ω, (12) u(x, τ ) = e 0 in Ω, hold with where u inc (x, t) = Re(U inc (x) exp(−iωt)). The spectral element discretization of the problem is based on the weak formulation of the classical wave equation (8)-(10): Find u satisfying u(t) ∈ V for any t ∈ [0, τ ] and

Discretization
In order to produce an approximate solution of the wave equation, the computational domain is discretized into a set of finite elements. For this, we use spectral elements, which allow convenient treatment of complex geometries and varying material properties. The fourth order Runge-Kutta scheme is used to advance the system in time.

Spectral element method
The spectral element method (SEM) was pioneered in the mid 1980's by Anthony Patera [41] and Yvon Maday [42]. It is a method, which combines the geometric flexibility of finite elements with the high accuracy of spectral methods. When using SEM, the physical domain is typically divided into nonoverlapping quadrilateral elements, but also triangular elements can be used. Although triangular spectral elements offer high accuracy in complex geometries, solving the related problems might be difficult and time consuming. Contrary to quadrilateral spectral elements, mass matrices are not generally diagonal by nature with triangular elements [43]. Whether mass matrices are diagonal or not, the computational effort is larger on triangular elements than on quadrilateral elements. The reason for this is that triangles are not tensor-product elements, and hence the computation of the derivatives involves all collocation point values on elements. Consequently, the cost of computing derivatives is higher on triangles than on quadrilaterals. Moreover, accuracy is slightly better on quadrilaterals than on triangles, and condition number of the stiffness matrices grows faster for triangles than quadrilaterals [44]. At present, it seems that triangle based SEM is competitive with the quadrilateral one only if the domain Ω has a curved shape. These are the reasons why we have chosen to use quadrilateral elements and the associated polynomial spectral basis. A detailed comparison of SEM on quadrilaterals and triangles is done in [44], and quadrature formulas needed for quadrilateral and triangle based methods are recently presented, for instance, in [23] and [45], respectively.
After the domain is decomposed into elements, a local polynomial basis is introduced in each element. These basis functions are explained in the next section. The degrees of freedom associated with the basis functions are situated at the Gauss-Lobatto quadrature points of the quadrilateral. This is the main difference between SEM and p-FEM. So, SEM can be described as a finite element method in which higher-order spectral method is used within each element.
The computational efficiency of the method is based on the use of the Gauss-Lobatto quadrature rule in the computation of the finite element matrices. It provides lumped mass matrices without reducing the order of accuracy and leads to efficient simulation for transient problem.

Discrete weak formulation
The physical domain Ω is decomposed into N e quadrilateral elements. We denote the elements by Ω i , i = 1, . . . , N e , and assume that Ω = Ne i=1 Ω i , i.e., the mesh coincides with the domain exactly. For the discrete formulation, we first define the reference element Ω ref = [0, 1] 2 and affine mappings G i : where is the set of polynomials of order r in R 2 . The quadrilateral mesh is assumed to satisfy the usual regularity assumptions for a finite element mesh [46].
The basis functions ϕ n for the space V r h are constructed with the help of the basis functionsφ jk , j, k = 1, . . . , r + 1, on the reference element Ω ref . These functions are Lagrange interpolants of the Gauss-Lobatto integration points in Ω ref and can be written as a product of two polynomials of order r (1D basis functions). Then, for each basis function ϕ n for V r h we can identify a basis functionφ jk such that ϕ n | Ω i • G i =φ jk (see [23] for details).
Based on these definitions we can write the semidiscrete weak formulation of the wave equation (8) The dimension of the space V r h is the number of Gauss-Lobatto points of the quadrilateral mesh and we denote this number by N dof .

Semidiscretized equation
We denote by u ∈ R N dof the vector containing the values of the function u h (total pressure) at the Gauss-Lobatto points of the quadrilateral mesh. Then the weak formulation of the previous section can be rewritten in the matrix form where M is the mass matrix, S the damping matrix due to the absorbing boundary condition, K is the stiffness matrix, and F is the vector due to the functions f and y ext . The entries of the N dof × N dof matrices M, S, and K are given by the formulas The values of these integrals are computed element by element with the Gauss-Lobatto integration rule. Thus, it is obvious that the matrices M and S become diagonal. The components of the vector F are of the form

Time discretization
The time discretization of the semi-discrete equation is performed with the fourth order Runge-Kutta method. This method needs four substeps at each timestep to give a method with fourth order accuracy with respect to the timestep ∆t, and leads to an explicit time-stepping scheme. Both properties are essential for computational efficiency.
The time interval [0, τ ] is divided into N timesteps, each of size ∆t = τ /N . After replacing the time derivatives in the semidiscretized form (21) by the appropriate approximations and taking into account the initial conditions (11)-(12) we obtain the fully discrete state equation, which can be represented in the matrix form where I is the identity matrix, The matrix blocks C and B, and the vector blocks D i , are given by the formulas where F i is the vector F at time t = i∆t. In practice, one timestep from y i−1 to y i is achieved by solving a system where k j = (k j1 , k j2 ) T , j = 1, 2, 3, 4, are the gradient estimates.
In the next section, when describing the control algorithm, we use for the state equation the short form s(e, u(e)) = 0, where e = (e 0 , e 1 ) T contains the initial values and u the vectors u i . We denote the state equation by s 0 (e, u(e)) = 0 in the special case with F i = 0 for all i.

Control problem
The exact controllability problem for computing τ −periodic solution for the wave equation involves finding such initial conditions e 0 and e 1 that the solution u and its time derivative ∂u ∂t at time τ would coincide with the initial conditions. For the numerical solution, this problem is formulated as a leastsquares optimization problem with the cost function J(e, u(e)) = where e = (e 0 , e 1 ) ∈ Z, and u is the solution of the initial value problem (8)-(12) [35].

Least-squares formulation
In order to solve the exact controllability problem, we use the least-squares formulation min e∈Z J(e, u(e)), where e solves equations (8)-(12) and is the discretized objective function, where ∂u N ∂t and u N are given by the equation (26). Once we find e ∈ Z such that J(e, u(e)) = 0 the conditions (13) and (14) are also satisfied and the time-harmonic solution is achieved.
Solving the minimization problem (32) is equivalent to finding such e ∈ Z that ∇J(e, u(e)) = 0. Since J is a quadratic functional this is a linear system, and the conjugate gradient (CG) method is suitable for solving it. If the unpreconditioned CG algorithm is used, the number of iterations grows with the order of elements [42]. In order to avoid this difficulty, we use a preconditioned CG method. Each iteration step involves computation of the gradient of the cost function J, which is an essential stage of the algorithm.

Gradient of the discretized cost function
The state equation (26) can be represented in the residual form (30), and by the adjoint equation technique we see that where p is the solution of the adjoint equation The state equation (30) is also called the forward equation because it is solved by advancing forward in time. The adjoint state equation (35) requires advancing backward in time, so it is called the backward equation [35].
The adjoint state equation (35) can be represented in a block form similar to (26): where The gradient components, computed by the equation (34), are then the following: dJ(e, u(e)) dJ(e, u(e)) In the same way as with the state equation, one step of the adjoint equation (36) can be written out in the matrix form corresponding to the system (29), as with starting value

Conjugate gradient method
Cost function is minimized with a preconditioned conjugate gradient (CG) method. Because vector u depends linearly on the initial conditions e 0 and e 1 , the function to be minimized is a quadratic function, and its minimization corresponds to the solving the linear system ∇J(e) = 0.

Computation of the initial approximation
It is important to have smooth initial approximations for e 0 and e 1 , which satisfy the boundary conditions. In [35], a special procedure suggested by Mur in [47, p. 950] was used, which leads to faster convergence to the time-harmonic solution. We apply the same procedure, and first define a smooth transition function θ(t), which increases from zero to one in the time interval [0, τ tr ]: The length of the time interval should be chosen as a multiple of the period τ , i.e., τ tr = nτ with n a positive integer. Then, we solve the following initial value problem: w(x, 0) = 0 in Ω, The initial approximations for the control variables e 0 and e 1 are now the solution w and its time derivative at time τ tr . If the obstacle Θ of the scattering problem is convex, there are no interacting reflections, and already this initial procedure may converge rapidly to the time-harmonic solution. However, in general the convergence is slow and we need to continue with the control algorithm.

Preconditioned conjugate gradient algorithm
Our preconditioned CG algorithm differs from the one in [35] with respect to the spatial discretization and the gradient computation. Each CG iteration requires computation of the gradient ∇J, which involves the solution of the state equation (30) and the corresponding adjoint equation (35). Also solution of one linear system with the preconditioner L and some matrix-vector operations are needed. Values of the control variables e at the ith iteration are denoted by e i 0 and e i 1 . Solution of the adjoint state equation is p = (p 0 , ∂p 0 ∂t ), and the gradient variable is g = (g 0 , g 1 ). By s 0 (e, u(e)) = 0 we denote the state equation (26), where F i = 0 for all i. Then, the CG algorithm for solving the least-squares problem is the following:  Compute the gradient updates v 0 and v 1 by the formulas (37)- (38) . Compute ρ = c (w,v) . e i = e i−1 + ρw. g = g + ρv.
Solve linear system with the preconditioner Lv = −g.

Block-diagonal preconditioner
We use the block-diagonal preconditioner where the first and second blocks are associated with the first and second terms in (33), respectively.
Solution with the first preconditioner block is computed by using an algebraic multigrid (AMG) method. This approach is recently studied for solving problems with higher-order discretizations in the article by Hays et al. [48], in which they applied the well-known AMG of Ruge and Stüben [49] to Poisson problem and Stokes equations discretized with higher-order elements.
At this stage, we use the method based on the work of Kickinger [50]. In this method coarsening (i.e. selection of the unknowns for coarser levels) is based on the graph of the stiffness matrix only, instead of using actual values stored in the stiffness matrix. This approach ensures fast computation of coarser level components. Additionally, it is an easy task to extend this method to use any graph related to the problem, and this property is used here.
Coarsening strategy proposed in [50] leads to far too coarse systems when applied to stiffness matrix obtained by higher-order discretization. This is due to increasing amount of connections between unknowns of the problem. Consequently, convergence factor of AMG degrades rapidly as the order of the approximation polynomials increases. We have overcome this problem by employing a graph that is constructed so that unknowns are connected to each other as if a lower-order element would have been used in the discretization process, i.e. only the unknowns corresponding to the nearest neighbouring nodes are connected to each other.
As a smoother of AMG we use Successive Over Relaxation (SOR), with relaxation parameter 1.2 unless other mentioned. One iteration of SOR is used as pre-and post-smoothing. Additionally, in the beginning of every multigrid iteration, four iterations of SOR is used to smooth the solution. In this case, so called W-cycle (see, e.g., [51]) is utilized as a multigrid iteration.

Numerical experiments
The main goal of these numerical experiments is to study the accuracy of the spatial discretization and its effect on computational complexity. In order to validate the method, we consider the solution of various test problems dealing with acoustic scattering of an incident plane wave. We also study the accuracy of the temporal discretization by comparing the method with the one with central finite difference time discretization, which is presented in [38].
The problem is formulated in terms of the total wave u, which is a sum of the incident wave and the scattered wave. For all test cases, we have set the 2 ), density of the material ρ(x) = 1, speed of the wave c(x) = 1, total time τ = 2π ω , and the stopping criterion ε = 10 −5 , unless other mentioned. Mesh generator provided by Numerola Ltd. is used to divide the computational domain into square elements, each having a side length h. Computations have been carried out on a 1.80 GHz AMD Athlon PC.

Error factors
The overall accuracy of the discrete solution given by the controllability method depends on many factors. In order to concentrate on the spatial discretization we choose the test problems in such a way that as many error factors as possible are eliminated. We try to isolate the effects of those error factors which we can not eliminate.
The accuracy depends on the spatial and temporal discretization parameters, which are the mesh density h, the order r of the spectral basis, and the timestep ∆t. Large time step allows to compute the solution utilizing only small amount of CPU time, but it may involve an error which deteriorates the accuracy of the method. Hence, time steps small enough are used to attain the proper temporal accuracy.  Geometries with curved boundaries can not be represented exactly by a rectangular mesh, which also causes error. We avoid this error component by using only geometries with polygonal boundaries (see . Curvilinear geometries could be approximated accurately by using elements with curved edges. The least-squares optimization problem is not solved exactly, since the CG algorithm is terminated after given criterion is reached. This error component can be controlled by decreasing ε in Algorithm 1.
In scattering problems, the approximation of the radiation condition leads to yet another error component. We eliminate this factor in the first test example by creating an artificial problem with known analytic solution, which satisfies the absorbing boundary condition. The approximation of the radiation condition could be improved by using more sophisticated boundary conditions or absorbing layers.

Accuracy of approximation
The first test problem is chosen to test the accuracy of the approximation. The boundary Γ ext coincides with a rectangle with the lower left corner at the point (0.0, 0.0) and the upper right corner at the point (4.0, 4.0). In the center of this rectangle, we have a bounded square scatterer with side length 2 (see Fig. 2). We modify the functions f and y ext in the scattering problem such that the analytic solution of the problem is known to be the plane wave u inc . For this purpose, we introduce an auxiliary function y ∈ H 1 (Ω) which satisfies the conditions u inc (x, t) = cos(ωt − ω · x), y| Γ 0 = u inc , y| Γext = ∂y ∂n | Γext = 0, and y ext = ∂u inc ∂t + ∂u inc ∂n . Then, the functionû defined byû = u − y satisfies equation (8) with the nonzero right-hand side f = − ∂ 2 y ∂t 2 + ∇ 2 y as well as equations (9) and (10). This modification eliminates the error caused by the absorbing boundary condition, and allows us to study the effect of the spatial discretization.
The test problem is solved with angular frequencies ω = π and ω = 2π with both Runge-Kutta (RK) and central finite difference (CD) time discretization. The relaxation parameter of SOR is 1.4 in preconditioning. To ensure the stability and accuracy conditions, the time interval [0, τ ] is divided into 300 timesteps in the case of CD time discretization and into 150 timesteps in the case of RK time discretization. After solvingû, solution to the actual test problem is given by u =û + y.
The number of non-zero entries in the stiffness matrix is essential for computational efficiency, since the time stepping scheme involves mainly matrix-vector multiplications. This is why the comparison between mesh step refinement (h-refinement) corresponding to the classical FEM discretization and spectral basis order refinement (r-refinement) corresponding to the SEM discretization is presented in terms of the number of nonzero matrix entries in Fig. 5. The error curves of the r-refinement are achieved when the order of the spectral basis r is increased from 1 to 5 with mesh stepsize h = 1/4. The h-refinement is obtained by keeping the basis order fixed (r = 1) and doubling the resolution of the mesh, given by λ/h, consecutively.
As the order of the polynomial basis increases, the maximum error between the numerical solution and the analytical solution decreases until the error of the time discretization or the stopping criterion is achieved. The error becomes smaller also with mesh step refinement, but the convergence rate is higher for r-refinement than for h-refinement. Based on these results, it seems clear that    it is better to increase the order than the resolution to improve efficiency.
In conjunction with higher-order elements, results computed with RK version of the algorithm are more accurate than the ones computed with the CD version (see Fig. 5). This happens, because RK is higher-order time scheme than CD. Apparently, the error of time discretization limits the accuracy with basis orders r ≥ 3 in the CD case, whereas the stopping criterion causes the limiting error in the RK case. Since the error of spatial discretization dominates with low order elements, the difference between errors is insignificant for spectral orders r = 1 and r = 2.
When the polynomial basis increases or the mesh stepsize becomes smaller, systems to be solved become larger, which causes the increase in CPU time. When ∆t is constant, the computational cost needed for one iteration is proportional to the number of non-zero elements in the stiffness matrix. To be more precise, the computational effort of the method seems to depend linearly on number of non-zero elements in the stiffness matrix (see Fig. 6). According to Fig. 6, the number of iterations varies such that the CPU time required for the two refinements corresponding to SEM and FEM are of the same order of magnitude.
Most of the CPU time is used for solving state (i.e. forward, FWD) and ad- joint state (i.e. backward, BWD) equations. Fig. 7 shows the proportion of computational efforts of those equations and AMG preconditioner in one CG iteration with RK time discretization, ω = 2π and 100 timesteps. Also some matrix-vector multiplications are computed at each iteration, but from Fig. 7 we notice that the amount of CPU time used for those is negligible when compared to the other computational efforts. Similar bar charts can be achieved also with the other r-refinements discussed in this Section.
When higher-order elements are used, good efficiency with high accuracy can be achieved by using sufficiently large mesh stepsize [52]. This is why we have performed another set of experiments by using coarser mesh with higher element order.

Pollution effect
In these computations, the number of timesteps is chosen such that decreasing the length of the timestep does not improve the accuracy significantly. Number of timesteps in CD and RK cases for different spectral orders is shown in Tbl. 1. We have also used coarser meshes with higher spectral orders such that the resolution of the spatial discretization, i.e. degrees of freedom per wavelength, is approximately constant (rλ/h ≈ 40). Mesh stepsizes used for angular frequencies ω = {π, 2π, 4π} are presented in Tbl. 1.
The behaviour of the error with respect to the wavenumber can be seen in Fig. 8. In the case of classical finite element discretization, i.e. r = 1, the error increases considerably large as the wavenumber increases. Error increases with wavenumber also for higher spectral orders. Thus, the pollution effect is not eliminated with higher-orders, but results are more accurate than with r = 1.
Maximum error is plotted with respect to CPU time in Fig. 9     less work, when higher-order elements are used. In the case of finite element discretization, the error is a little bit larger with RK than with CD time discretization. With higher-order elements the error in the CD case seems to be an order of magnitude larger than the error in the RK case with the same CPU time consumption.
From Figs. 8 and 9 we can notice that CPU time for algorithm grows with wavenumber. Reasons for this are increase in number of CG iterations (see Fig. 10) and the fact that denser mesh is used with higher wavenumber in these experiments. With a certain spectral order, amounts of CPU time used for AMG and for the whole algorithm grow nearly at the same rate. Thus, the proportion of CPU time used for AMG at each iteration is almost constant for fixed r (see Fig. 11).

Acoustic scattering
We consider acoustic scattering by a square, a non-convex semi-open cavity and a system of two semi-open cavities (see Figs. 2-4) by solving a twodimensional problem (8)- (12) with f = 0 and y ext = ∂u inc ∂n + ∂u inc ∂t . The incident plane wave u inc is of the same form as in Section 7.2. In these experiments, we have used the angular frequency ω = 4π. We consider also problems with varying speed of the sound, i.e. coated scatterers. In all test cases, the artificial boundary is located at distance 2λ from the scatterer. Mesh stepsizes and number of timesteps for non-coated geometries are chosen as in the previous example. Because of stability conditions for RK, we need to use more timesteps when RK is used with varying material parameters (see Tbl. 2).  -coated  60  100  140  150  150   coated  120  200  280  300  350  Table 2 Mesh stepsizes and number of timesteps for different spectral orders with ω = 4π.

Scattering by one obstacle
We begin with scattering by the same square obstacle which was considered in Section 7.2 (see Fig. 2). In the second scattering example, the obstacle is a non-convex semi-open cavity. Internal width and height of the cavity are 5 and 5 4 , respectively, and thickness of the wall is 1 4 (see Fig. 3).
With these geometries, we consider also problems with varying speed of sound c(x). For this, we define thin layers around the obstacles in which c(x) differs from the value in the surrounding domain. Thickness of the coating material      Table 3 Number of elements per wavelength for different spectral orders.  Table 4 The number of iterations of the preconditioned CG algorithm with different scatterers.
parallel to the surface of the obstacle is    number of iterations is needed. For solving the scattering problem with two non-convex cavities, the number of iterations is twice as large as in the the case of convex scatterer. More reflections are produced inside the obstacle with one non-convex cavity than with the system of two non-convex cavities. That is why twice the number of iterations is needed to solve the problem with one non-convex cavity than with two non-convex cavities. Hence, the number of iterations depends strongly on the geometry of the scatterer.
Preconditioners play an important role in accelerating the convergence rate of the CG method. The number of preconditioned CG iterations is independent of polynomial degree r (see Tbl. 4). At each iteration, CPU time required by the AMG preconditioner with higher-order elements is only a few percent of the CPU time for the whole iteration (see Fig. 18). Thus, significant savings result from the AMG preconditioner.

Computation of sonar cross section
When solving scattering problems, one is often more interested in the asymptotic behaviour of the solution than in the solution itself. This property is important, for example, when studying the scattering of sonar echoes by underwater objects (see, e.g., [53]). In this section, we describe the method which we have used to compute the far-field pattern and the associated sonar cross section (SCS) of the scattered wave. The method is the same as described in [54]. In the numerical experiments, we compute also SCS values for the numerically computed scattered waves.
The actual scattering problem we want to solve is given by equation (1) in the exterior domain outside obstacle Θ together with the boundary condition (2) and the Sommerfeld radiation condition (see [54]). Solution U of the equations (1)-(3) leads to an approximation for the solution of the original problem, and the (approximate) scattered wave U scat can be computed from the solution U by U scat = U −U inc . It is known that the scattered wave satisfies the asymptotic form wherex = x/ x 2 . The function U ∞ (x) is called the far-field pattern, and sonar cross section is defined by SCS(x) = 10 log 10 κ|U ∞ (x)| 2 .
In Fig. 19, we have visualized the SCS of two examples in Sections 7.4.1 and 7.4.2, in decibels (dB), plotted in polar coordinates.

Conclusions
We considered the use of controllability techniques to solve the time-harmonic acoustic wave equations with spectral elements. The spectral element formulation used in this article results in a global mass matrix that is diagonal by  construction. No inversion of a mass matrix is needed, which leads to a very efficient implementation. This is an advantage compared to classical finite element method.
Spatial discretization based on spectral elements is very accurate since it is based on high degree polynomials. To achieve the same accuracy, spectral element method requires fewer grid points per wavelength than finite element method. Consequently, accurate results are reached by solving smaller systems, i.e. fewer computational operations, which saves CPU time. More precise results concerning expenditure of CPU time seems to show linear dependence on the number of non-zero elements in the stiffness matrix. In addition, using higher-order polynomial basis reduces the influence of the pollution effect.
We also derived a new way to compute the gradient of the least-squares functional and used algebraic multigrid method for preconditioning the conjugate gradient algorithm. The number of preconditioned CG iterations is independent of the order of the spectral element basis, which confirms the efficiency of the AMG preconditioner, and makes the solver feasible for higher-orders.