1 Introduction

Richardson extrapolation [1, 2] is an acceleration method, used to improve the rate of convergence for a sequence. In 1983, Marchuk and Shaidurov extended Richardson extrapolation technique in the framework of the finite difference (FD) method [3]. Later on, Blum et al. discussed Richardson extrapolation strategy in conjunction with the finite element (FE) method [47].

Multigrid methods (MGs) [8, 9] have been shown to be one of the most efficient modern numerical strategies to solve the large linear systems arising from FE or FD discretizations of partial differential equations (PDEs), such as the Poisson equation [1014], Helmholtz equation [1517], convection–diffusion equation [1820]. The main advantage of the multigrid method is that its convergence rate is independent of the number of unknowns [8, 21]. The full multigrid (FMG) method, which combines nested iteration with a V- or W-cycles multigrid method, is well known to be optimal with respect to the energy norm and the \(L^{2}\)-norm [8, 2123]. It starts on the coarsest grid with a direct solver, then the solution is interpolated to form the initial guess on the next finer grid, where a few V- or W-cycles are used to produce an approximate solution whose algebraic error matches with the discretization error. The procedure goes on recursively until the finest grid.

Recently, the Richardson extrapolation technique has been applied in multigrid methods. One group of researchers used Richardson extrapolation to construct a good initial guess for the iterative solver. An extrapolation cascadic multigrid (EXCMG) method [24, 25] was proposed by Chen et al. to solve second-order elliptic problems. This method uses a new extrapolation formula to construct a quite good initial guess for the iterative solution on the next finer grid, which greatly improves the convergence rate of the original CMG algorithm (see [2426] for details). Then the EXCMG method has been successfully applied to non-smooth elliptic problems [27, 28], parabolic problems [29], and some other related problems [3032]. Moreover, Pan [33] and Li [34, 35] developed some EXCMG methods combined with high-order compact difference schemes to solve Poisson equations. In 2017, Hu et al. [36] obtained the super-optimality of the EXCMG method under the energy norm for \(H^{2+\alpha }\)-regular \((0<\alpha \leq 1)\) elliptic problems.

Another group of researchers made efforts to design an iterative procedure with Richardson extrapolation strategy to enhance the solution accuracy on the finest grid. Sun, Zhang and Dai developed a sixth-order FD scheme for solving the 2D convection–diffusion equation [37, 38]. In their approach, the ADI method is applied to compute the fourth-order accurate solution on the fine and coarse grids, respectively, then the Richardson extrapolation technique and an operator-based interpolation scheme are employed in each ADI iteration to calculate the sixth-order accurate solution on the fine grid. In 2009, Wang and Zhang designed an explicit sixth-order compact discretization strategy (MG-Six) for the 2D Poisson equation [39]. They used a V-cycle multigrid method to get the fourth-order accurate solutions on both the fine and the coarse grids first, and then chose the iterative operator with Richardson extrapolation technique to compute the sixth-order accurate solution on the fine grid.

We extend the idea described in the literature [32, 33, 39] to the original full multigrid method, and develop an extrapolation full multigrid (EXFMG) method to solve the 2D convection–diffusion equation with a fourth-order compact difference discretization. To be more precise, a bi-quartic Lagrange interpolation operator on a coarser grid is applied to get a good initial guess on the next finer grid for the multigrid V- or W-cycles solver. Besides, a stopping criterion related to relative residual is used to conveniently obtain the numerical solution with the desired accuracy. Moreover, a mid-point extrapolation strategy is used to obtain cheaply and directly a sixth-order accurate solution on the entire fine grid from two fourth-order solutions on two different grids (current fine and previous coarse grids). Finally, through two examples chosen from the literature, the computational efficiency of the EXFMG method is discussed in detail.

The rest of the paper is organized as follows. Section 2 introduces the model problem and a fourth-order compact difference scheme. Section 3 depicts the classical multigrid method. And the extrapolation full multigrid method is described in Sect. 4. Numerical results are given in Sect. 5 to show the efficiency and high-order accuracy of the new algorithm. Finally, concluding remarks are provided in Sect. 6.

2 Model problem and discretization

Consider the following two-dimensional (2D) convection–diffusion equation:

$$ -u_{xx} (x,y) - u_{yy} (x,y) + p(x,y)u_{x}(x,y)+q(x,y)u_{y}(x,y) = f(x,y), \quad (x,y) \in \Omega , $$
(1)

with suitable Dirichlet boundary conditions. Here Ω is a rectangular domain, \(p(x, y)\) and \(q(x, y)\) are the given convection velocities, \(f(x,y)\) is the given source term, and \(u(x,y)\) is the unknown function. All these functions are assumed to be sufficiently smooth and have the necessary continuous partial derivatives up to certain orders. This equation is used to describe many processes in fields of fluid dynamics.

Let \(\Omega =[0,M_{x}]\times [0,M_{y}] \) and divide Ω into \(N_{x} \times N_{y}\) uniform grids with the mesh size \(\Delta x = \frac{ {M_{x} }}{{N_{x} }}\) and \(\Delta y = \frac{{M_{y} }}{{N_{y} }}\) in the x and y coordinate directions, respectively. \(N_{x}\) and \(N_{y}\) are the numbers of uniform intervals in the x and y directions, respectively. The mesh points are \((x_{i},y _{j})\) with \(x_{i}=i\Delta x\) and \(y_{i}=i\Delta y\), \(0 \le i \le N _{x}\), \(0 \le j \le N_{y}\). For simplicity, we use \(U_{i,j}\) to represent the approximation of \(u(x_{i},y_{j})\) at the mesh point \((x_{i},y_{j}) \), set \(f_{i,j}=f(x_{i},y_{j})\), \(p_{i,j}=p(x_{i},y_{j})\), and so on.

The fourth-order compact difference scheme for Eq. (1) with nine-point computational stencil is given by [40]

$$\begin{aligned} & \biggl( \frac{4A_{i,j}}{\Delta x ^{2} \Delta y^{2} }-\frac{2D_{i,j}}{ \Delta x^{2}}-\frac{2E_{i,j}}{\Delta y^{2}} \biggr)U_{ij} + \biggl( \frac{-2A_{i,j}}{ \Delta x ^{2} \Delta y^{2} }-\frac{C_{i,j}}{\Delta x \Delta y^{2}}+ \frac{D _{i,j}}{\Delta x^{2}}+ \frac{G_{i,j}}{2 \Delta x} \biggr)U_{i + 1,j} \\ & \quad{} + \biggl( \frac{-2A_{i,j}}{\Delta x ^{2} \Delta y^{2} }+\frac{C_{i,j}}{ \Delta x \Delta y^{2}}+ \frac{D_{i,j}}{\Delta x^{2}}- \frac{G_{i,j}}{2 \Delta x} \biggr)U_{i - 1,j} \\ & \quad{} + \biggl( \frac{-2A_{i,j}}{\Delta x ^{2} \Delta y^{2} }- \frac{B_{i,j}}{2\Delta x^{2} \Delta y}+ \frac{E_{i,j}}{\Delta y ^{2}}+ \frac{H_{i,j}}{2\Delta y} \biggr)U_{i,j + 1} \\ & \quad{} + \biggl( \frac{-2A_{i,j}}{\Delta x ^{2} \Delta y^{2} } + \frac{B_{i,j}}{ \Delta x^{2} \Delta y }+ \frac{E_{i,j}}{\Delta y^{2}}- \frac{H_{i,j}}{2 \Delta y} \biggr)U_{i,j - 1} \\ & \quad{} + \biggl( \frac{A_{i,j}}{\Delta x ^{2} \Delta y^{2} }+ \frac{B _{i,j}}{2\Delta x^{2} \Delta y}- \frac{C_{i,j}}{2 \Delta x \Delta y ^{2}}- \frac{K_{i,j}}{4 \Delta x \Delta y} \biggr)U_{i - 1,j+1} \\ & \quad{} + \biggl( \frac{A_{i,j}}{\Delta x ^{2} \Delta y^{2} }-\frac{B_{i,j}}{2 \Delta x^{2} \Delta y}+ \frac{C_{i,j}}{2 \Delta x \Delta y^{2}}- \frac{K _{i,j}}{4 \Delta x \Delta y} \biggr)U_{i + 1,j-1} \\ & \quad{} + \biggl( \frac{A_{i,j}}{\Delta x ^{2} \Delta y^{2} }+ \frac{B_{i,j}}{2\Delta x^{2} \Delta y}+ \frac{C _{i,j}}{2 \Delta x \Delta y^{2}}+ \frac{K_{i,j}}{4 \Delta x \Delta y} \biggr)U _{i + 1,j+1} \\ & \quad{} + \biggl( \frac{A_{i,j}}{\Delta x ^{2} \Delta y^{2} }- \frac{B_{i,j}}{2 \Delta x^{2} \Delta y}- \frac{C_{i,j}}{2 \Delta x \Delta y^{2}}+ \frac{K _{i,j}}{4 \Delta x \Delta y} \biggr)U_{i -1,j-1} =F_{i,j} , \end{aligned}$$
(2)

with the coefficients

$$\begin{aligned} &A_{i,j}=-\frac{\Delta x^{2}+\Delta y^{2}}{12}, \qquad B_{i,j}= \frac{ \Delta x^{2}+\Delta y^{2}}{12}q_{i,j}, \qquad C_{i,j}=\frac{\Delta x ^{2}+\Delta y^{2}}{12}p_{i,j}, \\ &D_{i,j}=-1+\frac{\Delta x^{2}}{12} \bigl[2(p_{x})_{i,j})-p_{i,j}^{2} \bigr], \qquad E_{i,j}=-1+\frac{\Delta y^{2}}{12} \bigl(2(q_{y})_{i,j}-q_{i,j}^{2} \bigr), \\ &K_{i,j}=\frac{\Delta x^{2}}{12} \bigl[2(q_{x})_{i,j} -(pq)_{i,j} \bigr]+\frac{ \Delta y^{2}}{12} \bigl[2(p_{y})_{i,j}-(pq)_{i,j} \bigr], \\ &G_{i,j}=p_{i,j}+\frac{\Delta x^{2}}{12} \bigl[ (p_{xx})_{i,j} -(pp_{x})_{i,j} \bigr]+ \frac{ \Delta y^{2}}{12} \bigl[(p_{yy})_{i,j}-(p_{y}q)_{i,j} \bigr], \\ &H_{i,j}=q_{i,j}+\frac{\Delta x^{2}}{12} \bigl[ (q_{xx})_{i,j} -(pq_{x})_{i,j} \bigr]+ \frac{ \Delta y^{2}}{12} \bigl[(q_{yy})_{i,j}-(qq_{y})_{i,j} \bigr], \\ &F_{i,j}=f_{i,j}+\frac{\Delta x^{2}}{12} \bigl[ (f_{xx})_{i,j} -(pf_{x})_{i,j} \bigr]+ \frac{ \Delta y^{2}}{12} \bigl[(f_{yy})_{i,j}-(qf_{y})_{i,j} \bigr]. \end{aligned}$$
(3)

Now set \(h_{1}=\Delta x=\Delta y\) and assume that the domain Ω is divided into a sequence of grids \(\Omega_{k}, k=1,2, \ldots , L\) with mesh size \(h_{k}={h_{1}}/{2^{k-1}}\). By applying the fourth-order compact scheme (2), we obtain the corresponding sparse linear system,

$$ A_{k} u_{k} = F_{k}, \quad k=1,2, \ldots ,L, $$
(4)

where \(A_{k}\) is a nine-diagonal matrix, \(F_{k}\) and \(u_{k}\) are the right-hand side vector and the solution vector, respectively.

3 Classical multigrid method

The multigrid (MG) method is a very efficient approach to solving large sparse linear systems arising from FE or FD discretizations of various PDEs [8]. The main feature behind the MG method is to divide the errors into high frequency components and low frequency components and eliminate them in different grids. To be more specific, the high frequency component errors are eliminated on the fine grid, while the remaining low frequency errors are eliminated by a recursive procedure on the coarse grid. We depict this method in Algorithm 1, in which a direct solver “DSOLVER” is used on the coarsest grid, since the size of the linear system is small. A restriction operator \(R^{j}_{j+1} \) (such as a full-weighting scheme) is employed to project residual from the fine grid to the coarse grid, and an interpolation operator \(I_{j}^{j+1}\) (such as bilinear interpolator) is used to transfer corrections from the coarse grid to the fine grid. The recursion parameter \(N_{\textrm{cycles}}\) is greater than or equal to one. If Ncycles = 1, the so-called V-cycle is generated, while Ncycles = 2 leads to the W-cycle. A cycle of Algorithm 1, means that it starts from the finest grid to the coarsest grid and back to the finest grid again. When Algorithm 1 is applied to the finest grid system (2) in the solution of which we are interested, it can be repeated until the accuracy of approximation on the finest grid is considered to be high enough.

Algorithm 1
figure a

Classical multigrid method: \(u_{L} \Leftarrow \textrm{MGM} (A_{L}, u_{L}^{0}, F_{L},L)\)

In fact, Algorithm 1 can be incorporated with the classical FMG method naturally. The FMG method starts with the coarsest grid, and uses an interpolation operator \(P_{j-1}^{j}\) to produce an initial guess for Algorithm 1 on the next finer grid; see Algorithm 2 for details. The interpolation operator \(P_{j-1}^{j}\) usually is of higher accuracy than the interpolation operator \(I_{j-1}^{j}\) used within the multigrid iteration. It is well known that FMG delivers an approximation up to discretization accuracy if the multigrid cycle converges satisfactorily and if the order of FMG interpolation is larger than the discretization order of the PDE [8].

Algorithm 2
figure b

Full multigrid method (FMG)

4 Extrapolation full multigrid method

4.1 Description of the EXFMG algorithm

In this section, we shall establish an extrapolation full multigrid (EXFMG) method to solve the 2D convection–diffusion equation (1) with the fourth-order compact discretization (2). Similar to FMG method, the EXFMG method starts with the coarsest grid to compute the solution by a direct solver, and applies an interpolation operator on the current grid to provide an initial guess for Algorithm 1 on the next finer grid. Besides, EXFMG method employs a fine mesh Richardson extrapolation technique [33] to get an extrapolation solution on each grid, when the two solutions with fourth-order accuracy on current and previous grids has been obtained by the Algorithm 1. The detailed algorithm is stated in Algorithm 3, where \(FMRE\) denotes a fine mesh Richardson extrapolation operator which will be defined and discussed in Sect. 4.2, \(\bar{u}_{i}^{*} \) and \(u_{j}^{*}\) denote the numerical solution and extrapolated solution on the grid \(\Omega_{i}\), respectively.

Algorithm 3
figure c

Extrapolation full multigrid method (EXFMG)

The key ingredients of this new method which are the main differences between the existing FMG methods include:

  1. (1)

    A bi-quartic Lagrange interpolation operator on coarse grid is taken as a full interpolation to provide a good initial guess on the next finer grid for multigrid iteration.

  2. (2)

    Instead of performing a fixed number of multigrid iterations at each level of grid as used in the usual FMG method, a tolerance \(\epsilon _{j}\) related to the relative residual is used on jth grid level (see line 4 in Algorithm 3), which enables us to conveniently calculate the approximate solution with the desired accuracy and keep suitable computational cost.

  3. (3)

    The FMG method only computes the fourth-order accuracy solution of each discretization system. But the extrapolation method based on the midpoint formula (see line 5 in Algorithm 3 and Sect. 4.2) enhances the solution accuracy on each grid (see numerical results section for details).

4.2 Fine mesh extrapolation operator

In the classical Richardson extrapolation formula, two solutions on fine and coarse grids are used to obtain an extrapolation solution on the coarse grid. Based on the Richardson extrapolation technique and interpolation theory, in 2017, Pan proposed a mid-point extrapolation technique to enhance the accuracy of approximations on fine grid directly and cheaply (see [33] for details). Now, we will introduce this strategy for 2D case in the following.

Assume that the notations \(u^{h}\) and \(u^{h/2}\) represent the fourth-order accurate solutions on coarse grid \(\Omega_{h}\) and fine grid \(\Omega_{h/2}\) with mesh size h and \(h/2\), respectively. For simplicity of description, we take a coarse cell \(I_{i,j}=[x_{i},x_{i+1}]\times [y_{j},y_{j+1}]\) of grid \(\Omega_{h}\) (see Fig. 1), use \(u_{i,j}^{h}\) and \(u_{i,j}^{h/2}\) to represent the fourth-order accurate solutions on the point \((x_{i},y _{j})\) of the coarse grid \(\Omega_{h}\) and the fine grid \(\Omega_{h/2}\), respectively. Here \((x_{i},y_{j+1/2}) \in \Omega_{h/2} \) denotes the mid-point of \((x_{i},y_{j}) \in \Omega_{h} \) and \((x_{i},y_{j+1}) \in \Omega_{h}\).

Figure 1
figure 1

Cells of coarse grid \(\Omega_{h}\) (a) and refined grid\(\Omega_{h/2}\) (b)

To obtain an extrapolation solution on the fine grid \(\Omega_{h/2}\), we first use the classical Richardson extrapolation formula,

$$ Eu_{s, t} = \frac{16}{15}u^{h/2}_{s, t} - \frac{1}{15}u^{h}_{s, t}, \quad s=i, i+1, t=j, j+1, $$
(5)

to get an extrapolation solution on the nodes \((x_{s},y_{t})\). Then we apply the mid-point extrapolation formula [33] for those nodes \((x_{s},y_{j+1/2}) \), \((x_{i+1/2},y_{t}) \) and \((x_{i+1/2},y _{j+1/2}) \), to obtain some formulas as follows:

$$\begin{aligned}& Eu_{s,j+1/2}= u^{ h/2}_{s,j+1/2} + \frac{1}{{30}} \bigl[ \bigl(u^{h/2} - u^{h} \bigr)_{s,j} + \bigl( u^{h/2} - u^{h} \bigr)_{s,j+1} \bigr], \quad s=i, i+1, \end{aligned}$$
(6)
$$\begin{aligned}& Eu_{i+1/2,t}= u^{h/2}_{i+1/2,t} + \frac{1}{30} \bigl[ \bigl(u^{h/2} - u^{h} \bigr)_{i ,t} + \bigl( u^{h/2} - u^{h} \bigr)_{i+1,t} \bigr], \quad t=j, j+1, \end{aligned}$$
(7)
$$\begin{aligned}& Eu_{i+1/2,j+1/2}= u^{h/2}_{i+1/2,j+1/2} + \frac{1}{{60}} \bigl[ \bigl(u^{h/2} - u ^{h} \bigr)_{i,j} + \bigl( u^{h/2} - u^{h} \bigr)_{i+1,j} + \bigl(u^{h/2} - u^{h} \bigr)_{i,j+1} \\& \hphantom{Eu_{i+1/2,j+1/2}= }{}+ \bigl( u^{h/2} - u^{h} \bigr)_{i+1,j+1} \bigr], \end{aligned}$$
(8)

in order to construct the corresponding extrapolation solution, respectively.

Taking the above four extrapolation formulas (5), (6), (7) and (8), we can obtain an extrapolation solution Eu, which is more accurate than the fourth-order accurate numerical solution \(u^{h/2}\) on the fine grid \(\Omega_{h/2}\). For simplicity, we denote this procedure from \(u^{h}\), \(u^{h/2}\) to Eu as an operator, we call it as fine mesh Richardson extrapolation (\(FMRE\)) interpolator

$$ \textstyle\begin{array}{l} Eu \Leftarrow FMRE(u^{h},u^{h/2}). \end{array} $$
(9)

Remark 4.1

It should be noted that the extrapolation interpolator \(FMRE\) is a local operation, which can be done very effectively.

4.3 Computational work

Throughout this paper, when using Algorithm 1 as a solver on each grid of the EXFMG method, we always set \(N_{\textrm{cycles}} =1\). Now we turn to estimate the computational cost of the EXFMG method in terms of \(work\) \(units\) (WUs). Roughly speaking, “1 WU” is the computational cost of performing one relaxation sweep on the finest grid. For simplicity, we neglect the amount of work needed to solve the equations on the coarsest grid and the transfer operators (include interpolation and restriction) between different levels of grids since it normally counts 10–20% of the total cost of the algorithm.

Assume that the \(m_{j}\) is the number of the MG cycles required on the grid \(\Omega _{j}\) when the MG solution satisfies the stopping criterion (see line 4 in Algorithm 3). Based on the above conditions, we can estimate the computational work of EXFMG with L levels of grids for d-dimensional problems as follows:

$$\begin{aligned} WU_{\textrm{EXFMG}} & \approx (v_{1} + v_{2}) \bigl[m_{L} +(m_{L}+m _{L-1}) 2^{ - d} + \cdots + (m_{L}+m_{L-1}+\cdots +m_{2}) 2^{ -( L-2)d} \bigr] \\ & = (v_{1} + v_{2})\sum_{j = 2}^{L} {\sum_{i = j}^{L} {m_{i}2^{ - d(L - j)} } } WU. \end{aligned}$$
(10)

5 Numerical experiments

In this section, we conduct numerical experiments with two examples both on the unit square domain \(\Omega =(0,1)\times (0,1)\). In the two test problems, the right-hand side function \(f(x,y)\) and the Dirichlet boundary conditions on Ω are prescribed to satisfy the given analytic solutions \(u(x,y)\). Our codes are written in Matlab and the programs are carried out on a desktop with Inter (R) Core(TM) i5-6200 U CPU (2.30 GHZ, 2.40 GHZ) and 4 GB RAM.

For comparison purposes, we denote the Algorithm 1 with \(N_{\textrm{cycles}} =1\) as MG. The iterative procedure of MG method starts with zero initial guesses and terminates when the approximation solution \(u_{L}^{*}\) on the finest grid satisfies the same stopping criterion \({{\Vert F_{L} - A_{L} u_{L}^{*} \Vert }} \le \epsilon _{L} {{\Vert F_{L} \Vert }}\) as the EXFMG algorithm.

In MG and EXFMG methods with L embedded grids, the standard bilinear interpolation is used to transfer corrections from the coarse grid to the fine grid, the full-weighting scheme is employed to project residual from the fine grid to the coarse grid, the Conjugate Gradient (CG) method is chosen as a smoother to eliminate the high frequency error, and the number of pre-smoothing and post-smoothing steps are set to be \(v_{1}=v_{2}=2\). \(\epsilon_{L}=10^{-10}\) is taken as the stopping tolerance on the finest grid.

In all numerical experiments, we use the notations u, \(\bar{u}_{j} ^{*}\) and \(u_{j}^{*}\) to denote the exact solution, numerical solution and extrapolation solution on the grid \(\Omega_{j}\), respectively. For convenience of comparison, we choose the \(L^{\infty }\)-norm and the \(L^{2}\)-norm to measure the error between \(u_{j}^{*}\) (or \(\bar{u}_{j}^{*}\)) and u, which are defined as

$$\begin{aligned}& \bigl\Vert u-u_{j}^{*} \bigr\Vert _{\infty }= \Vert e_{j} \Vert _{\infty }= \mathop{\max } _{(x, y) \in \Omega_{j}} \bigl\vert e_{j}(x,y) \bigr\vert , \\& \bigl\Vert u-u_{j}^{*} \bigr\Vert _{2} = \Vert e_{j} \Vert _{2} = h_{j} \sqrt{\sum _{(x, y) \in \Omega_{j} } { \bigl\vert e_{j}(x, y) \bigr\vert ^{2} } }. \end{aligned}$$

We also apply the definition

$$ \textrm{Order} = \frac{{\log (\Vert e_{j-1} \Vert /\Vert e_{j} \Vert )}}{{\log (h_{j-1} /h_{j})}},\quad j=2,\cdots ,L, $$

to represent the convergence order of the approximate solution. Here, \(\Vert \cdot \Vert \) is a given norm (such as \(L^{\infty }\), \(L^{2}\)). Besides, we use “CPU” , “WU” and “Tflops” to record the algorithm’s computational time in seconds, work units [8] and number of flops measured in \(TeraFlops\), respectively. “Iter” denotes the number of multigrid cycles required.

Example 5.1

([41, 42])

Consider the following differential equation:

$$ - u_{xx}(x,y)-u_{yy}(x,y)+ \frac{1}{\varepsilon (1+y)} u_{y}(x,y)=f(x,y), $$
(11)

with suitable Dirichlet boundary condition and right-hand side term \(f(x,y)\), such that the exact solution is

$$ u(x,y) = \exp (y-x)+2^{-1/\varepsilon }(1+y)^{1+1/\varepsilon }. $$
(12)

Here, \(\varepsilon =0.01\).

Example 5.2

([40])

Consider the convection–diffusion equation:

$$ - u_{xx}(x,y)-u_{yy}(x,y)+x(x-1) (1-2y) u_{x}(x,y)+ y(y-1) (1-2x) u _{y}(x,y)=f(x,y), $$
(13)

with the analytic solution

$$ u(x,y) = \exp \bigl(-2000 (x-0.5)^{2}-y^{2} \bigr). $$
(14)

The numerical results for Example 5.1 and 5.2 obtained by MG and EXFMG methods with five embedded grids are listed in Tables 1 and 2. When fixing \(32 \times 32\) as the coarsest grid \(\Omega _{1}\), Tables 38 list the numerical results of EXFMG method with the stopping criteria

$$ \epsilon_{j}=10^{j-L-10}, \quad j=2,3,\ldots ,L, $$
(15)

on each grid \(\Omega_{j}\), \(j=2,3,\ldots ,L\). We also present the numerical errors and computational costs (time and WU) in Figs. 2, 3, 4 and 5, respectively. Now we discuss those results in the following paragraphs.

Figure 2
figure 2

Comparison of the \(L^{\infty }\)-norm error \(\Vert u-u_{L}^{*} \Vert _{{\infty }}\) with different mesh size \(h_{L}\) (\(L=6\))

Figure 3
figure 3

Comparison of the \(L^{2}\)-norm error \(\Vert u-u_{L}^{*} \Vert _{{2}}\) with different mesh size \(h_{L}\) (\(L=6\))

Figure 4
figure 4

Comparison of the computational time with different mesh size \(h_{L}\) (\(L=6\))

Figure 5
figure 5

Comparison of the WU of MG and EXFMG methods with \(L=6\)

Table 1 Errors and costs of algorithms with \(L=5\) for different discretization system arising from Example 5.1
Table 2 Errors and costs of algorithms with \(L=5\) for different discretization system arising from Example 5.2
Table 3 Comparison of the \(L^{\infty }\) errors and convergence order on different grid level of MG and EXFMG methods for Example 5.1

For the accuracy, we find that the numerical solutions from the EXFMG method are much more accurate than those from the MG method (see Tables 1 and 2, Figs. 2 and 3). This means that, to achieve the same accuracy, fewer grid points are needed for the EXFMG method than for the MG method. For instance, the numerical solution by the EXFMG method on the \(256\times 256\) grid is comparable to the numerical solution obtained by the MG method on the \(512\times 512\) grid in Tables 1 and 2.

From Tables 3, 4, 5 and 6, we can see that the numerical solution \(\bar{u}^{*}_{j}\) of the EXFMG method as well as MG method, converges with fourth-order in both \(L^{\infty }\)-norm and \(L^{2}\)-norm while the extrapolated solution \(u^{*}_{j}\) achieves sixth-order accuracy on most levels of grids and starts to lose convergent order on fine grids since the requirement to achieve sixth-order accuracy on fine grids is much higher.

Table 4 Comparison of the \(L^{\infty }\) errors and convergence order on different grid level of MG and EXFMG methods for Example 5.2
Table 5 Comparison of the \(L^{2}\) errors and convergence order on different grid level of MG and EXFMG methods for Example 5.1
Table 6 Comparison of the \(L^{2}\) errors and convergence order on different grid level of MG and EXFMG methods for Example 5.2

Tables 7 and 8 list computational costs on each level of grids for the EXFMG method and MG methods, we find that WU as well as the total work cost of EXFMG method depends greatly on the number of multigrid iterations on the finest grid \(\Omega_{L}\). From Tables 1 and 2, we noticed that the EXFMG method takes fewer iterations on the finest grid, which is more efficient than the MG method. Therefore, the total computational cost (WU, Tflop and CPU time) of EXFMG method are much lower than that of the MG method, which is particularly true when mesh size is less or equal to \(\frac{1}{512}\) (see Tables 1, 2 , 7, 8 and Figs. 4, 5 for details).

Table 7 Comparison of the iteration number and computational cost (WU) on different grid level of MG and EXFMG methods for Example 5.1
Table 8 Comparison of the iteration number and computational cost (WU) on different grid level of MG and EXFMG methods for Example 5.2

From the above discussion, we can see that the EXFMG method not only achieves high-order accuracy but also keeps a low computational cost. Hence, it is a cost-effective numerical solver.

6 Conclusion

We present an EXFMG method combined with a fourth-order compact difference scheme, a bi-quartic Lagrange interpolation and a simple extrapolation technique, to solve the 2D convection–diffusion equation. Numerical experiments were conducted for two test problems to demonstrate that the proposed EXFMG method improves the solution accuracy and keeps less computational costs, compared to the classical MG method.

We need point out that the fourth-order compact difference method, which is employed to discretize the differential equation, can be replaced by other numerical methods, such as the FE method and the finite volume method. Furthermore, we also plan to extend this study and apply EXFMG algorithm with sixth-order combined compact difference scheme [4345] to solve unsteady three-dimensional convection–diffusion equations.