1 Introduction

In practical applications, there are strong motivators for the adoption of unstructured meshes for handling complex geometries and using adaptive mesh refinement techniques. Based on this practical necessity, it is widely believed that discontinuous Galerkin methods, which provide high-order accuracy on unstructured meshes, will become one of the standard numerical methods for future generations. Along with the rapid growth of the DG method, the superconvergence of the DG method has become an area of increasing interest because of the ease with which higher order information can be extracted from DG solutions by applying smoothness-increasing and accuracy-conserving (SIAC) filtering. However, SIAC filters are still limited primarily to structured meshes. For general nonuniform meshes, the quality of the filtered solution is usually unsatisfactory. The ability to effectively handle nonuniform meshes is an obstacle to the further development of a SIAC filter.

This paper focuses on applying a SIAC filter for DG solutions over nonuniform meshes. Specifically, this study focuses on the barrier to applying SIAC filters over nonuniform meshes—the scaling. This problem was noted in [3], which extends a postprocessing technique for enhancing the accuracy of solutions [1] to linear hyperbolic equations. The postprocessing technique was renamed the Smoothness-Increasing Accuracy-Conserving filter in [5]. A series of studies of different aspects of SIAC filters are presented in [5, 11, 20]. For uniform meshes, it was shown that by applying a SIAC filter to a DG approximation at the final time, the accuracy order improves from \(k+1\) to \(2k+1\) for linear hyperbolic equations with periodic boundary conditions [3]. This superconvergence of order \(2k+1\) is promising; however it is limited to uniform meshes. Only for a particular family of nonuniform meshes, smoothly-varying meshes, have the filtered solutions been proven to have a superconvergence order of \(2k+1\) [20]. As for general nonuniform meshes, the preliminary theorem in [3] provides a solution, but it is not very useful in practice. The filtered solutions can still be improved. Further, the computational results for relatively unstructured triangular meshes [12] suggest that it is possible to reduce the errors of the DG solutions through a suitable choice of filter scalings for approximations defined over unstructured meshes. However, in [12] there is no clear accuracy order improvement and no guarantee of error reduction. Also, the lack of theoretical analysis makes it difficult to evaluate the quality of the filtered solutions. There has been some work related this topic, such as the nonuniform filter proposed in [15, 16].

The primary goal of this paper is to address these challenges and try to improve the quality of the DG solutions over general nonuniform meshes. Our main contributions are:

Optimal accuracy First, we study the error estimates of the SIAC filter for uniform and nonuniform meshes and point out the difficulties for the filter over nonuniform meshes. Then, we computationally establish for the first time a relation between the filtered solutions and the unstructuredness of nonuniform meshes. Further, we demonstrate that for a given nonuniform mesh, there exists an optimal accuracy (optimal error reduction) of the filtered solution.

Optimal scaling To approximate this optimal accuracy, we first analyze the relation between the filter scaling and the error of filtered solutions for different nonuniform meshes. Then, we introduce a measure of the unstructuredness of nonuniform meshes and propose a procedure that adjusts the scaling of a SIAC filter according to the unstructuredness of the given nonuniform mesh. Also, we demonstrate that with the newly designed optimal scaling, the filtered solution has a higher accuracy order, and the errors are reduced compared to the original DG solutions even for the worst nonuniform meshes.

Scaling performance validation Finally, to ensure the proposed scaling is a robust algorithm that can be used in practice, we validated the performance of the proposed scaling over a large number of nonuniform meshes and compared with other commonly used scalings to illustrate that the accuracy of the DG solution is improved by using the proposed scaling and its superiority compared to existing methods.

This paper is organized as follows. In Sect. 2, we review the DG method and SIAC filters as well as the relevant properties. In Sect. 3, we investigate the effects of the filter scaling on the accuracy of the filtered solution. We then introduce a measure of the unstructuredness of nonuniform meshes and provide an algorithm to approach the optimal accuracy in Sect. 4. Also, in Sect. 4, we provide a scaling performance validation for the proposed scaling along with other commonly used scalings. Numerical results for different one- and two-dimensional nonuniform meshes are given in Sect. 5. The conclusions are presented in Sect. 6.

2 Background

In this section, we review the necessary properties of discontinuous Galerkin methods, the definition of nonuniform meshes for the purposes of this article, and the Smoothness-Increasing Accuracy-Conserving (SIAC) filter.

2.1 Construction of Nonuniform Meshes

Before introducing the discontinuous Galerkin method, we introduce the structure of the nonuniform meshes that will be used in this paper. The main construction of the nonuniform meshes are similar to those meshes used in [11]:

Mesh 2.1

$$\begin{aligned} x_{\frac{1}{2}} = 0,\quad x_{N+\frac{1}{2}} = 1,\quad x_{j+\frac{1}{2}} = \left( j + b\cdot r_{j+\frac{1}{2}}\right) h, \qquad j = 1,\ldots ,N-1 \end{aligned}$$

where \(\left\{ r_{j+\frac{1}{2}}\right\} ^{N-1}_{j=1}\) are random numbers between \((-1, 1)\), and \(b \in (0,0.5]\) is a constant number. Here, \(h = \frac{x_{N+\frac{1}{2}} - x_{\frac{1}{2}}}{N}\) is a function of N, in this way, one can reduce the structure added by increasing the number of elements. The size of element \(\Delta x_j= x_{j+\frac{1}{2}} - x_{j-\frac{1}{2}}\) is between \(((1-2b)h,(1+2b)h)\). In order to save space, we present an example with \(b = 0.4\) only. Other values of b such as 0.1, 0.2 and 0.45 have also been studied and are consistent with the results presented herein.

Mesh 2.2

We distribute the element interface, \(x_{j+\frac{1}{2}},\,j=1,\ldots ,N-1,\) randomly for the entire domain and only require

$$\begin{aligned} \Delta x_{j} = x_{j+\frac{1}{2}} - x_{j-\frac{1}{2}} \ge b\cdot h, \qquad j = 0,\ldots ,N. \end{aligned}$$

In this paper (except the performance tests in Sect. 4), we present the case where \(b=0.5\) for this mesh. Other values of b such as 0.6, 0.8 have also been studied and are consistent with the results presented herein.

Remark 2.3

Mesh 2.1 is a quasi-uniform mesh since \(\frac{\Delta x_{\max }}{\Delta x_{\min }} \le \frac{1+2b}{1-2b}\). Mesh 2.2 is more unstructured than Mesh 2.1 since in the worst case \(\frac{\Delta x_{\max }}{\Delta x_{\min }} \approx \frac{1-b}{b}N\) which is unbounded as \(N \rightarrow \infty \). It is expected that the DG approximation and the filtered solution are of better quality for Mesh 2.1 than for Mesh 2.2. Illustrations of these meshes are given in Fig. 1.

Fig. 1
figure 1

Illustration of Meshs 2.1 and 2.2. Here the largest-to-smallest element ratio is about 4.5 for Mesh 2.1 (top), and 33.1 for Mesh 2.2 (bottom)

We will analyze the applicability of the SIAC filter scaling factor utilizing these meshes.

2.2 Discontinuous Galerkin Methods

Here, we briefly describe the discontinuous Galerkin method; more details can be found in [2, 4]. As an illustrative example, we consider a multi-dimensional linear hyperbolic equation of the form

$$\begin{aligned} u_t+\sum \limits _{i=1}^{d}A_i u_{x_i} + A_0 u= & {} 0, \qquad ({\mathbf {x}},t)\in \Omega \times [0,T], \nonumber \\ u({\mathbf {x}},0)= & {} u_0({\mathbf {x}}), \end{aligned}$$
(2.1)

where \(u_0\) is sufficiently smooth, the coefficients \(A_i\) are constants and \(\Omega = [a_1,b_1]\times \cdots \times [a_d, b_d]\subset {\mathbb {R}}^d\). Let K represent an element in a quadrilateral tessellation \({\mathcal {T}}_h\) of the domain \(\Omega \). Discontinuous Galerkin methods seek an approximation \(u_h\) in the space of piecewise polynomials of degree \(\le k\),

$$\begin{aligned} V^k_h = \left\{ \varphi :\,\varphi |_{K} \in {\mathbb {P}}^k,\quad \forall K \in {\mathcal {T}}_h\right\} , \end{aligned}$$

and the DG approximation \(u_h\) is determined by the scheme

$$\begin{aligned} \left( (u_h)_t, v_h\right) _{K} - \sum \limits _{i=1}^{d}(a_i u_h, (v_h)_{x_i})_{K} + \sum \limits _{i=1}^{d}\int _{\partial K} a_i{\hat{u}}_h v_h n_i ds + (a_0 u_h, v_h)_K= 0, \end{aligned}$$
(2.2)

for any \(v_h \in V^k_h\), and \({\hat{u}}_h\) is the flux. For the results presented in this paper, we have utilized one particular choice—the upwind flux. Here, (fg) denotes the standard inner product:

$$\begin{aligned} (f,g)_K = \int _K\, f g\, dK. \end{aligned}$$

2.3 Superconvergence in the Negative Order Norm

The DG method has many important properties. The most relevant property for the purposes of this paper are the accuracy order of the divided differences of the DG approximation. In the \(L^2\) norm it is \(k+1\) which aides in proving the superconvergence of order \(2k+1\) in the negative order norm. These properties are the theoretical foundations of SIAC filters (see [3, 11]) and define the choice of the number of B-splines in the SIAC convolution kernel. To highlight this connection, the error of filtered solution can be viewed a linear combination of the errors from the choice of the number of B-splines used in the filter as well as the discretization error,

$$\begin{aligned} \Vert u - u_h\Vert _0 \le \underbrace{C_1H^{2k+1}}_{\text {Number of B-Splines}} + C_2\underbrace{\Vert \partial _H^\alpha (u-u_h)\Vert _{-(k+1)}}_{\text {Discretization Error}}. \end{aligned}$$

This is discussed further in Sect. 3.2. Because of the importance of the divided differences in the error estimates, in this section, we first discuss the properties of the divided difference of DG approximation. For uniform meshes, the main theorem is given below.

Theorem 2.1

(Cockburn et al. [3]) Let u be the exact solution of Eq. (2.1) with periodic boundary conditions, and \(u_h\) the DG approximation derived by scheme (2.2). For a uniform mesh, the approximation and its divided differences in the \(L^2\) norm are:

$$\begin{aligned} \Vert \partial _h^{\alpha } (u-u_h)\Vert _{0,\Omega } \le C h^{k+1}, \end{aligned}$$
(2.3)

and in the negative order norm:

$$\begin{aligned} \Vert \partial _h^{\alpha } (u-u_h)\Vert _{-(k+1),\Omega } \le C h^{2k+1}, \end{aligned}$$
(2.4)

where \(\alpha = (\alpha _1, \ldots ,\alpha _d)\) is an arbitrary multi-index and h is the diameter of the uniform elements.

This theorem is valid assuming that the exact solution has sufficient regularity (belongs to a Hilbert space of order \(2k+2\)). Unfortunately, the error estimates of the DG approximation and its divided differences for nonuniform meshes become much more challenging, and for this case the estimates (2.3) and (2.4) are valid only for the DG approximation itself, that is,

Lemma 2.2

(Cockburn et al. [3]) Under the same conditions as in Theorem 2.1. The DG approximation for a nonuniform mesh satisfies

$$\begin{aligned} \Vert u-u_h\Vert _{0,\Omega } \le C h^{k+1}, \end{aligned}$$

and in the negative order norm:

$$\begin{aligned} \Vert u - u_h\Vert _{-(k+1),\Omega } \le C h^{2k+1}. \end{aligned}$$
(2.5)

For the divided differences, \(\partial _h^\alpha u_h\), for nonuniform meshes, instead of (2.4), we have only the following lemma:

Lemma 2.3

Under the same conditions as in Lemma 2.2, given a constant scaling H, for nonuniform meshes, the divided differences of the DG approximation in the \(L^2\) norm satisfies

$$\begin{aligned} \Vert \partial ^{\alpha }_H(u - u_h)\Vert _{0,\Omega } \le C_\alpha h^{2k+1} H^{-|\alpha |}, \end{aligned}$$

and in the negative order norm:

$$\begin{aligned} \Vert \partial ^{\alpha }_H(u - u_h)\Vert _{-(k+1),\Omega } \le C_\alpha h^{2k+1} H^{-|\alpha |}, \end{aligned}$$

where \(\alpha = (\alpha _1,\ldots ,\alpha _d)\) is an arbitrary multi-index.

Proof

c.f. [11, 14]. \(\square \)

Remark 2.4

Lemma-2.3 was first introduced as a conjecture in [3], and presented as a lemma with proof in [11]. In this paper, h is defined during the construction of Meshs 2.1 and 2.2, \(h = \frac{x_{N+\frac{1}{2}} - x_{\frac{1}{2}}}{N}\) is a function of the element N. Here, we note that Lemma 2.3 is valid for arbitrary constant H, but we will discuss how to choose the optimal scaling H in the following sections.

The relation between the \(L^2\) norm and the negative order norms are introduced in the following lemma:

Lemma 2.4

(Bramble and Schatz [1]) Let \(\Omega _0 \subset \subset \Omega _1\) and s be an arbitrary but fixed nonnegative integer. Then for \(u \in H^s(\Omega _1)\), there exists a constant C such that

$$\begin{aligned} \Vert u\Vert _{0,\Omega _0} \le C \sum \limits _{|\alpha |\le s}\Vert D^\alpha u\Vert _{-s,\Omega _1}. \end{aligned}$$

In Table 1, we provide a basic example of the divided difference operation over a nonuniform mesh (randomly chosen among Meshes 2.2). In this table, \({\mathcal {P}}u\) is the \(L^2\) projection of \(u(x,0)=\sin (x)\) over a randomly generated nonuniform mesh. From Table 1, we can see that for \(\alpha \ge 1\), the divided differences \(\partial ^\alpha _h {\mathcal {P}}u\) only have accuracy order of \(k+1-\alpha \). This example clearly suggests that the nonuniform mesh estimate (2.5) no longer holds, and the estimates in Lemma 2.3 can not be improved without further assumptions on the nonuniformity of the mesh.

Remark 2.5

In this paper, the main results are based on the \(L^2\) norm. However, we also included the numerical results in the \(L^\infty \) norm for consistency with existing literature.

Table 1 \(L^2-\) and \(L^{\infty }-\)errors for the \(L^2\) projection of \(u(x,0) = \sin (x)\) and its divided differences over a randomly generated nonuniform mesh

2.4 SIAC Filter

We use the classical SIAC filter that stems from the work of Bramble and Schatz [1], Thomée [22] and Mock and Lax [14]. An extension of this technique to discontinuous Galerkin methods was introduced in [3]. Motivated by [3], a series of publications have studied SIAC filtering for DG methods from various aspects, such as [5, 12, 18, 19, 21].

SIAC filtering is applied only at the final time T of the DG approximation, and the filtered solution \(u_h^\star \), in the one-dimensional case is given by

$$\begin{aligned} u_h^{\star }(x, T) = \left( K_H^{(2r+1,\ell )}\star u_h\right) (x, T)= \int _{-\infty }^{\infty }K_H^{(2r+1,\ell )}(x - \xi )u_h(\xi , T) d\xi , \end{aligned}$$

where the filter, \(K^{(2r+1,\ell )}\), is a linear combination of central B-splines,

$$\begin{aligned} K^{(2r+1,\ell )}(x) = \sum \limits _{\gamma =0}^{2r}c^{(2r+1,\ell )}_{\gamma }\psi ^{(\ell )}\left( x - \left( -\frac{r}{2}+\gamma \right) \right) , \end{aligned}$$
(2.6)

and the scaled filter is \(K_H^{(2r+1,\ell )}(x) = \frac{1}{H}K^{(2r+1,\ell )}\left( \frac{x}{H}\right) \) with scaling H (\(H = h\) for uniform meshes). Here, \(\psi ^{(\ell )}(x)\) is the \(\ell \) order central B-spline, which can be constructed recursively using the relation

$$\begin{aligned} \psi ^{(1)}= & {} \chi _{[-1/2,1/2)}(x), \nonumber \\ \psi ^{(\ell )}(x)= & {} \frac{1}{\ell -1}\left( \frac{\ell }{2}+x\right) \psi ^{(\ell -1)}\left( x+\frac{1}{2}\right) \nonumber \\&+ \frac{1}{\ell -1}\left( \frac{\ell }{2}-x\right) \psi ^{(\ell -1)}\left( x-\frac{1}{2}\right) ,\quad \ell \ge 2. \end{aligned}$$
(2.7)

Typically, the number of B-splines is chosen as \(2r+1 = 2k+1\), and the order of B-splines is chosen as \(\ell = k+1\). In the remainder of the paper, we use \(2k+1\) B-splines of order \(k+1\). The coefficients, \(c^{(2r+1,\ell )}_{\gamma }\), are calculated by enforcement of the property that the filter reproduces polynomials by convolution up to degree 2r,

$$\begin{aligned} K^{(2r+1,\ell )} \star p = p, \quad p = 1, x,\ldots , x^{2r}. \end{aligned}$$
(2.8)

Later on we will need the following lemma

Lemma 2.5

Let 2r be an even number, then the SIAC filter \(K^{(2r+1,\ell )}\) given in (2.6), which satisfies (2.8), reproduces polynomials by convolution until degree of \(2r+1\),

$$\begin{aligned} K^{(2r+1,\ell )} \star p = p,\quad p = 1, x, \ldots , x^{2r+1}. \end{aligned}$$
(2.9)

Proof

c.f. [23]. \(\square \)

In the multidimensional case, the multidimensional filter is the tensor product of the one-dimensional filter (2.6)

$$\begin{aligned} {\mathbf {K}}^{(2r+1,\ell )}_H({\mathbf {x}}) = \prod \limits _{i=1}^{d}K^{(2r+1,\ell )}_H(x_i), \qquad {\mathbf {x}} = (x_1, \ldots , x_d) \in {\mathbb {R}}^d, \end{aligned}$$

with the scaled filter \({\mathbf {K}}^{(2r+1,\ell )}_H({\mathbf {x}}) = \frac{1}{H^d}K^{(2r+1,\ell )}\left( \frac{{\mathbf {x}}}{H}\right) \). A computationally efficient alternative to the tensor product case is to use the Hexagonal SIAC filter (HSIAC) by Mirzarger et al. [13], or the Line SIAC filter introduced by Docampo et al. [6] and applied to problems in visualization problems by Jallepalli et al. [9].

3 SIAC Filter for Nonuniform Meshes

In order to design a more accurate SIAC filter for nonuniform meshes, we have to investigate the relations between the DG approximation and SIAC filters for nonuniform meshes.

3.1 Existing Results

As mentioned in [3, 10], for uniform meshes, SIAC filtering can improve the accuracy order of DG solutions for linear hyperbolic equations from \(k+1\) to \(2k+1\) when a sufficient number of B-splines are chosen. This accuracy order, \(2k+1\), and various studies of SIAC filters, such as position-dependent filters [19, 24], the derivative filter [18], etc., are limited to uniform meshes. For nonuniform meshes, the aims of improving the accuracy order and reducing the errors of the DG solution remains an ongoing challenge for SIAC filtering. Most preliminary results consider only a particular family of meshes, smoothly varying meshes [5, 17, 20]. It was proven in [20] that the filtered solutions also have an accuracy order of \(2k+1\) for smoothly varying meshes. However, for general nonuniform meshes, there are only a few computational results [12], and the only theoretical estimates were given in [3, 11].

Theorem 3.1

Under the same conditions as in Lemma 2.2, denote \(\Omega _0 + 2supp(K_H^{(2k+1,k+1)})\subset \subset \Omega _1 \subset \subset \Omega \). Then, for general nonuniform meshes, we have

$$\begin{aligned} \Vert u - K^{(2k+1,k+1)}_H\star u_h\Vert _{0,\Omega _0} \le C h^{\mu (2k+1)}, \end{aligned}$$

where the scaling H is chosen as

$$\begin{aligned} H = h^{\mu }, \quad \mu = \frac{2k+1}{3k+2}. \end{aligned}$$
(3.1)

Proof

c.f. [3, 11]. \(\square \)

For convenience, in this paper we refer to \(\mu \) as the scaling order and \(\mu _0 = \frac{2k+1}{3k+2}\). Theorem 3.1 gives a useful scaling that allows us to enhance the accuracy of the DG solution, especially the derivatives of the DG solution [11], but may not be optimal.

However, from the perspective of improving the DG approximation itself, satisfying the requirements of Theorem 3.1 can be cumbersome. For example, the accuracy order will be higher than the original DG approximation only if \(k \ge 2\):

$$\begin{aligned} \mu _0(2k+1) > k+1 \quad \Rightarrow \quad k \ge 2 \,(k \in {\mathbb {Z}}). \end{aligned}$$

If, alternatively, at least one order higher accuracy order is desired, then \(k \ge 5\):

$$\begin{aligned} \mu _0(2k+1) \ge k+2 \quad \Rightarrow \quad k \ge 5 \, (k \in {\mathbb {Z}}). \end{aligned}$$

Another important issue is the computational efficiency. As discussed in [11] when h is small (a fine mesh), the filter scaling \(H = h^{\mu _0}\ge h^{2/3}\) dramatically increases the support size of the filter. To post-process one position in the domain, the post-processor has a support of \((3k+2)H.\) It follows that by choosing \(\mu <1,\) the computational cost dramatically increases.

More importantly, instead of increasing the accuracy order, practical applications are more concerned with reducing the error. Although using the scaling \(H = h^{\mu _0}\) improves the accuracy order, many practical examples suggest that using a scaling order of \(\mu _0\) usually increases the errors. For example, for the numerical experiments given in this paper (Sect. 5), the filtered solutions that use a scaling order of \(\mu _0\) have a qualitatively worse error in the \(L^2\) norm compared to the original DG solutions.

3.2 The Optimal Accuracy

Although Theorem 3.1 holds for arbitrary nonuniform meshes, the filtered solutions based on the filter scaling \(H = h^{\mu _0}\) does not achieve expectations with respect to order improvement, error reduction and computational efficiency. The problem stems from the crude estimate of the scaling order \(\mu _0\) that ignores the mesh structure. In order to improve Theorem 3.1, it is necessary to reconsider the filter scaling for nonuniform meshes. To complete this task, we first explore the relation between the filter scaling and the error of the filtered solution. We remind the reader that in this paper, H represents the filter scaling and h represents the mesh size. As given in [3], we can write the error estimate of the filtered solution as

$$\begin{aligned} \Vert u - u^\star _h\Vert _{0,\Omega _0} \le \Theta _1 + \Theta _2, \end{aligned}$$
(3.2)

where

$$\begin{aligned} \Theta _1 = \Vert u - K_H^{(2k+1,k+1)}\star u\Vert _{0,\Omega _0} \le C_1 H^{2k+2}|u|_{H^{2k+2}}, \end{aligned}$$
(3.3)

and

$$\begin{aligned} \Theta _2= & {} C_0\sum \limits _{|\alpha |\le k+1}\Vert D^\alpha K^{(2k+1,k+1)}_H\star (u-u_h)\Vert _{-(k+1),\Omega _{1/2}}\nonumber \\\le & {} C_0C_1 \sum \limits _{|\alpha |\le k+1}\Vert \partial _H^\alpha (u-u_h)\Vert _{-(k+1)\Omega _1}, \end{aligned}$$
(3.4)

by Lemmas 2.5 and 2.4, where

$$\begin{aligned} \Omega _0 + supp(K_H^{(2k+1,k+1)})\subset \Omega _{1/2},\quad \Omega _{1/2} + supp(K_H^{(2k+1,k+1)}) \subset \Omega _1. \end{aligned}$$

According to the above estimates, the error is bounded by \(\Theta _1\) and \(\Theta _2\), where \(\Theta _1\) describes the error generated by reproducing polynomials and \(\Theta _2\) represents the error in the negative order norm.

The estimate for \(\Theta _1\) is clear. The error is given by the polynomial reproduction property (2.9) and the exact solution u. It is obvious from (3.3) that \(\Theta _1\), only depends on the filter scaling and is bounded by \(C_1 H^{2k+2}|u|_{H^{2k+2}}\). This bound increases with the scaling H.

The \(\Theta _2\) term is more challenging. Lemma 2.3 gives an estimate of \(\Vert \partial _H^\alpha (u - u_h)\Vert _{-(k+1),\Omega _1}\) for nonuniform meshes,

$$\begin{aligned} \Vert \partial _H^\alpha (u - u_h) \Vert _{-(k+1),\Omega _1} \le C h^{2k+1}H^{-|\alpha |}. \end{aligned}$$
(3.5)

The above estimate holds for arbitrary nonuniform meshes, but it is not the optimal bound for many meshes. For example, consider the smoothly-varying meshes used in [5, 11, 20]. For these types of meshes, a better estimate is

$$\begin{aligned} \Vert \partial _H^\alpha (u - u_h) \Vert _{-(k+1),\Omega _1} \le C h^{2k+1} \end{aligned}$$

for well chosen H, see [20]. Clearly, one can guess that the accurate bounds of \(\Theta _2\) are very different between an almost uniform mesh and a totally random mesh, but the current estimate (3.5) fails to relize this relation (the relation between \(\Theta _2\) and the unstructuredness of the mesh). Also, from the existing results in [5, 11, 12, 20], one can see that the \(\Theta _2\) term is strongly dependent on the unstructuredness of the mesh. However, based on [3], the estimate (3.5) suggests that there is a trend that \(\Theta _2\) decreases with the scaling H. See Fig. 2 for numerical evidence.

In this paper, we seek to obtain the minimized error of the filtered solution with respect to the scaling order \(\mu \). To do this, we need to find a proper scaling order \(\mu \) (assuming \(H = h^\mu \)) such that \(\Theta _1 = \Theta _2\). As mentioned in [3], in the worst case the scaling order \(\mu = \mu _0 = \frac{2k+1}{3k+2} \ge 0.6\) , and in the best case \(\mu \approx 1\). We examine the \(L^2\) and \(L^\infty \) errors with scaling order \(\mu \) in the range of [0.6, 1] for two nonuniform meshes: Meshs 2.1 and 2.2. Figure 2 shows the variations when \(\mu \) increases from 0.6: the error is first reduced until a minimum error is achieved and then the error starts to rise again. We can see that the minimized error in the \(L^2\) and \(L^\infty \) norms correspond to the different scaling orders \(\mu \); see also Table 2. Since the theoretical estimates are based on the \(L^2\) norm, in the following we define the concept of the optimal accuracy based on the \(L^2\) norm.

Definition 3.1

(Optimal Accuracy) For a given mesh, the optimal accuracy of the filtered solution is given by

$$\begin{aligned} \min \limits _{0 \le H \le 1} \Vert u - K_H^{(2k+1,k+1)}\star u_h\Vert _0. \end{aligned}$$
(3.6)

The scaling H that minimizes the error is referred to as the optimal scaling and denoted as \(H^{\star },\) where the optimal scaling order \(\mu ^{\star }\) is defined as \(H^\star = h^{\mu ^\star }\). Note:

  • When \(H = 0\), the filter \(K_H^{(2k+1,k+1)}\) degenerates to the delta function and we have

    $$\begin{aligned} \Vert u - K_H^{(2k+1,k+1)} \star u_h\Vert _0 = \Vert u - \delta \star u_h\Vert _0 = \Vert u - u_h\Vert _0. \end{aligned}$$

    In this sense, the optimal accuracy is at least as good as the original DG accuracy.

  • Since \(H \in [0, 1]\) and \(\Vert u - K_H^{(2k+1,k+1)}\star u_h\Vert _0\) is continuous respect to H, the minimum of (3.6) must exist.

Remark 3.1

We can also define the optimal accuracy based on different norms, such as the \(L^\infty -\)norm, or even different filters, but it will lead to different optimal scaling order \(\mu ^\star \).

Fig. 2
figure 2

The \(L^2\) and \(L^\infty \) errors in log scale of the filtered solutions with various scaling \(H = h^\mu \), \(\mu \in [0.6, 1.0]\). The black dashed line marks the location of \(\mu _0 = \frac{2k+1}{3k+2}\). The DG approximation is for the linear equation (5.1) with polynomials of degree \(k = 2, 3\) for Meshs 2.1 and 2.2

Table 2 The optimal scaling order \(\mu ^\star \) with respect to Meshs 2.1 and 2.2 with \(N = 20, 40, 80, 160\), based on the linear equation (5.1) with periodic boundary conditions

3.2.1 The Convergence Rate

In Fig. 2, plots of the \(L^2\) and \(L^\infty \) error versus the scaling \(h^\mu \) are given for \(0.6 < \mu \le 1.\) A dashed line is given at the value \(\mu _0 = \frac{2k+1}{3k+2}\). We remind the reader that based on (3.3), the design of the filter leads to

$$\begin{aligned} \Theta _1 \sim {\mathcal {O}}(H^{2k+2}). \end{aligned}$$

When \(\mu \) is decreasing, \(H = h^\mu \) is increasing, then the \(\Theta _1\) term becomes dominant once \(\mu \) becomes small. We can also observe this from Fig. 2, once \(\mu < \mu ^\star \), the errors of the filtered solutions are dominated by the \(\Theta _1\) term in (3.3), which has a convergence rate of \(\mu (2k+2)\) (before the minimum occurs in the convergence plots). Table 7 show the results of using \(\mu \) such that \(\mu _0< \mu < \mu ^\star \). However, as we mentioned earlier, the \(\Theta _2\) term (Eq. (3.4)) is challenging. Figure 2 demonstrates once \(\mu > \mu ^\star \), the errors of the filtered solutions have a trend to increase with \(\mu \), which means the \(\Theta _2\) has the same trend to increase for \(\mu ^\star< \mu < 1\) (if \(\mu \rightarrow \infty \), the filtered errors degenerate to the DG errors). In short, Fig. 2 together with Tables 2 and 7 show that with a proper scaling (or scaling order \(\mu \)), the filtered solutions have a higher accuracy order, and the errors are reduced compared to the original DG solutions. We also compare the results to the filtered solutions that use a scaling order \(\mu _0\) to demonstrate the improvement of using scaling order \(\mu > \mu _0\). Further, we point out that for the different nonuniform meshes, the value of \(\mu ^\star \) will be different, see Fig. 2. In the next section, we will mainly concentrate on the given nonuniform mesh only, to find the optimal accuracy (or \(\mu ^\star \)) of the filtered solutions over the given nonuniform mesh.

4 The Unstructuredness of Nonuniform Meshes

In Sect. 3, we proposed the concept of the optimal accuracy and numerically demonstrated that there exists an optimal scaling order \(\mu ^\star \) such that using the optimal scaling, \(H^\star = h^{\mu ^\star },\) minimizes the error of the filtered solutions in the \(L^2\) norm. Then, the remaining question is how to find \(\mu ^\star \) for a given nonuniform mesh. Table 2 provides \(\mu ^\star \) by testing different values of the scaling, which is certainly impractical. Theoretically, even for uniform meshes whose optimal scaling order is \(\mu ^\star \approx 1\), it is impossible to find the exact value of \(\mu ^\star \). However, in this section, we propose an approximation \(\mu _h\) that is sufficiently close to \(\mu ^\star \) and leads to filtered solutions with improved quality.

An important observation from Fig. 2 for determining \(\mu ^\star \) is that the optimal scaling order depends on the structure of the nonuniform meshes, and hence the optimal scaling order is different. The rule of thumb is that the more unstructured the mesh, the smaller the value of \(\mu ^\star \). In order to approximate the value of \(\mu ^\star \), it is important to define a measure of the unstructuredness of nonuniform meshes.

4.1 The Measure of Unstructuredness of Nonuniform Meshes

Before discussing the unstructuredness, we first provide a definition of structured meshes.

Definition 4.1

(Structured Mesh) A mesh with N elements is considered structured if there exists a function \(f \in {\mathcal {C}}^{\infty }\) and \(f' > 0\), such that

$$\begin{aligned} x_{j+\frac{1}{2}} = f(\xi _{j+\frac{1}{2}}), \quad \forall j = 0,\ldots ,N, \end{aligned}$$
(4.1)

where \(\left\{ \xi _{j+\frac{1}{2}}\right\} _{j=0}^N\) corresponds to a uniform mesh with N elements over the same domain.

According to [20], filtered solutions for structured meshes have the same accuracy order (\(2k+1\) for linear hyperbolic equations) as for uniform meshes.

Now we introduce a new parameter \(\sigma \), the unstructuredness of the nonuniform mesh, to measure the difference between the given nonuniform mesh and a structured mesh with the same number of elements.

Definition 4.2

(Unstructuredness) For a nonuniform mesh \(\left\{ x_{j+\frac{1}{2}}\right\} ^{N}_{j=0}\), its unstructuredness \(\sigma \) is given by

$$\begin{aligned} \sigma = \inf \limits _{f \in {\mathcal {C}}^\infty , f' > 0}\left( \sum \limits _{j=0}^{N}\left( f(\xi _{j+\frac{1}{2}}) - x_{j+\frac{1}{2}}\right) ^2/(N+1)\right) ^{\frac{1}{2}}, \end{aligned}$$
(4.2)

where \(\left\{ \xi _{j+\frac{1}{2}}\right\} _{j=0}^N\) corresponds to the uniform mesh with N elements for the same domain. The smaller the \(\sigma \), the more structured the mesh.

Without loss of generality, we denote the domain \(\Omega = [0,1]\). Then, in the worst case, we have

$$\begin{aligned} \left( \sum \limits _{j=0}^{N}\frac{\left( f(\xi _{j+\frac{1}{2}}) - x_{j+\frac{1}{2}}\right) ^2}{N+1}\right) ^{\frac{1}{2}}< \left( \sum \limits _{j=0}^{N} \frac{(1-0)^2}{N+1}\right) ^{\frac{1}{2}} = 1 \Rightarrow \sigma < 1. \end{aligned}$$

Remark 4.1

The definition of unstructuredness is designed by considering the discrete \(L^2\) norm formula. It is a natural choice since the focus is on the error in the \(L^2\) norm. Furthermore, it establishes a connection between general nonuniform meshes and the well-studied structured meshes. Besides formula (4.2), there are different ways to identify the unstructuredness of the mesh, such as through the variation of mesh elements [8], utilizing different norms, or the methods mentioned in Appendix.

4.2 SIAC Filtering Based on Unstructuredness

After defining the unstructuredness, \(\sigma \), we now study the relation of \(\sigma \) and the filter scaling, which allows for determining \(\mu _h\). This depends on two very challenging estimates: that of the negative-order norm and that of the divided differences over a nonuniform mesh. Note that for the divided difference with a general scaling H, \(u_h(x + \frac{H}{2})\) and \(u_h(x - \frac{H}{2})\) are not in the same approximation space even for uniform meshes. Since the translation invariance with respect to both the DG mesh size h and the scaling H, for uniform meshes, one has to let the scaling H satisfies that \(H = mh\) (m is a positive integer) to keep \(u_h(x + \frac{H}{2})\) and \(u_h(x - \frac{H}{2})\) in the same space. Therefore, it is difficult to establish a rigorous error estimates. In Theorem 3.1, a rough error estimate of \(\partial _H u_h\) is obtained by using the bound

$$\begin{aligned} \Vert \partial _H(u - u_h)\Vert _0\le & {} \frac{1}{H}\left( \left\| (u - u_h)\left( x + \frac{H}{2}\right) \right\| _0 + \left\| (u - u_h)\left( x - \frac{H}{2}\right) \right\| _0\right) \nonumber \\\le & {} \frac{2}{H}\Vert u - u_h\Vert _0. \end{aligned}$$

This does not take into the unique unstructuredness of a given mesh. Further, as demonstrated in the previous section, the result is not optimal. Here, in this paper, we are seeking a robust algorithm which is useful in a practical setting to obtain error reduction.

In this section, we propose a method based on relating the nonuniform mesh to its closest structured mesh (under Definition (4.2)). That is,

$$\begin{aligned} \underbrace{\left\| \partial _H(u-u_h)\right\| _{0}}_{\text {nonuniform mesh}} \le \underbrace{\left\| \partial _H(u-u_h)\right\| _{0, f(\xi )}}_{\text {structured mesh}} + \underbrace{\left\| \partial _H(u-u_h)\right\| _{0, \text {diff}}}_{\text {difference}}. \end{aligned}$$

As mentioned earlier [20], we know that the first divided difference over the structured mesh \(\left\{ f(\xi _{j+\frac{1}{2}})\right\} _{j=0}^N\) has nice properties. Then, we assume that the error of the first divided difference of the DG solution for the nonuniform mesh \(\left\{ x_{j+\frac{1}{2}}\right\} _{j=0}^N\) is dominated by the difference between the nonuniform mesh and its closest structured mesh.

Now, consider the difference term \(\left\| \partial _H(u-u_h)\right\| _{0, \text {diff}}\), we have

$$\begin{aligned} \left\| \partial _H(u-u_h)\right\| _{0, \text {diff}} = \frac{2}{H}\left( \sum \limits _{j=0}^{N}\left\| u - u_h\right\| ^2_{0,\Omega _j}/(N+1)\right) ^{\frac{1}{2}}, \end{aligned}$$

where \(\Omega _j = [x_{j+\frac{1}{2}}, f(\xi _{j+\frac{1}{2}})]\) (or \(\Omega _j = [f(\xi _{j+\frac{1}{2}}),x_{j+\frac{1}{2}}]\)). Since the approximation \(u_h\) on the interval \(\Omega _j\) cannot be estimated rigorously through the traditional error estimates, we assume that

$$\begin{aligned} \left\| u - u_h\right\| ^2_{0,\Omega _j} = \int _{\Omega _j}(u-u_h)^2 dx\le & {} C \left| \Omega _j\right| \Vert u - u_h\Vert _{\infty }^2 \nonumber \\= & {} C \left| x_{j+\frac{1}{2}} - f(\xi _{j+\frac{1}{2}})\right| h^{2k+2}. \end{aligned}$$
(4.3)

The above assumption is based on \(L^\infty \) estimate that

$$\begin{aligned} \Vert u - u_h\Vert _{\infty } \le C h^{k+1}, \end{aligned}$$

which has not been proven theoretically, but validate numerically for rectangular meshes (the meshes considered in this paper). For general unstructured triangular meshes, a reduced accuracy order of \({\mathcal {O}}(h^{k+1-\frac{d}{2}})\) needs to be considered. Then, by using the Cauchy–Schwarz inequality, we have

$$\begin{aligned} \begin{aligned} \left\| \partial _H(u-u_h)\right\| _{0, \text {diff}} =\,&\frac{2}{H}\left( \sum \limits _{j=0}^{N}\left\| u - u_h\right\| ^2_{0,\Omega _j}/(N+1)\right) ^{\frac{1}{2}} \\ \le \,&C h^{k+1}H^{-1}\left( \sum \limits _{j=0}^{N}\left| x_{j+\frac{1}{2}} - f(\xi _{j+\frac{1}{2}})\right| /(N+1)\right) ^{\frac{1}{2}} \\ =\,&C h^{k+1}H^{-1}\left\{ \left( \sum \limits _{j=0}^{N}\left( f(\xi _{j+\frac{1}{2}}) - x_{j+\frac{1}{2}}\right) ^2/(N+1)\right) ^{\frac{1}{2}}\right\} ^{\frac{1}{2}}. \end{aligned} \end{aligned}$$

By using Definition (4.2) and the assumption that \(\left\| \partial _H(u-u_h)\right\| _{0, \text {diff}}\) is the dominant term, we obtain

$$\begin{aligned} \left\| \partial _H(u-u_h)\right\| _{0} \le C \frac{\sqrt{\sigma }}{H} h^{k+1} = C \frac{h^{\frac{1}{2}\log _h\sigma }}{H} h^{k+1}, \end{aligned}$$
(4.4)

and by induction

$$\begin{aligned} \left\| \partial ^\alpha _H(u-u_h)\right\| _{0} \le C \frac{\sqrt{\sigma }}{H} h^{k+1} = C \left( \frac{h^{\frac{1}{2}\log _h\sigma }}{H}\right) ^\alpha h^{k+1}. \end{aligned}$$
(4.5)

Remark 4.2

The above analysis is the motivation for using formula (4.2) to define the unstructuredness. Also, we point out that assumption (4.3) is an empirical rather than a rigorous estimate. Furthermore, the assumption that \(\left\| \partial _H(u-u_h)\right\| _{0, \text {diff}}\) dominates \(\left\| \partial _H(u-u_h)\right\| _{0}\) is reasonable only when the nonuniform mesh is not so close to the respective structured mesh (\(\sigma \gg 0\)).

Based on the value of \(\sigma \), we divide the nonuniform meshes into two groups and discuss the corresponding strategies separately.

  • Nearly structured meshes\(\log _h \sigma \ge 2\).

    This definition is based on estimate (4.5), when

    $$\begin{aligned} \frac{\sqrt{\sigma }}{h} \ge \frac{\sqrt{\sigma }}{H} \ge 1,\quad \Rightarrow \quad \sigma \ge h^2 \quad \Rightarrow \quad \log _h\sigma \ge 2. \end{aligned}$$

    Then, the nonuniform mesh is almost a structured mesh, and the effect of the difference is negligible. In other words, we can treat these nearly structured meshes as structured meshes and use the conclusions in [20]. Also, we note that the definition is not strict; when \(\log _h \sigma \approx 2\) we can also treat these nonuniform meshes as structured meshes.

  • Unstructured meshes\(\log _h\sigma < 2\).

    This is a more challenging case and the aim of this paper. Under the same conditions as in Lemma 2.2, we assume that for a nonuniform mesh with the unstructuredness parameter \(\sigma \) as defined in Eq. (4.2) and based on the results in [22], the divided differences of DG solution satisfies

    $$\begin{aligned} \Vert \partial ^\alpha _H(u - u_h)\Vert _{-(k+1),\Omega _0} \le C h^{2k+1} \left( \frac{h^{\frac{1}{2}\log _h\sigma }}{H}\right) ^\alpha , \end{aligned}$$
    (4.6)

    when \(H \le h^{\frac{1}{2}\log _h\sigma }\). Moreover, the divided differences of the approximation satisfy

    $$\begin{aligned} \sum \limits _{\alpha = 0}^{k+1}\Vert \partial _H^\alpha (u - u_h)\Vert _{-(k+1)} \le C \left( \frac{h^{\frac{1}{2}\log _h\sigma }}{H}\right) ^{k+1}h^{2k+1}, \end{aligned}$$

    and according using the estimates for the filter design and and approximation (Eqs. (3.2)–(3.4)), we can enforce

    $$\begin{aligned} H^{2k+2} = \left( \frac{h^{\frac{1}{2}\log _h\sigma }}{H}\right) ^{k+1}h^{2k+1}. \end{aligned}$$

    Using \(H=h^{\mu _h},\) we then have for \(\mu _h\) that

    $$\begin{aligned} \mu _h = \frac{2k+1}{3(k+1)}+\frac{1}{6}\log _h\sigma \approx \frac{2}{3} + \frac{1}{6}\log _h\sigma > \frac{1}{2}\log _h\sigma , \end{aligned}$$
    (4.7)

    which is much more reasonable to compute as \(H = h^{\mu _h} \le h^{\frac{1}{2}\log _h\sigma }\).

4.3 Scaling Performance Validation

At the beginning of this section, we first summarize the definitions of all the scalings that are going to be tested in the section, see Table 3.

Table 3 Four types of scaling order used in the performance validation

As mentioned in Sect. 3, Theorem 3.1 is not practical since the

  • the accuracy order improvement requires \(k \ge 2\);

  • the errors in the DG solution are not always reduced.

In order to construct a robust algorithm that can be used in practice, we have proposed using scaling (4.7), which demonstrates the relation of the scaling order \(\mu _h\) and the unstructuredness, \(\sigma \). Since this result is not based on a rigorous error estimate, in this section, we validate the performance of the proposed scaling \(H=h^{\mu _h},\) where \(\mu _h\) is given in Eq. (4.7) by testing it for many nonuniform meshes. For a fair demonstration, we also compared this scaling with the scaling provided by Theorem 3.1 and the maximum scaling used in many works, such as [5, 12]. For convenience, we use the corresponding scaling orders \(\mu _h\), \(\mu _0\) and \(\mu _{max}\) to refer these three strategies, respectively (see Table 3).

4.3.1 Test Set-up

First, we present the setting of the nonuniform meshes used for the performance test. Since nearly structured meshes are relatively easily studied, in this test, we focus on unstructured meshes (or meshes with random structures). The information is presented as follows:

  • We adopt Mesh 2.2 with \(b = 0.3\). The value of b is chosen not only for allowing sufficient generality of the mesh structure, but also in order to avoid the possibility of round-off error caused by tiny elements.

  • In this test, we have considered the number of elements \(N = 20, 40, 80\), using 1700 different samples (5100 meshes in total).

  • The finer meshes (\(N = 40, 80\)) are generated using rules similar to the coarse mesh (\(N = 20\)), which preserves the nonuniform property. A trivial way to generating the finer mesh is by uniformly refining the coarse mesh, which leads to piecewise uniform meshes when N is large.

4.3.2 Optimal Scaling Order \(\mu \) Versus Errors

We begin by examining how the optimal scaling order \(\mu ^\star \) and the filtered solutions are altered with the DG approximation over different nonuniform meshes (shows as different DG solutions). This relation is demonstrated in Fig. 3. Notice the following:

  • Trend 1: A larger \(\mu ^{\star },\) corresponds to a smaller filtering region and lower errors for filtered solution. The lower errors clearly displayed for \(k=3\) than \(k=2\). It also corresponds to a more structured mesh as well.

  • Trend 2: Also demonstrated is that when the errors are lower for the DG solution, the optimal filtered solution has better error. This fact is supported by the theory.

  • Trend 3: Notice that \(\mu _0 = \frac{2k+1}{3k+2}\) is approximately 0.63 and 0.64 for \(k = 2, 3\). However, we can see that in most cases, this value is far away from \(\mu ^\star .\)

Fig. 3
figure 3

The comparison of DG errors and their optimal filtered results for different nonuniform meshes respect to \(\mu ^{\star }\). Each plot is based on 1700 random nonuniform samples

4.3.3 Optimal Scaling versus Existing Scalings

After checking our test meshes for the optimal scaling, we check the performance of the existing scalings and compare the results with the optimal filtered solution. In Fig. 4, the ratio of the \(L^2-\)errors for the DG solution to the \(L^2-\)errors for the filtered solution are plotted against the probability of achieving that ratio for a given polynomial order and mesh. If the ratio is less than one then the filtered error is better than the DG error, in other words, the filtered solution is at least accuracy-conserving compared to the DG solution. Further, by considering the ratio of the DG error to the SIAC Filtered error (Fig. 4), one can see that the performance (the ratio) of the SIAC filtering varies with the approximation over different nonuniform mesh approximations. On the other hand, we can compare the performance of different scalings by comparing their histogram plots (Fig. 4). One can tell that one scaling has a histogram closer to the optimal scaling (red) and also has the better performance. Here, we remind the reader that the different scalings are given in Table 3.

  • Theoretical Scaling, \(\mu _0\)(yellow): For more than half of the mesh samples, the ratio between the DG error and filtered error remains relatively small and the probability of achieving this scaling is higher than for other scalings.

  • Maximum Scaling, \(\mu _{max}\)(green): This scaling produces a reasonable ratio for most situations.

  • proposed Scaling, \(\mu _h\)(purple): The performance is closer to the optimal results compared to the other two scaling.

Fig. 4
figure 4

The comparison for the performance of different scalings: optimal scaling, theoretical scaling, maximum scaling, the new scaling for \(k = 2\). The x-axis is the value of \(\Vert u - u_h\Vert _0 / \Vert u - u_h^\star \Vert _0\), clearly, the larger the value, the better the filtering. In addition, we mark the accuracy-conserving position \(x = 1\) with a black line

Remark 4.3

We note that the value of \(\mu ^\star \) is also affected by the exact solution u, more precisely \(\frac{|u|_{H^{2k+2}}}{|u|_{H^{k+1}}}\). Since the exact solution is usually unknown in practice, this is difficult to determine. However, this leads us to choose \(\mu _h\) to be slight smaller than \(\mu ^{*}\).

4.3.4 Comparisons

From Fig. 4, We can clearly see that the new proposed scaling order \(\mu _h\) has the best performance. Now, we use the statistical data of results to give a more clear view of the performance.

First, we check the basic accuracy-conserving property in order to ensure that we are not degrading the DG results. From Table 4, we can see that \(\mu _h\) performs the best with respect to accuracy conservation, \(\mu _0\) the worst one, and \(\mu _{max}\) still has considerably large problems for coarse meshes.

Table 4 Percent of results which are at least accuracy-conserving (\(\Vert u - u_h^\star \Vert _0 \le \Vert u - u_h\Vert _0\))

Next, we compare the proposed scaling with other two scalings side-by-side in Tables 5 and 6. Here, motivated by the definition of equivalence of norms, we add the category “similar” to account for small differences in results: if \(\text {error}_1\) and \(\text {error}_2\) satisfy that \(\frac{1}{C_{tol}}|\text {error}_1| \le |\text {error}_2| \le C_{tol}|\text {error}_1|\), then these two errors are counted as similar. In this note, the tolerance constant \(C_{tol}\) is set as 2.

  1. 1.

    Table 5, \(\mu _{0}\) versus \(\mu _h\): the data clearly suggests that \(\mu _h\) is a better choice than \(\mu _0.\)

  2. 2.

    Table 6, \(\mu _{max}\) versus \(\mu _h\) : in at least 98% of the cases sampled, \(\mu _h\) produced better results than using \(\mu _{max}.\)

Based on the number of samples and the statistical data, the new scaling is a reliably better scaling to use among the scalings discussed in this article.

Table 5 \(\mu _0\) versus \(\mu _h\)
Table 6 \(\mu _{max}\) versus \(\mu _h\)

Through many performance tests, it is reasonable to claim that by using the proposed scaling \(\mu _h\), we can expect that there is an accuracy improvement for \(k \ge 1\) for the given nonuniform mesh (dependent on \(\sigma \)). In practice, strategy 4.7 provides a way to find the proper scaling for the SIAC filter, it can be used to reduce the errors of given DG solutions.

4.4 A Note on Computation

Aside from error reduction, the computational cost of using the filter is also an important factor in practical applications. As mentioned in previous sections, the scaling H used in Theorem 3.1 is usually larger than the scaling required for nonuniform meshes, which means that the computational cost is higher than the uniform mesh case [3, 11]. Based on Fig. 2, when \(\mu \in [\mu ^\star , 1]\), the final accuracy is directly related to the scaling order \(\mu \), which means one can sacrifice accuracy to improve computational efficiency. For example, if the mesh is closer to a structured mesh, a naive choice of scaling \(H = \max \limits _{j} \Delta x_j\) (or \(H = 1.5\max \limits _{j} \Delta x_j\), \(H = 2\max \limits _{j} \Delta x_j\)) can lead to acceptable results as obtained in [5, 12].

5 Numerical Results

In the previous section, we proposed using the scaling order \(\mu _h\) given by Eq. (4.7). Using the scaling order \(\mu _h\) can improve the accuracy order and reduce the error from the original discontinuous Galerkin approximation. Also, since \(\mu _h\) is designed to approximate the optimal scaling order \(\mu ^\star \), the filtered solutions are expected to have a reduction in error compared to the DG approximation. For numerical verification, we apply the newly designed scaling order \(\mu _h\) for various differential equations over nonuniform meshes—Meshs 2.1 and 2.2—and compare it with using scaling order \(\mu _0\) mentioned in Theorem 3.1. Also, we note that the initial approximation \(u_h(x,0)\) is the \(L^2\) projection of the initial function u(x, 0). The third order TVD Runge–Kutta scheme [7] is used for the time discretization.

5.1 Linear Equation

Consider a linear equation

$$\begin{aligned} u_t + u_x= & {} 0, \quad (x,t) \in [0,1]\times (0, T], \nonumber \\ u(x,0)= & {} \sin (2\pi x), \end{aligned}$$
(5.1)

with periodic boundary conditions at time \(T = 1\) for Meshs 2.1 and 2.2. Table 7 includes the \(L^2\) and \(L^\infty \) norm errors of the DG solutions and two filtered solutions with scaling orders \(\mu _0\) and \(\mu _h\). First we check the results of using scaling order \(\mu _0\) in Theorem 3.1. Although the filtered solutions have a better accuracy order, both the \(L^2\) and \(L^\infty \) errors are worse than the original DG solution! Theorem 3.1 says something only about the order, but not about the quality of the errors. Using a scaling order \(\mu _h\), SIAC filtering is able to reduce the errors in the \(L^2\) and \(L^\infty \) norm and improve the accuracy order. The filtered errors are reduced compared to the DG errors, especially when using a higher order polynomial or a sufficiently refined mesh. Figure 5, the pointwise error plots, demonstrate the other feature of SIAC filtering as its name implies: smoothness-increasing. Both the filtered solutions are \({\mathcal {C}}^{k-1}\) functions. The smoothness is significantly improved compared to the weakly continuous DG solutions. To ensure the smoothness of the filtered solution across the entire domain, we consider only a constant scaling H across the entire domain. In Fig. 5 both filtered solutions reduce the oscillations in the DG solution and using a scaling order \(\mu _0\) completely removes the oscillations due to the large filter support size.

Comparing the results between Meshs 2.1 and 2.2, we can see that the DG solutions and filtered solutions with scaling order \(\mu _h\) are better for Mesh 2.1 than for Mesh 2.2 because Mesh 2.1 is more structured than Mesh 2.2. However, using scaling order \(\mu _0\) generates almost the same result, which shows that \(\mu _0\) does not take the mesh structures into account.

Table 7 \(L^2-\) and \(L^{\infty }-\)errors for the DG approximation \(u_h\) together with two filtered solutions (using scaling order \(\mu = \mu _0\) and \(\mu = \mu _h\)) for linear equation (5.1) for Meshs 2.1 and 2.2
Fig. 5
figure 5

Comparison of the pointwise errors in log scale of the DG approximation together with two filtered solutions (using scaling order \(\mu = \mu _0\) and \(\mu = \mu _h\)) for linear equation (5.1) for Meshs 2.1 and 2.2 with polynomials of degree \(k=2\)

5.2 Variable Coefficient Equation

After the linear equation (5.1), which has a constant coefficient, we consider the variable coefficient equation

$$\begin{aligned} u_t + (au)_x= & {} f, \quad (x,t) \in [0,1]\times (0,T] \nonumber \\ u(x,0)= & {} \sin (2\pi x), \end{aligned}$$
(5.2)

where the variable coefficient \(a(x,t) = 2 + \sin (2\pi (x + t))\) and the right side term f(xt) are chosen to make the exact solution be \(u(x,t) = \sin (2\pi (x-t))\). The boundary conditions are periodic and the final time \(T = 1\).

Similar to the linear equation example, we compare the \(L^2\) and \(L^\infty \) norm errors in Table 8. The pointwise error plots are given in Fig. 6. The results are similar to the previous results for the constant coefficient equation. Here we point out only the features that are different from the linear equation. Using a scaling order \(\mu _0\) does not reliably reduce the errors in the \(L^2\) norm and the \(L^\infty \) norm errors are still worse than the DG solutions. However, using a scaling order \(\mu _h\) reduces the errors in the \(L^2\) norm and the \(L^\infty \) norm. The pointwise error plots in Fig. 6 are more oscillatory compared to Fig. 5 due to the effects of the variable coefficient.

Table 8 \(L^2-\) and \(L^{\infty }-\)errors for the DG approximation \(u_h\) together with two filtered solutions (using scaling order \(\mu = \mu _0\) and \(\mu = \mu _h\)) for variable coefficient equation (5.2) for Meshs 2.1 and 2.2
Fig. 6
figure 6

Comparison of the pointwise errors in log scale of the DG approximation together with two filtered solutions (using scaling order \(\mu = \mu _0\) and \(\mu = \mu _h\)) for variable coefficient equation (5.1) for Meshs 2.1 and 2.2 with polynomials of degree \(k=2\)

5.3 Two-Dimensional Example

For the two-dimensional example, we consider a two-dimensional linear equation

$$\begin{aligned} u_t + u_x + u_y= & {} 0, \qquad (x,y) \in [0,1]\times [0,1],\nonumber \\ u(x,y,0)= & {} \sin (2\pi (x + y)), \end{aligned}$$
(5.3)

with periodic boundary conditions at time \(T=1\) for a two dimensional quadrilateral extension of Meshs 2.1 and 2.2.

The \(L^2\) and \(L^\infty \) norm errors are presented in Tables 9 and 10, and the pointwise error plots (pcolor plots) are included in Figs. 7 and 8. The results are very similar to the one-dimensional examples: the filtered solutions with scaling order \(\mu _h\) reduce the errors in the \(L^2\) norm; using a scaling order \(\mu _0\) increases the error in the \(L^2\) norm for the DG error. In the two-dimensional case, computational efficiency becomes more important compared to the one-dimensional case due to the increased computational cost. As mentioned before, using a scaling order \(\mu _0\) is far more inefficient compared to using the scaling order \(\mu _h\). In particular, for a \({\mathbb {P}}^3\) polynomial basis with \(N = 160\times 160\) meshes, using a scaling order \(\mu _0\) is more than 8 times slower for Mesh 2.1 (5 times slower for Mesh 2.2) than using the scaling order \(\mu _h\).

Table 9 \(L^2-\) and \(L^{\infty }-\)errors for the DG approximation \(u_h\) together with two filtered solutions (using scaling order \(\mu = \mu _0\) and \(\mu = \mu _h\)) for two-dimensional linear equation (5.3) for Mesh 2.1 (2D)
Table 10 \(L^2-\) and \(L^{\infty }-\)errors for the DG approximation \(u_h\) together with two filtered solutions (using scaling order \(\mu = \mu _0\) and \(\mu = \mu _h\)) for two-dimensional linear equation (5.3) for Mesh 2.2 (2D)

Remark 5.1

In this paper, we only consider periodic boundary conditions. For other boundary conditions such as Dirichlet boundary conditions, a position-dependent filter [11, 20] has to be used near the boundaries. The results will be similar to the periodic boundary conditions. However, to obtain the optimal result, a position-dependent scaling has to be applied, we will leave it for the future work.

Fig. 7
figure 7

Comparison of the pointwise errors in log scale of the DG approximation together with two filtered solutions (using scaling order \(\mu = \mu _0\) and \(\mu = \mu _h\)) for two-dimensional linear equation (5.3) for Mesh 2.1 (2D, \(\mathbb {P}^2\) and \(N = 160\times 160\))

Fig. 8
figure 8

Comparison of the pointwise errors in log scale of the DG approximation together with two filtered solutions (using scaling order \(\mu = \mu _0\) and \(\mu = \mu _h\)) for two-dimensional linear equation (5.3) for Mesh 2.2 (2D, \({\mathbb {P}}^2\) and \(N = 160\times 160\))

6 Conclusion

In this paper, we have demonstrated that for a given nonuniform mesh, the filtered solution is highly affected by the unstructuredness of the mesh. By adjusting the filter scaling one can minimize the error of the filtered solution. In addition, a scaling \(H = h^{\mu _h}\) (4.7) of the SIAC filter is proposed in order to approach the optimal accuracy of the filtered solution, where the scaling order \(\mu _h\) is chosen according to the unstructuredness of the given nonuniform meshes. Furthermore, we have numerically shown that by using the proposed scaling \(H = h^{\mu _h}\), the filtered solutions have an accuracy order of \(\mu _h(2k+2)\), which is higher than the accuracy order of the DG solutions. The numerical results are promising: compared to the original DG errors, the filtered error scaling order \(\mu _h\) has a significantly reduced error from the original DG solution as well as increased accuracy order. Also, a scaling performance validation based on a large number of nonuniform meshes has demonstrated the superiority of our proposed scaling compared to other existing methods. Future work will concentrate on extending this scaling order \(\mu _h\) to unstructured triangular meshes in two dimensions and tetrahedral meshes in three dimensions.