An adaptive multiresolution discontinuous Galerkin method with artificial viscosity for scalar hyperbolic conservation laws in multidimensions

# An adaptive multiresolution discontinuous Galerkin method with artificial viscosity for scalar hyperbolic conservation laws in multidimensions

Juntao Huang Department of Mathematics, Michigan State University, East Lansing, MI 48824, USA. E-mail: huangj75@msu.edu.    Yingda Cheng Department of Mathematics, Department of Computational Mathematics, Science and Engineering, Michigan State University, East Lansing, MI 48824, USA. E-mail: ycheng@msu.edu. Research is supported by NSF grants DMS-1453661 and DMS-1720023.
###### Abstract

In this paper, we develop an adaptive multiresolution discontinuous Galerkin (DG) scheme for scalar hyperbolic conservation laws in multidimensions. Compared with previous work for linear hyperbolic equations [25, 26], a class of interpolatory multiwavelets are applied to efficiently compute the nonlinear integrals over elements and edges in DG schemes. The resulting algorithm, therefore can achieve similar computational complexity as the sparse grid DG method for smooth solutions. Theoretical and numerical studies are performed taking into consideration of accuracy and stability with regard to the choice of the interpolatory multiwavelets. Artificial viscosity is added to capture the shock and only acts on the leaf elements taking advantages of the multiresolution representation. Adaptivity is realized by auto error thresholding based on hierarchical surplus. Accuracy and robustness are demonstrated by several numerical tests.

Keywords: Compressible Euler equations; positivity-preserving; chemical reactions; production-destruction equations; finite difference

## 1 Introduction

In this paper, we develop an adaptive multiresolution discontinuous Galerkin (DG) method for scalar nonlinear conservation laws in multidimensional case:

 ∂tu+∇⋅f(u)=0,(x,t)∈Ω×(0,T], (1)

with appropriate initial and boundary conditions. Here , is the unknown function, and is the physical flux. We assume in the paper, but the discussion can be easily generalized to arbitrary box-shaped domains.

The DG method is a class of finite element methods using discontinuous approximation space for the numerical solutions and the test functions. The Runge-Kutta DG scheme for hyperbolic equations became very popular due to its provable stability and convergence, excellent conservation properties and accommodation for adaptivity and parallel implementations. We refer readers to the review papers [16, 14] for details. To adapt the degrees of freedom according to the local behavior of the numerical solution, many kinds of a posteriori error estimates have been designed for the DG schemes for hyperbolic equations, see e.g. [7, 1, 45, 29, 32, 30]. On the other hand, by using multiresolution analysis (MRA), automatic adaptivity can be achieved and no additional a posteriori error indicator is needed. Such ideas have been used to accelerate the computations for conservation laws under finite difference or finite volume frameworks [28, 8, 18, 4, 17, 12] and were used as trouble cell indicators for DG methods . In recent years, there have been interests in developing adaptive multiresolution DG schemes [11, 5]. In particular, multiresolution-based adaptive DG schemes for solving one dimensional scalar conservation laws were proposed by Müller et al. in  and further extended to multidimensional cases , compressible flows [35, 21] and shallow water equations [20, 36].

Another idea to utilize the computational advantages of the MRA framework is called the sparse grid method , which is a well-known tool to compute high-dimensional PDEs and stochastic differential equations. Based on the attractive features of DG methods for solving convection-dominated problems, in recent years, we initiated a line of research developing the (adaptive) sparse grid DG methods, including the work for elliptic equations , transport equations , reaction-diffusion equations  and Vlasov-Maxwell equations . For smooth solutions, the schemes we constructed can successfully reduce the number of degrees of freedom (DoF) of unknown from to for -dimensional problem, where is the uniform mesh size in each dimension. Stability and conservation of standard DG methods can be maintained. Errors are only slightly deteriorated for smooth solutions. Adaptivity can be incorporated naturally to treat solutions with less smoothness or local structures.

However, the main bottleneck for the sparse grid DG scheme developed so far is that, it is mainly for “linear” equations. Here, “linear” refers to either linear variable coefficient equations with given coefficients or coefficients that have some specified dependence on the unknowns, e.g. Vlasov systems through self-consistent field. There remain significant challenges to extend the methods to truly nonlinear problems in an efficient manner. For example, previous work in the literature on adaptive multiresolution DG schemes resort to the finest scale for the actual time evolution for the nonlinear terms. Therefore, the computational cost is proportional to the number of cells on the finest level, i.e. operations, and the reduced DoF in the solution representation is not realized in the actual computation. For nonlinear equations, there is only limited literature on collocation or finite difference based sparse grid methods , and the order of accuracy of the schemes is low. Sparse grid combination methods work for nonlinear problems, but they are less flexible in terms of adaptivity .

The objective of this work is to develop an adaptive multiresolution DG method to solve the nonlinear equation (1) efficiently. We would like to construct a scheme that can recover the computational complexity of the sparse grid method for smooth solutions. To represent a nonlinear function, it is natural to consider interpolation or collocation methods [31, 2]. This is achieved by using sparse grid collocation methods introduced in , which gives a framework to design adaptive sparse grid collocation onto arbitrary high order piecewise polynomial spaces. We approximate the nonlinear terms in the semi-discrete DG scheme for (1) by a linear combination of collocation basis functions up to required order of accuracy. We analyze the accuracy of the DG scheme with interpolation following the approach in [13, 34]. We compare different ways of sparse grid collocation methods and find that there exists some weak instability for Lagrange interpolation when solving (1). This motivates us to apply Hermite interpolation, which is more stable than the Lagrange interpolation . With the Hermite multiwavelet interpolations, we can obtain satisfactory numerical results which coincide with our local truncation error analysis.

Another challenge we address in the paper is how to capture the shock and entropy solutions to (1). There are two approaches in the literature. The first one is to apply limiters to control spurious oscillations and at the same time maintain accuracy in smooth regions, e.g., the minmod-type limiter , the moment-based limiter  and WENO limiter . However, it is quite difficult to impose limiters in the sparse grid DG methods, due to the global feature of the basis functions. Also a preliminary calculation from us shows that the piecewise constant sparse grid DG method in multidimensions is not monotone. This motivates us to use the second approach, which is to add artificial viscosity, see e.g. [6, 42, 24, 37, 38]. The idea is to add a diffusion term in the equation where the diffusion coefficient vanishes in the smooth region and becomes non-zero near the shock. This can be achieved by techniques such as entropy production  or local smoothness indicator . We add an artificial viscosity term following the approach in . Based on the estimate of the magnitudes of coefficients of hierarchical basis functions in [25, 26], we propose a smoothness indicator, which is built upon the inherent MRA and can automatically pick out the discontinuous regions. To improve the computational efficiency of our scheme, the implicit-explicit (IMEX) Runge-Kutta time integration is applied, where the nonlinear convection term is treated explicitly and the linear diffusion term is computed implicitly.

The rest of this paper is organized as follows. In Section 2, we review MRA associated with two sets of basis functions, i.e., the Alpert’s multiwavelets  and the interpolatory multiwavelets . The adaptive multiresolution DG scheme is constructed in Section 3 using both sets of multiwavelets. The numerical performance is validated by linear advection equations, Burgers’ equations and KPP problems in Section 4. We conclude the paper in Section 5. The appendix collects the explicit formulas of the interpolatory multiwavelets used in this paper.

## 2 MRA and multiwavelets

In this section, we review MRA associated with piecewise polynomial space. We will start with Alpert’s multiwavelets  and then review the interpolatory multiwavelets .

### 2.1 Alpert’s multiwavelets

We first review MRA achieved by Alpert’s basis functions in one dimension . We define a set of nested grids, where the -th level grid consists of uniform cells

 Ijn=(2−nj,2−n(j+1)],j=0,…,2n−1

for For notational convenience, we also denote The usual piecewise polynomial space of degree at most on the -th level grid for is denoted by

 Vkn:={v:v∈Pk(Ijn),∀j=0,…,2n−1}. (2)

Then, we have the nested structure

 Vk0⊂Vk1⊂Vk2⊂Vk3⊂⋯

We can now define the multiwavelet subspace , as the orthogonal complement of in with respect to the inner product on , i.e.,

 Vkn−1⊕Wkn=Vkn,Wkn⊥Vkn−1.

For notational convenience, we let , which is the standard polynomial space of degree up to on . Therefore, we have .

Now we define a set of orthonormal basis associated with the space . The case of mesh level is trivial. We use the normalized shifted Legendre polynomials in and denote the basis by for . When , the orthonormal bases in are presented in  and denoted by

 vji,l(x),i=1,…,k+1,j=0,…,2l−1−1.

The construction follows a repeated Gram-Schmidt process and the explicit expression of the multiwavelet basis functions are provided in Table 1 in . Note that such multiwavelet bases retain the orthonormal property of wavelet bases for different mesh levels, i.e.,

 ∫10vji,l(x)vj′i′,l′(x)dx=δii′δii′δjj′. (3)

and the support of is in .

Multidimensional case when follows from a tensor-product approach. First we recall some basic notations. For a multi-index , where denotes the set of nonnegative integers, the and norms are defined as

 |α|1:=d∑m=1αm,|α|∞:=max1≤m≤dαm.

The component-wise arithmetic operations and relational operations are defined as

 α⋅β:=(α1β1,…,αdβd),c⋅α:=(cα1,…,cαd),2α:=(2α1,…,2αd),
 α≤β⇔αm≤βm,∀m,α<β⇔α≤β and α≠β.

By making use of the multi-index notation, we denote by the mesh level in a multivariate sense. We define the tensor-product mesh grid and the corresponding mesh size Based on the grid , we denote as an elementary cell, and

 Vkl:={v:v(x)∈Qk(Ijl),0≤j≤2l−1}=Vkl1,x1×⋯×Vkld,xd

as the tensor-product piecewise polynomial space, where represents the collection of polynomials of degree up to in each dimension on cell . If we use equal mesh refinement of size in each coordinate direction, the grid and space will be denoted by and , respectively.

Based on a tensor-product construction, the multidimensional increment space can be defined as

 Wkl=Wkl1,x1×⋯×Wkld,xd.

Therefore, the standard tensor-product piecewise polynomial space on can be written as

 VkN=⨁|l|∞≤Nl∈Nd0Wkl, (4)

while the sparse grid approximation space in  is

 ^VkN:=⨁|l|1≤Nl∈Nd0Wkl⊂VkN. (5)

The dimension of scales as , which is significantly less than that of with exponential dependence on . The approximation results for are discussed in [51, 25], which has a stronger smoothness requirement than the traditional space. In this paper, we will not require the numerical solution to be in , but rather in and to be chosen adaptively similar to .

Finally, we define the basis functions in multidimensions as

 vji,l(x):=d∏m=1vjmim,lm(xm), (6)

for , and . The orthonormality of the bases can be established by (3).

### 2.2 Interpolatory multiwavelets

Alpert’s multiwavelets and the space are constructed so that they correspond to the difference of the projection on adjacent levels. The idea of the sparse grid collocation basis proposed in  is to switch the operator to be interpolation on nested grids. Below, we will outline the construction. Denote the set of interpolation points in the interval at mesh level 0 by . Here, the number of points in is . Then the interpolation points at mesh level , can be obtained correspondingly as

 Xn={xji,n:=2−n(xi+j),i=0,…,P,j=0,…,2n−1}.

We require the points to be nested, i.e.

 X0⊂X1⊂X2⊂X3⊂⋯. (7)

to save computational cost. This can be achieved by requiring , and then one can deduce (7) easily.

Given the nodes, we define the basis functions on the -th level grid as Lagrange or Hermite interpolation polynomials of degree which satisfy the property:

 ϕ(l′)i,l(xi′)=δii′δll′,

for and . It is easy to see that The constants will be specified later on in the paper. With the basis function at mesh level 0, we can define basis function at mesh level :

 ϕji,l,n:=2−nlϕi,l(2nx−j),i=0,…,P,l=0,…,K,j=0,…,2n−1

which is a complete basis set for

Next, we introduce the hierarchical representations. Define and for , then we have the decomposition

 Xn=~X0∪~X1∪⋯∪~Xn.

Denote the points in by . Then the points in for can be represented by

 ~Xn={~xji,n:=2−(n−1)(~xi+j),i=0,…,P,j=0,…,2n−1−1}.

For notational convenience, we let The increment function space for is introduced as a function space that satisfies

 VMn=VMn−1⊕~WMn, (8)

and is defined through the multiwavelets that satisfies

 ψ(l′)i,l(xi′)=0,ψ(l′)i,l(~xi′)=δi,i′δl,l′,

for and . Then is given by

 ~WMn=span{ψji,l,n,i=0,…,P,l=0,…,K,j=0,…,2n−1−1}

where . For completeness, we list the basis functions used in this paper in the appendix.

The construction above has close connection with interpolation operators. For a given function , we define as the standard Hermite interpolation on and have the representation

 IP,KN[f](x)=N∑n=0max(2n−1−1,0)∑j=0K∑l=0P∑i=0bji,l,nψji,l,n(x).

Clearly, The algorithm converting between the point values and the derivatives to hierarchical coefficients is given in , and by a standard argument in fast wavelet transform, can be performed in flops.

The multidimensional construction follows similar lines as in Section 2.1. We let

 ~WMl=~WMl1,x1×⋯×~WMld,xd,

Therefore,

 VMN=⨁|l|∞≤Nl∈Nd0~WMl,

while the sparse grid approximation space is

 ^VMN=⨁|l|1≤Nl∈Nd0~WMl.

Note that the construction by Alpert’s multiwavelet and the interpolatory multiwavelet gives the same sparse grid space. Finally, the interpolation operator in multidimension :

 IP,KN[f](x)=∑|n|∞≤N0≤j≤max(2n−1−1,0)0≤l≤K0≤i≤Pbji,l,nψji,l,n(x),

where the multidimensional basis functions are defined in the same approach as (6) by tensor products. If the space is switched from to some subset of e.g. the sparse grid space or some other subset of that is dynamically chosen, the interpolation operator can be defined accordingly, taking only multiwavelet basis functions that belong to that space.

## 3 Adaptive multiresolution DG evolution algorithm

In this section, we will describe the adaptive multiresolution DG scheme for (1). We will first introduce the DG scheme with multiresolution interpolation. The accuracy requirement for the interpolation operator is studied by local truncation error analysis. We then describe the adaptive strategy. Finally, the artificial viscosity is introduced based on the estimate of the coefficients of the hierarchical basis functions.

### 3.1 DG scheme with multiresolution interpolation

First, we review some basis notations about meshes. Let be the maximum mesh level and be the collection of all elementary cell , , . Define be the union of all the interfaces for all the elements in Here, for simplicity, we formulate the scheme with periodic boundary conditions, while we keep in mind other boundary conditions can be treated in the DG framework as well.

The semi-discrete DG scheme for the scalar conservation law reads as 

 ∑K∈Th∫K(uh)tvhdx−∑K∈Th∫Kf(uh)⋅∇vhdx+∑e∈Γh∫eˆf⋅nK(uh)vhds=0. (9)

Here, is the numerical solution and is the test function. The numerical flux is taken to be the global Lax-Friedrichs flux:

 ˆf⋅nK(a,b)=12(f(a)+f(b))⋅nK−12C(b−a), (10)

where and the maximum is taken over the whole domain. belong to the same function space If we recover the standard (or full grid) DG method. If we obtain the sparse grid DG method. In this paper, we will take as a subset of that is chosen adaptively as outlined in Section 3.2.

In DG methods, the integrals over elements and edges are often approximated by numerical quadrature rules on each cell . However, in sparse grid DG method, this naive approach would result in computational cost that is proportional to the number of fundamental elements, i.e., , and is still subject to the curse of dimensionality. To evaluate the integrals over elements and edges more efficiently with a cost proportional to the DoF of the underlying finite element space, we interpolate the nonlinear function by using the multiresolution Lagrange (or Hermite) interpolation basis functions introduced in Section 2.2. Therefore, the semi-discrete DG scheme with interpolation is

 ∑K∈Th∫K(uh)tvhdx−∑K∈Th∫KI[f(uh)]⋅∇vhdx+∑e∈Γh∫eI[ˆf⋅nK(uh)]vhds=0, (11)

where is a multiresolution interpolation operator onto some finite element space with the same multiresolution structure as but of polynomial degree . The choice of will be specified later, which plays important roles in numerical stability and accuracy. Note that the numerical flux is only defined at edges, thus it remains to clarify the meaning of the interpolation . Since we use the global Lax-Friedrichs flux (10), we have

 I[ˆf⋅nK(uinth,uexth)] =12(I[f(uinth)]+I[f(uexth)])⋅nK−12C(I[uexth]−I[uinth]) =12(I[f(uinth)]+I[f(uexth)])⋅nK−12C(uexth−uinth)

due to the linearity of the interpolation operator . Therefore, we only need to obtain the interpolation and then read the value on two sides of the edges to obtain and . Now, we discuss about numerical implementation. First, we read the (derivative) values of , which is a linear combination of Alpert’s basis functions at the chosen interpolation points. Second, we calculate the (derivative) values of at these interpolation points. Last, we transfer the (derivative) values to coefficients of interpolation basis, by using the algorithm introduced in . At this point, the numerical integrations can be performed through a fast matrix-vector product as in . We remark that the computational cost does not increase too much compared to the multiresolution DG schemes for linear equations introduced in . The cost of the transformation from the (derivative) values to hierarchical coefficients is only linearly dependent on the dimension .

Now we discuss the choice of To preserve the accuracy of the original DG scheme (9), it is required that the interpolation operator reaches certain accuracy. Following , we rewrite the weak formulation (11) in the ODE form as

 duhdt=Lh(uh), (12)

where is an operator onto which is a discrete approximation of and satisfies

 (13)

To illustrate the ideas, we only consider the full grid or sparse grid DG methods, i.e. or For adaptive methods, similar intuitive arguments can be made, but rigorous proof is much harder. Using similar error estimates techniques in [13, 34], we have the following proposition on local truncation error:

###### Proposition 3.1 (Accuracy of semi-discrete DG scheme with interpolation).

Assume that the DG finite element space (standard or sparse) has polynomials up to degree if the interpolation operator in (11) has the accuracy of (standard) or (sparse) for sufficiently smooth functions, then the truncation error of the semi-discrete DG scheme with interpolation (11) is of order (standard) or (sparse). To be more precise, for sufficiently smooth function , the standard DG with interpolation (11) has the truncation error:

 ∥Lh(u)+∇⋅f(u)∥L2(Ω)≤Chk+1, (14)

and the sparse grid DG with interpolation (11) has the truncation error:

 ∥Lh(u)+∇⋅f(u)∥L2(Ω)≤C|log2h|dhk+1. (15)

Here, the constant may depend on the solution, but does not depend on .

###### Proof.

To save space, we only show the proof for full grid DG space . Similar technique also applies to the sparse grid DG space using projection error estimates in .

We denote the standard projection operator onto the standard DG finite element space by , then

 ∥Lh(u)+∇⋅f(u)∥L2(Ω)≤e1+e2, (16)

where

 e1:=∥Lh(u)+P(∇⋅f(u))∥L2(Ω),

and

 e2:=∥P(∇⋅f(u))−∇⋅f(u)∥L2(Ω).

The estimate for is trivial using projection properties:

 e2≤Chk+1∥∇⋅f(u)∥Hk+1(Ω). (17)

To estimate we consider any test function in DG space, and obtain

 ∑K∈Th∫K(Lh(u)+P(∇⋅f(u)))vh=∑K∈Th∫K(Lh(u)+∇⋅f(u))vh = ∑K∈Th∫KI[f(u)]⋅∇vh−∑e∈Γh∫eI[ˆf⋅nK(u)]⋅nKvhds −∑K∈Th∫K(f(u)⋅∇vh)+∑e∈Γh∫ef(u)⋅nKvhds = ∑K∈Th∫K(I[f(u)]−f(u))⋅∇vh−∑e∈Γh∫e(I[f(u)⋅nK]−f(u)⋅nK)vhds ≤ ∥I[f(u)]−f(u)∥L2(Ω)∥∇vh∥L2(Ω)+∥I[f(u)]−f(u)∥L2(Γh)∥vh∥L2(Γh) ≤ Chk+2h−1∥vh∥L2(Ω)+Ch−12hk+2h−12∥vh∥L2(Ω) = Chk+1∥vh∥L2(Ω).

Here we use the multiplicative trace inequality and the inverse inequality, see e.g. Lemma 2.1 and Lemma 2.3 in . We take to be in the inequality above and have

 ∥Lh(u)+P(∇⋅f(u))∥2L2(Ω)≤Chk+1∥Lh(u)+P(∇⋅f(u))∥L2(Ω)

and eventually arrive at

 e1=∥Lh(u)+P(∇⋅f(u))∥L2(Ω)≤Chk+1. (18)

Combining (18) and (17), we have the estimate for the truncation error (14). ∎

From the proposition above, we find that, one has to apply the interpolation in which the function space has polynomials of one degree higher than the original DG function space, if one would like to preserve the order of accuracy for the original (standard or sparse grid) DG scheme, i.e. we shall require For example, if we take quadratic polynomials for the DG space, then it is required to apply interpolation operator (Lagrange or Hermite interpolation) to treat the nonlinear terms. From our numerical test, it seems that it is not a necessary condition for the standard DG method, but it is necessary for the sparse grid DG method.

In Proposition 3.1, we only estimate the truncation error, and this is far from rigorous error estimate that takes into account stability. In numerical experiments, we observe that the standard DG is stable with the Lagrange interpolation. However, the sparse grid DG with Lagrange interpolation is weakly unstable and will blow up with very fine mesh for polynomials of high degrees (see the numerical results in Table 2 and Table 3 in Section 4). With Hermite interpolation, the sparse grid DG scheme is more stable and produce satisfactory convergence rate (see Table 4 in Section 4). Actually, for standard DG with quadrature rules applied in each element, if the truncation error satisfies the required order of accuracy, then the convergence and error estimate can be guanranteed . However, it is not true for the sparse grid DG method from our numerical experiments. This indicates that the standard DG method is more stable than the sparse grid DG method in this sense. We also remark that, since the interpolation operator introduced here is global but not local, the approach in  would probably fail to obtain the rigorous error estimate here. We will leave the detailed analysis as future work.

In this section, we review the adaptive procedure introduced in  to determine the space The method is very similar to those in , except that two sets of basis functions are involved and they are adaptively chosen at the same time.

In the adaptive DG algorithm, we specify the maximum mesh level and an accuracy threshold . Details on the optimal choice of can be found for example in . The same adaptive multiresolution projection method in  is applied here as the numerical initial condition for DG schemes. The error indicator using norm is used. The details are omitted and we refer readers to Algorithm 1 in .

The scheme is implemented by hash table as the underlying data structure. We now introduce the concepts of child, parent and leaf elements. If an element with satisfies the condition that there exists an integer such that and , where denotes the unit vector in the direction, and the support of is within that of , then is called a child element of . Accordingly, element is called a parent element of . If an element does not have its child element in the hash table, then we call it a leaf element.

The time evolution consists of four steps. The first step is the prediction step, which means given the hash table that stores the numerical solution at time step and the associated leaf table , we need to predict the location where the details becomes significant at the next time step , then add more elements in order to capture the fine structures. We solve for from to using a cheap solver, e.g. the forward Euler discretization. Here, the interpolation operator is determined by accuracy requirement, and has the same multiresolution structure as determined by the hash table corresponding to the numerical solution . The predicted solution at is denoted by . Note that to save cost, that the artificial viscosity term as introduced in Section 3.3 does not need to be included in the prediction step.

The second step is the refinement step according to the predicted solution . We traverse the hash table and if an element satisfies the refinement criteria

 (∑1≤i≤k+1|uji,l|2)1/2≥ϵ, (19)

where denotes the hierarchical coefficient corresponding to the basis i.e. (19) indicates that such an element becomes significant at the next time step, then we need to refine the mesh by adding its children elements to . The detailed procedure is described as follows. For a child element of , if it has been already added to , i.e. , we do nothing; if not, we add the element to and let the associated detail coefficients . Moreover, we need to increase the number of children by one for all elements that has as its child element and remove the parent elements of from the leaf table if they have been added. Finally, we obtain a larger hash table and the associated approximation space and the leaf table .

Then, based on the updated hash table , we evolve the numerical solution by the DG formulation with space . Namely, we solve for from to , to generate the precoarsened solution , by using the the accurate solver with artificial viscosity in Section 3.3. Here, the interpolation operator should determined by the updated hash table . Note that in the artificial viscosity we fix to be such that the matrix for the diffusion term only need to be resembled one time in each time step.

The last step is to coarsen by removing elements that become insignificant at time level The hash table that stores the numerical solution is recursively coarsened by the following procedure. The leaf table is traversed, and if an element satisfies the coarsening criterion

 (∑1≤i≤k+1|uji,l|2)12<η, (20)

where is a prescribed error constant, then we remove the element from both table and , and set the associated coefficients . For each of its parent elements in table , we decrease the number of children by one. If the number becomes zero, i.e, the element has no child any more, then it is added to the leaf table accordingly. Repeat the coarsening procedure until no element can be removed from the table . By removing only the leaf element at each time, we avoid generating “holes” in the hash table. The output of this coarsening procedure are the updated hash table and leaf table, denoted by and respectively, and the compressed numerical solution . In practice, is chosen to be smaller than for safety. In the simulations presented in this paper, we use .

### 3.3 Artificial viscosity

For capturing shock, we add artificial viscosity following the approach in  and arrive at the semi-discrete formulation

 ∑K∈Th∫K(uh)tvhdx−∑K∈Th∫KI[f(uh)]⋅∇vhdx+∑e∈Γh∫eI[ˆf⋅nK(uh)]vhds −∑K∈Th∫Kν(uh)∇uh⋅∇vhdx=0. (21)

where is the artificial viscosity. The artificial viscosity is piecewise constant in each element and depends on . It is only imposed in the leaf element (since the sharp gradient and shock will only appear in the leaf element) and is determined in the following approach:

 ν={0,ifse≤s0+κ,ν0h,otherwise.

where and are constants chosen empirically. In the numerical experiments, we typically take and . The parameters and are given as

 se=log10(∑1≤i≤k+1|uji,l|2)12,s0=log10(2−(k+12)|l|1). (22)

In the regions where the solutions are smooth, should be the same order as . If the solution is discontinuous, should be much larger than .

This smoothness indicator is motivated by the estimate of the coefficients of hierarchical basis functions in [25, 26]. It is shown in [25, 26] that for a function ,

 (∑0≤j≤max(2l−1−1,0)1≤i≤k+1|uji,l|2)1/2≤C2−(q+1)|l|1|u|Hp+1(Ω), (23)

where and is a constant independent of mesh level . Therefore, by assuming that , we can obtain a local estimate in each element on mesh level : for any index ,

 (∑1≤i≤k+1|uji,l|2)1/2≤C2−(q+12)|l|1|u|Wp+1,∞(Ω). (24)

Therefore, for sufficiently smooth functions, the coefficients should decay like

 (∑1≤i≤k+1|uji,l|2)1/2∼2−(k+12)|l|1. (25)
###### Remark 3.1.

There are still many problems to be explored on the artificial viscosity. The first one is the specific form of the artificial viscosity term. Here, for simplicity, we only add an artificial viscosity term in (3.3). One may also add a physical diffusion term and then discrete it using local DG  or interior penalty DG . The second issue is how to choose the optimal parameters and in the artificial viscosity to obtain a sharp shock profile. The artificial neural network introduced in [44, 19] might be helpful for this problem. We will explore these subjects in future work.

The diffusion coefficient is of order for trouble cells and zero for normal cells. Thus, the explicit time integration in both convection and diffusion terms in (3.3) will yield CFL condition . For hyperbolic problems with DG discretizations using polynomials of degree and upwind numerical flux and a stage explicit RK method of order , the CFL constant is around . However, for solving diffusion equation with local DG discretization with polynomials and alternating numerical flux, the CFL constant is around 0.0555 for , 0.0169 for , 0.0063 for , and 0.003 for , if coupled with explicit Runge-Kutta methods of the corresponding order111The CFL constants are provided by Chi-Wang Shu from Brown University in personal communications., which is much smaller than the CFL constant for convection terms, especially for polynomials of high degrees. If the alternating numerical flux is replaced by the central flux for the diffusion equation, the CFL constant is slightly larger but still much smaller than the CFL constant for the convection part: 0.125 for , 0.0384 for , 0.0158 for and 0.0083 for .

To obtain better computational efficiency, we avoid explicit time integrations and apply the IMEX time discretizations where the convection term is treated explicitly and the diffusion term implicitly. Here, we only present the third-order IMEX method introduced in , which will be coupled with the DG space of quadratic polynomials. The explicit part is the same with the explicit third-order strong stability preserving (SSP) Runge-Kutta method  and the implicit part has four stages. To be precise, for the ODE systems:

 dUdt=F(U)+G(U), (26)

where denotes the non-stiff term (convection parts) and the stiff term (diffusion parts). The IMEX scheme for (26) reads as

 U(i) =Un+Δti−1∑j=1~aijF(U(j))+Δti∑j=1aijG(u(j)),i=1,…,ν, (27a) Un+1 =Un+Δtν∑i=1~wiF(U(i))+Δtν∑i=1wiG(u(i)), (27b)

with the stage and the parameters

 ~a32=1,~a42=~a43=14,a11=a22=a33=a44=α,a21=−α,a32=1−α, a41=β,a42=η,a43=12−β−η−α,~w2=~w3=w2=w3=16,~w4=w4=23,

and

 α=0.24169426078821,β=0.06042356519705,η=0.12915286960590.

The other parameters not listed above are zero.

By using the IMEX time integrator, the time step restriction remains the same as determined by the convection term. Note that the artificial viscosity is determined by and will keep unchanged in the middle stages of time evolution from to . Therefore, the matrix for the diffusion term only need to be resembled one time in each time step. Also, we only need to solve a linear system in which the coefficient matrix is symmetric positive definite and also sparse (there exist only a small portion of elements with non-zero viscosity). In the computation, we apply the conjugate gradient method to solve this linear system. We also remark that, for smooth solutions, this scheme will reduce to the explicit time integrations when coupled with the semi-discrete DG scheme with artificial viscosity (3.3), since the artificial viscosity will automatically vanish and then IMEX scheme (27) reduces to the third-order SSP RK method.

## 4 Numerical results

In this section, we perform numerical experiments to validate the accuracy and robustness of our scheme. The computational domain is for 1D and for 2D. Periodic boundary condition is imposed. When testing accuracy for smooth solutions, we apply the TVD Runge-Kutta time discretizations : second-order RK method for the piecewise linear finite element space () and third-order RK method for the quadratic () and cubic () finite element space. When testing the capability for capturing discontinuous solutions, we use the quadratic finite element space (