1 Introduction

Solutions to nonlinear hyperbolic PDEs develop discontinuities in time. The generation of spurious oscillations in such regions can be prevented by applying a limiter in the troubled zones. In [17, 19], two different multiwavelet troubled-cell indicators were introduced, one based on a parameter, the other using outlier detection. We present this comparison in order to begin to understand in which regime these tools are effective. In this paper, we investigate the effectiveness of a different detection scheme, based on the theoretical detection of troubled cells using multiwavelet approaches. It uses the cancelation property [6] and the theory about thresholding [8]. This technique was originally used for a multiwavelet-based adaptive strategy in combination with the DG method. However, we are specifically interested in its application for troubled-cell indication. In the troubled cells, the moment limiter is applied [12]. We demonstrate the performance of this new indicator and show that it works very well when very fine meshes are used (the asymptotic regime). For coarser meshes, it seems that the existing multiwavelet troubled-cell indicators perform better.

The outline of this paper is as follows: in Sect. 2, some background information about the multiwavelet theory is given. The existing multiwavelet troubled-cell indicators, as well as the cancelation property and the derived thresholding technique are described in Sect. 3. Numerical results are shown in Sect. 4, and some concluding remarks are given in Sect. 5.

2 Multiwavelets and DG

In this section, we consider the multiwavelet theory that is used to design the different troubled-cell indicators. For the sake of brevity, we neglect discussion of the DG scheme [4, 5], that is used in the computations.

The relation between the DG scheme and multiwavelets was shown in [17]. Any global one-dimensional DG approximation of degree k can be written as

$$\displaystyle \begin{aligned} u_h(x) = 2^{-\frac{n}{2}}\sum_{j=0}^{2^n - 1} \sum_{\ell=0}^k u_j^{(\ell)} \phi_{\ell j}^n(x), \end{aligned}$$

where \(\phi _{\ell j}^n\) are the scaling functions related to the orthonormal Legendre polynomials. The corresponding multiwavelet decomposition is

$$\displaystyle \begin{aligned} u_h(x) = \sum_{\ell=0}^{k}s_{\ell0}^0 \phi_\ell(x) + \sum_{m=0}^{n-1} \sum_{j = 0}^{2^m - 1} \sum_{\ell = 0}^k d_{\ell j}^m\psi_{\ell j}^m(x), \end{aligned}$$

where \(s_{\ell 0}^0\) are the scaling-function coefficients belonging to u h, and \(d_{\ell j}^m\) are the corresponding multiwavelet coefficients, [2, 17]. The multiwavelets ψ have been developed by Alpert [1].

3 Utilizing Multiwavelet Coefficients for Troubled-Cell Indication

In this section, we show different troubled-cell indicators that utilize multiwavelet coefficients. Note that, as the detectors are solely based on the underlying approximation space, the ideas do not need to be modified in order to be applied to other types of model problems than those included in this paper. First, the existing indicators that use either a parameter or the boxplot method are presented. Next, the cancelation property and thresholding technique are used to design a different indication technique.

3.1 Boxplots for Outlier Detection

In [17, 18], we have shown that the coefficients \(d_{kj}^{n-1}\) are very useful for troubled-cell indication. With this knowledge, we have designed two different troubled-cell indicators. The first indicator is the so-called parameter-based multiwavelet troubled-cell indicator [17]. Here, we detect an element as troubled when

$$\displaystyle \begin{aligned} |d_{kj}^{n-1}| > C \cdot \max \{ |d_{kj}^{n-1}|, j=0,\ldots,2^n-1 \}, \ C \in [0,1]. \end{aligned} $$
(1)

The value of C is a useful tool to prescribe the strictness of the limiter.

Another option is to use outlier detection on the multiwavelet coefficients \(d_{kj}^{n-1}\) to detect the troubled cells [19]. Here, Tukey’s boxplot method [15] is applied locally to prevent the need for a problem-dependent parameter. The different steps are presented in Algorithm 1.

Algorithm 1 Outlier-detection algorithm using local vectors

Outliers are the coefficients in the vector that are straying far out beyond the others. In order to pick out certain coefficients as outliers, the outer fences are constructed, which were originally defined by Tukey [15]. The outer fences of a vector are [Q 1 − 3(Q 3 − Q 1), Q 3 + 3(Q 3 − Q 1)] (coefficients outside are called extreme outliers). The coverage for this whisker length is 99.9998%, such that only 0.0002% of the data in a normally distributed vector is detected as an extreme outlier (asymptotically) [9].

In our computations, we always use local vectors of length 16.

3.2 Cancelation Property

In this section, the cancelation property is stated and proved for the one-dimensional case [6]. Here, we assume that the multiwavelets have M + 1 vanishing moments. In our case, we have M =  + k [1, 16]. If the solution satisfies the continuity requirement \(u|{ }_{I_j^m} \in C^{M+1}(I_j^m)\) (where \(I_j^m\) is the j-th element in level m), then

$$\displaystyle \begin{aligned} d_{\ell j}^m \leq \frac{1}{(M+1)!} \cdot ||u^{(M+1)}||{}_{L^\infty(I_j^m)} \cdot 2^{(-m+1)(M+3/2)}, {} \end{aligned} $$
(2)

m = 0, …, n, j = 0, …, 2m − 1,  = 0, …, k.

The proof uses a Taylor expansion of u about element center \(x_j^m\): there exists a ξ between x and \(x_j^m\) such that

$$\displaystyle \begin{aligned} u(x) = u(x_j^m) + u^\prime(x_j^m)(x-x_j^m) + \ldots + \frac{u^{(M)}(x_j^m)}{M!}(x-x_j^m)^M + \frac{u^{(M+1)}(\xi)}{(M+1)!}(x-x_j^m)^{M+1}. \end{aligned}$$

Using that the first M + 1 moments of the multiwavelets vanish, we find

$$\displaystyle \begin{aligned} d_{\ell j}^m &= \langle u, \psi_{\ell j}^m \rangle_{I_j^m} = \left\langle \frac{u^{(M+1)}(\xi)}{(M+1)!}(x-x_j^m)^{M+1}, \psi_{\ell j}^m \right\rangle_{I_j^m} \\ &\leq \frac{1}{(M+1)!}||u^{(M+1)}||{}_{L^\infty(I_j^m)} \langle (x-x_j^m)^{M+1}, \psi_{\ell j}^m \rangle_{I_j^m}. {} \end{aligned} $$
(3)

Next, we use Cauchy-Schwarz’s inequality to find

$$\displaystyle \begin{aligned} \langle (x-x_j^m)^{M+1}, \psi_{\ell j}^m \rangle_{I_j^m} \leq ||(x-x_j^m)^{M+1}||{}_{L^2(I_j^m)} \cdot ||\psi_{\ell j}^m||{}_{L^2(I_j^m)} = ||(x-x_j^m)^{M+1}||{}_{L^2(I_j^m)}, \end{aligned}$$

because the multiwavelets are orthonormal. Using the notation Δx m for the element size in level m, we have

$$\displaystyle \begin{aligned} ||(x-x_j^m)^{M+1}||{}_{L^2(I_j^m)} \leq (\varDelta x^m)^{M+1} ||1||{}_{L^2(I_j^m)} = (\varDelta x^m)^{M+1} \sqrt{\varDelta x^m} =(\varDelta x^m)^{M+3/2}. \end{aligned}$$

For the domain [−1, 1], we have Δx m = 2m+1. This means that

$$\displaystyle \begin{aligned} ||(x-x_j^m)^{M+1}||{}_{L^2(I_j^m)} \leq 2^{(-m+1)(M+3/2)}, \end{aligned}$$

which proves the cancelation property. It should be noticed that this result can be generalized to general grid hierarchies and higher-dimensional problems [6, 10].

The next section contains a discussion of the thresholding technique for one-dimensional multiwavelet expansions.

3.3 Thresholding of the Multiwavelet Coefficients

In this section, the thresholding technique for systems of conservation laws in one dimension is explained, which is based on the cancelation property [8]. This technique is originally used for a multiwavelet-based adaptive strategy in combination with the DG method. However, we are specifically interested in its application for troubled-cell indication.

Following [8], the element \(I_j^{n-1}\) is detected as troubled if

$$\displaystyle \begin{aligned} \max_{\substack{\ell = 0,\ldots, k\\ r = 1,2,3}} \left( \frac{|d_{\ell j}^{n-1}(r)|}{\max \left\{ \max_{j= 0,\ldots,2^n-1}2^{(n-1)/2}|s_{0j}^n(r)|, 1 \right\}} \right) > \varepsilon_{n-1}\sqrt{2\varDelta x}. \end{aligned}$$

Here, the value r is related to the conserved quantity in a system of three PDEs. The factor \(\sqrt {2\varDelta x}\) (with Δx the DG mesh width) occurs because of a scaling difference: the multiwavelets in [8] are scaled with respect to the L -norm, whereas an L 2-norm scaling is used in this paper. The level-dependent threshold value ε n−1 is chosen as ε n−1 = ε∕2. The parameter ε can be chosen using two different strategies [8]. The first option is to use the a priori strategy, which is based on the balance between discretization errors and perturbation errors of adaptive meshes [10]. If the solution contains discontinuities, then the a priori strategy leads to ε = CΔx 2. The second option is the heuristic approach, which is based on numerous computations for practical applications [8]. This method is more efficient since it is less pessimistic than the a priori strategy. For discontinuous solutions, the heuristic approach uses ε = CΔx.

This yields detection of element \(I_j^{n-1}\) if

$$\displaystyle \begin{aligned} \max_{\substack{\ell = 0,\ldots, k\\ r = 1,2,3}} \left( \frac{|d_{\ell j}^{n-1}(r)|}{\max \left\{ \max_{j= 0,\ldots,2^n-1}2^{(n-1)/2}|s_{0j}^n(r)|, 1 \right\}} \right) > \frac{1}{\sqrt{2}} \varDelta x^{\beta +0.5}C, \end{aligned}$$

where β = 2 for the a priori strategy and β = 1 for the heuristic strategy. Note that the multiwavelet coefficients are scaled by the cell average if this value is greater than 1 in absolute value (to prevent division by zero).

The optimal choice of the parameter C depends on the problem, in particular on the strength of the shock compared to the normal amplitude of the solution. The smaller C is, the more elements are detected. In general, the value C = 1∕(b − a) should work for the domain [a, b] [8]. If C is chosen too small, then too many cells are detected as troubled. For the adaptive strategy, this is not really problematic since the approximation is usually more accurate on a finer grid. However, for troubled-cell indication, it is important to detect the correct number of elements.

It should be noticed that this indicator is designed for very fine resolutions (since the strategies use asymptotic arguments). For coarse meshes, smaller values of C should be used, which are difficult to predict a priori.

3.4 Generalized Grids

The algorithm for utilizing Alpert’s multiwavelets for a nonuniform grid is given in [7]: the only difference with Alpert’s algorithm [1] is that no additional vanishing moments are added. Multiwavelets for one-dimensional irregular meshes have been designed in [13, 14]. It should be noticed that this construction is local, which means that the resulting bases are depending on the level and the position unless there is an affine mapping from the element to a reference element. This leads to slower computations. On the other hand, the use of such multiwavelet space makes it possible to decompose the DG approximation to a multiwavelet expansion exactly. The multiwavelet coefficients will again become small if the underlying function is smooth, and the mesh width between two neighboring elements is not varying too much.

When coupled with a troubled-cell indication variable, it will be necessary to include spatial information of the mesh in the algorithm using the element size. Alternatively, one can use of a window-based technique [3]. A window is a fixed length subsequence of the test sequence, which can be slid through the domain using a sliding step. These issues and resulting numerics are discussed further in [16].

4 Numerical Results

In this section, the different multiwavelet troubled-cell indicators are applied to one-dimensional problems based on the Euler equations of gas dynamics.

The results for the original multiwavelet troubled-cell indicators (both based on a parameter, and based on outlier detection), can be seen in Figs. 1 and 2 (polynomial degree 2, 128 elements for Sod’s and Lax’s shock tube, and 512 elements for the blast-wave and Shu-Osher problem). The parameter-based technique performs well if a suitable value for the problem-dependent parameter C is chosen. The outlier-detection results are generally better than the original troubled-cell indicator using an optimized parameter: both the weak and the strong shock regions were detected, whereas smooth regions were not selected.

Fig. 1
figure 1

Time-history plot of detected troubled cells using the parameter-based multiwavelet troubled-cell indicator, polynomial degree 2. (a) Sod’s shock tube, C = 0.1, 128 elements. (b) Lax’s shock tube, C = 0.1, 128 elements. (c) Blast-wave problem, C = 0.05, 512 elements. (d) Shu-Osher, C = 0.01, 512 elements

Fig. 2
figure 2

Time-history plot of detected troubled cells using the outlier-detection multiwavelet troubled-cell indicator, polynomial degree 2. (a) Sod’s shock tube, 128 elements. (b) Lax’s shock tube, 128 elements. (c) Blast-wave problem, 512 elements. (d) Shu-Osher problem, 512 elements

It is also possible to use the thresholding technique for multiwavelet coefficients to detect troubled cells. It turns out that this indicator works very well as long as an appropriate value for C is chosen, and the mesh is taken fine enough. The results for the different test cases are visualized in Fig. 3 using the heuristic strategy (polynomial degree 2, 1024 elements for all models). Here, we take the value C = 1∕(b − a) where [a, b] is the domain on which the test problem is defined. Note that this thresholding technique is very accurate. However, many elements should be used to meet the asymptotic properties of the indicator.

Fig. 3
figure 3

Thresholding technique with heuristic approach: time-history plot of detected troubled cells, 1024 elements, polynomial degree 2, C = 1∕(b − a), with [a, b] the computational domain. (a) Sod’s shock tube. (b) Lax’s shock tube. (c) Blast-wave problem. (d) Shu-Osher problem

If the number of elements is taken smaller, then C should decrease to detect the correct features. In that case, it is difficult to guess the correct value of C. Another option is to use the a priori strategy for coarser meshes, see Fig. 4 (polynomial degree 2, 128 elements for Sod’s and Lax’s shock tube, and 512 elements for the blast-wave and Shu-Osher problem). If C = 1∕(b − a) is used, then this approach works well for Sod’s and Lax’s shock tube, but too many elements are detected for the blast-wave and the Shu-Osher problem. Also here, the value of C should be adapted to find the correct results.

Fig. 4
figure 4

Thresholding technique with a priori approach on coarser meshes: time-history plot of detected troubled cells, polynomial degree 2, C = 1∕(b − a), with [a, b] the computational domain. (a) Sod’s shock tube, 128 elements. (b) Lax’s shock tube, 128 elements. (c) Blast-wave problem, 512 elements. (d) Shu-Osher problem, 512 elements

5 Conclusions and Recommendations

In this paper, a new troubled-cell indicator was formed, based on the cancelation property for multiwavelets and the derived thresholding technique. Inspection of this technique reveals that it is very useful to design adaptive meshes [8]. For troubled-cell indication, we found out that detection is very accurate as long as a very fine mesh is used. For coarser meshes, it seems to be more useful to apply a different detection method. Furthermore, it is not straightforward how to choose the parameter C.

More research should be done to see in which way the cancelation property for multiwavelet coefficients can be used for the accurate detection of troubled cells. For example, it could be that this property also relates to the severity of the shocks.