1 Introduction

This is the third paper in a series [12, 16] which is devoted to developing finite difference (FD) and discontinuous Galerkin (DG) methods for approximating viscosity solutions of the following general one-dimensional fully nonlinear second order elliptic and parabolic equations:

$$\begin{aligned} F \left( u_{x x}, u_x, u, x \right) = 0, \qquad x \in \Omega := (a,b) \subset \mathbf R , \end{aligned}$$
(1.1)

and

$$\begin{aligned} u_t + F \left( u_{x x}, u_x, u, x,t \right) = 0, \qquad (x,t) \in \Omega _T:=\Omega \times (0,T), \end{aligned}$$
(1.2)

which are complemented by appropriate boundary and initial conditions.

Fully nonlinear PDEs, which are nonlinear in the highest order derivatives of the solution functions in the equations, arise in many applications such as antenna design, astrophysics, differential geometry, fluid mechanics, image processing, meteorology, mesh generation, optimal control, optimal mass transport, etc (cf. [11, section 5]), and, as a result, the solution of each of these application problems critically depends on the solution of their underlying fully nonlinear PDEs. In particular, it calls for efficient and reliable numerical methods for computing the viscosity solutions of these fully nonlinear PDEs. Currently, the availability of such numerical methods is very limited (cf. [11]).

The goal of this paper is to design and implement a class of nonstandard local discontinuous Galerkin (LDG) methods for the fully nonlinear Eqs. (1.1) and (1.2). The more involved high dimensional generalizations of the nonstandard LDG methods of this paper will be reported elsewhere in [17]. The methods of this paper are designed to complement the interior penalty discontinuous Galerkin (IP-DG) methods for fully nonlinear second order equations developed in [16], where the focus is on approximating PDEs (1.1) and (1.2) whose viscosity solutions belong to \(C^1\).

To present the main ideas of our nonstandard LDG methods, we first briefly describe the nonstandard LDG method proposed by Yan and Osher [22] for approximating the viscosity solution of the Hamilton-Jacobi equation: \(u_t+H(\nabla u, u, x,t)=0\). The main ideas of [22] are to approximate the “left” and “right” side first order derivatives of the viscosity solution and to judiciously combine them through a monotone and consistent numerical Hamiltonian such as the Lax-Friedrichs numerical Hamiltonian. We note that the idea of pulling the highest order derivative(s) outside fully nonlinear PDEs is essential because it allows one to take advantages of DG techniques to discretize the given fully nonlinear PDEs. Our nonstandard LDG methods to be presented below are exactly inspired by this idea, although the realization of this idea for fully nonlinear second order PDEs is more involved. Below we highlight the main steps/ideas of the construction of our nonstandard LDG framework.

Because of the full nonlinearity, integration by parts, which is the necessary tool for constructing any DG method, cannot be performed on Eq. (1.1). The first key idea of this paper is to introduce the auxiliary variables \(p:=u_{x x}\) and \(q:= u_x\) and rewrite the original fully nonlinear PDE in the following nonstandard mixed form:

$$\begin{aligned} F(p,q,u,x)&= 0, \end{aligned}$$
(1.3)
$$\begin{aligned} q- u_x&= 0,\end{aligned}$$
(1.4)
$$\begin{aligned} p-q_x&= 0. \end{aligned}$$
(1.5)

Unfortunately, since \(u_x\) and \(u_{x x}\) may not exist for a viscosity solution \(u\in C^0(\Omega )\), the above mixed form may not make sense. To overcome this difficulty, our second key idea is to replace \(q=u_x\) by two possible values of \(u_x\), namely, its left and right limits, and \(p= q_x\) by two possible values for each possible \(q\). Thus, we have the auxiliary variables \(q^-, q^+ : \Omega \rightarrow \mathbf R \) and \(p^{- -}, p^{- +}, p^{+ -}, p^{+ +} : \Omega \rightarrow \mathbf R \) such that

$$\begin{aligned} q^-(x)-u_x(x^-)&= 0, \end{aligned}$$
(1.6)
$$\begin{aligned} q^+(x)-u_x(x^+)&= 0, \end{aligned}$$
(1.7)
$$\begin{aligned} p^{- -}(x)-q^-_{x}(x^-)&= 0, \end{aligned}$$
(1.8)
$$\begin{aligned} p^{- +}(x)-q^-_{x}(x^+)&= 0, \end{aligned}$$
(1.9)
$$\begin{aligned} p^{+ -}(x)-q^+_{x}(x^-)&= 0, \end{aligned}$$
(1.10)
$$\begin{aligned} p^{+ +}(x)-q^+_{x}(x^+)&= 0. \end{aligned}$$
(1.11)

We remark that (1.6) paired with the Eq. (1.8) or (1.9), and (1.7) paired with Eq. (1.10) or (1.11), can each be regarded as a “one-sided” Poisson problem in \(u\) (in a mixed form) with source terms \(p^{- -}, p^{- +}, p^{+ -}, p^{+ +}\), respectively.

To incorporate the multiple values of \(u_x\) and \(u_{x x}\), Eq. (1.3) must be modified because \(F\) is only defined for single value functions \(p\) and \(q\). To this end, we need the third key idea of this paper, that is, to replace (1.3) by

$$\begin{aligned} \widehat{F}(p^{- -}, p^{- +}, p^{+ -}, p^{+ +}, q^-, q^+, u, x) = 0, \end{aligned}$$
(1.12)

where \(\widehat{F}\), which is called a numerical operator, should be some well-chosen approximation to \(F\).

Natural questions now arise regarding the choice of \(\widehat{F}\). For example, what are criteria for \(\widehat{F}\) and how to construct such a numerical operator? These are two immediate questions which must be addressed. To do so, we need the fourth key idea of this paper, which is to borrow and adapt the notion of the numerical operators from our previous work [12] where a general finite difference framework has been developed for fully nonlinear second order PDEs. In summary, the criteria for \(\widehat{F}\) include consistency and g-monotonicity (generalized monotonicity), for which precise definitions can be found in Sect. 2. It should be pointed out that in order to construct the desired numerical operator \(\widehat{F}\), a fundamental idea used in [12] is to introduce the concept of the numerical moment, which can be regarded as a direct numerical realization for the moment term in the vanishing moment methodology introduced in [10] (also see [11, section 4], [9]).

Finally, we need to design a DG discretization for the mixed system (1.6)–(1.12) to complete the construction of our LDG method. This then calls for the fifth key idea of this paper, which is to use different numerical fluxes in the formulations of LDG methods for the four “one-sided” Poisson problems in their mixed forms described by (1.6)–(1.11). We remark that, to the best of our knowledge, this is one of a few scenarios in numerical PDEs where the flexibility and superiority (over other numerical methodologies) of the DG methodology makes a vital difference.

At this point, it is clear why we use the word “nonstandard” to indicate the differences between our LDG methods and the standard LDG methods [6] for linear and quasilinear PDEs. In the standard LDG methods, one only needs to introduce one copy of the vector \(q:=\nabla u\), and there is no need to introduce multiple copies of \(p:=D^2 u\) as independent unknowns to approximate. We also note that in the nonstandard IP-DG framework developed in [16], because \(u\) is assumed to be in \(C^1\), \(q:=\nabla u\) is not introduced as an unknown function, instead, \(\nabla u_h\) is hard computed in the IP-DG methods and the approximated sided Hessians \(p^{- -}_h, p^{- +}_h, p^{+ -}_h, p^{+ +}_h\) are defined directly through \(u_h\). It is also interesting to point out that unlike the relationship between standard LDG and IP-DG methods (cf. [1]), due to fully nonlinear structure of the PDEs, no integration by parts can be performed, as a result, the “primal” forms of the nonstandard LDG methods of this paper are intrinsically different from the nonstandard IP-DG methods of [16] and they may exhibit different properties, especially in high dimensions (cf. [17]).

This paper consists of four additional sections. In Sect. 2 we collect some preliminaries including the definition of viscosity solutions, the definitions of the consistency and g-monotonicity of numerical operators, and the concept of the numerical moment. In Sect. 3 we give the detailed formulation of LDG methods for fully nonlinear elliptic equation (1.1) following the outline described above. In Sect. 4 we consider both explicit and implicit in time fully discrete LDG methods for the fully nonlinear parabolic equation (1.2). The explicit four stage classical Runge-Kutta method and the implicit trapezoidal method combined with the spatial LDG methods will be explicitly constructed. In Sect. 5 we present a number of numerical experiments for the proposed LDG methods for the fully nonlinear elliptic equation (1.1) and their fully discrete counterparts for the parabolic equation (1.2). These numerical experiments not only verify the accuracy of the proposed LDG methods but also demonstrate the efficiency and utility of these methods.

2 Preliminaries

Standard space notations are adopted in this paper. For example, \(B(\Omega ), USC(\Omega )\) and \(LSC(\Omega )\) denote, respectively, the spaces of bounded, upper semi-continuous, and lower semicontinuous functions on \(\Omega \). For any \(v\in B(\Omega )\), we define

$$\begin{aligned} v^*(x):=\limsup _{y\rightarrow x} v(y) \qquad \hbox {and}\qquad v_*(x):=\liminf _{y\rightarrow x} v(y). \end{aligned}$$

Then, \(v^*\in USC(\Omega )\) and \(v_*\in LSC(\Omega )\), and they are called the upper and lower semicontinuous envelopes of \(v\), respectively. If \(v\) is continuous, there obviously holds \(v=v^*=v_*\).

Let \(F: \mathcal S ^{d\times d}\times \mathbf{R }^d\times \mathbf{R }\times \overline{\Omega }\rightarrow \mathbf{R }\) be a bounded function, where \(\mathcal S ^{d\times d}\) denotes the set of \(d\times d\) symmetric real matrices. Then, the general second order fully nonlinear PDE takes the form

$$\begin{aligned} F(D^2u,\nabla u, u, x) = 0 \qquad \hbox {in } \overline{\Omega }. \end{aligned}$$
(2.1)

Note that here we have used the convention of writing the boundary condition as a discontinuity of the PDE (cf. [3, p.274]).

The following two definitions can be found in [3, 4, 13].

Definition 2.1

Equation (2.1) is said to be elliptic if, for all \((\mathbf{q },\lambda ,x)\in \mathbf{R }^d\times \mathbf{R }\times \overline{\Omega }\), there holds

$$\begin{aligned} F(A, \mathbf{q }, \lambda , x) \le F(B, \mathbf{q }, \lambda , x) \qquad \forall A,B\in \mathcal S ^{d\times d},\, A\ge B, \end{aligned}$$
(2.2)

where \(A\ge B\) means that \(A-B\) is a nonnegative definite matrix. We note that when \(F\) is differentiable, the ellipticity also can be defined by requiring that the matrix \(\frac{\partial F}{\partial A}\) is negative semi-definite (cf. [13, p. 441]).

Definition 2.2

A function \(u\in B(\Omega )\) is called a viscosity subsolution (resp. supersolution) of (2.1) if, for all \(\varphi \in C^2(\overline{\Omega })\), if \(u^*-\varphi \) (resp. \(u_*-\varphi \)) has a local maximum (resp. minimum) at \(x_0\in \overline{\Omega }\), then we have

$$\begin{aligned} F_*(D^2\varphi (x_0),\nabla \varphi (x_0), u^*(x_0), x_0) \le 0 \end{aligned}$$

(resp. \(F^*(D^2\varphi (x_0),\nabla \varphi (x_0), u_*(x_0), x_0) \ge 0\)). The function \(u\) is said to be a viscosity solution of (2.1) if it is simultaneously a viscosity subsolution and a viscosity supersolution of (2.1).

We note that if \(F\) and \(u\) are continuous, then the upper and lower \(*\) indices can be removed in Definition 2.2. The definition of ellipticity implies that the differential operator \(F\) must be non-increasing in its first argument in order to be elliptic. It turns out that ellipticity provides a sufficient condition for Eq. (2.1) to fulfill a maximum principle (cf. [4, 13]). From the above definition it is clear that viscosity solutions in general do not satisfy the underlying PDEs in a tangible sense, and the concept of viscosity solutions is nonvariational. Such a solution is not defined through integration by parts against arbitrary test functions; hence, it does not satisfy an integral identity. This nonvariational nature of viscosity solutions is the main obstacle that prevents direct construction of Galerkin-type methods, which require variational formulations to start.

The following definitions are adapted from [12] in the case \(d=1\).

Definition 2.3

  1. (i)

    A function \(\widehat{F}: \mathbf R ^8\rightarrow \mathbf R \) is called a numerical operator.

  2. (ii)

    A numerical operator \(\widehat{F}\) is said to be consistent (with the differential operator \(F\)) if \(\widehat{F}\) satisfies

    $$\begin{aligned} \liminf \limits _{\mathop {{p^{\mu \nu }\rightarrow p, \mu , \nu = +, -}}\limits _{{q^\pm \rightarrow q, \lambda _1\rightarrow \lambda ,\xi _1\rightarrow \xi }}} \widehat{F}({{\varvec{p}}}^{- -},p^{- +},p^{+ -},p^{+ +},q^-,q^+,\lambda _1, \xi _1) \ge {{\varvec{F}}}_*(p,q,\lambda ,\xi ),\end{aligned}$$
    (2.3)
    $$\begin{aligned} \limsup \limits _{\mathop {{p^{\mu \nu }\rightarrow p, \mu , \nu = +, -}}\limits _{{q^\pm \rightarrow q, \lambda _1\rightarrow \lambda ,\xi _1\rightarrow \xi }}} \widehat{F}({{\varvec{p}}}^{- -},p^{- +},p^{+ -},p^{+ +},q^-,q^+,\lambda _1, \xi _1) \le {{\varvec{F}}}^*(p,q,\lambda ,\xi ), \end{aligned}$$
    (2.4)

    where \(F_*\) and \(F^*\) denote respectively the lower and the upper semi-continuous envelopes of \(F\).

  3. (iii)

    A numerical operator \(\widehat{F}\) is said to be g-monotone if \(\widehat{F}(p^{- -},p^{- +},p^{+ -},p^{+ +},q^-, q^+,\lambda ,\) \(\xi )\) is monotone increasing in \(p^{- -}\) and \(p^{+ +}\) and monotone decreasing in \(p^{- +}\) and \(p^{+ -}\), that is, \(\widehat{F}(\uparrow ,\downarrow ,\downarrow ,\uparrow ,q^-,q^+,\lambda ,\xi )\).

We remark that the above consistency and g-monotonicity play a critical role in the finite difference framework established in [12]. They also play an equally critical role in the LDG framework of this paper. In practice, the consistency is easy to fulfill and to verify, but the g-monotonicity is not. In order to ensure the g-monotonicity, one key idea of [12] is to introduce the numerical moment. The following is an example of a so-called Lax-Friedrichs-like numerical operator adapted from [12]:

$$\begin{aligned} \widehat{F}(p^{- -},p^{- +},p^{+ -},p^{+ +},q^-,q^+,\lambda , \xi )&:= F \bigl (\frac{p^{- +} + p^{+ -}}{2},\frac{q^- + q^+}{2},\lambda ,\xi \bigr ) \nonumber \\&+\,\,\alpha \bigl (p^{- -} - p^{- +} - p^{+ -} + p^{+ +} \bigr ), \end{aligned}$$
(2.5)

where \(\alpha \in \mathbf R \) is an undetermined positive constant and the last term in (2.5) is called the numerical moment. It is trivial to verify that \(\widehat{F}\) is consistent with \(F\). By choosing \(\alpha \) correctly, we can also ensure g-monotonicity. For example, suppose \(F\) is differentiable and there exists a positive constant \(M\) such that

$$\begin{aligned} M > \left| \frac{\partial F}{\partial u_{x x}} \right| . \end{aligned}$$
(2.6)

Then, it is trivial to check that the Lax-Friedrichs-like numerical operator is g-monotone provided that \(\alpha \ge M\).

We conclude this section with a few remarks about the above definitions.

Remark 2.1

  1. (a)

    By the definition of the ellipticity for \(F\), the monotonicity constraints on \(\widehat{F}\) with respect to \(p^{- +}\) and \(p^{+ -}\) in the definition of g-monotonicity are natural.

  2. (b)

    By choosing the numerical moment correctly, the numerical operator \(\widehat{F}\) then behaves like a uniformly elliptic operator, even if the PDE operator \(F\) is a degenerate elliptic operator. The consistency assumption then guarantees that the numerical operator is still a reasonable approximation for the PDE operator.

  3. (c)

    Sometimes it may not be feasible to globally bound \(\frac{\partial F}{\partial u_{x x}}\); however, it is sufficient to chose a value for \(\alpha \) such that the g-monotonicity property is preserved locally over each iteration of the nonlinear solver for a given initial guess.

  4. (d)

    The role of the numerical moment as well as the interpretation of the numerical moment will be further discussed in Sect. 5.3.

3 Formulation of LDG Methods for Elliptic Problems

We first consider the elliptic problem (1.1) with boundary conditions

$$\begin{aligned} u(a) = u_a \quad \hbox {and}\quad u(b) = u_b \end{aligned}$$
(3.1)

for two given constants \(u_a\) and \(u_b\).

Let \(\left\{ x_j \right\} _{j=0}^J \subset \overline{\Omega }\) be a mesh for \(\overline{\Omega }\) such that \(x_0 = a\) and \(x_J = b\). Define \(I_{j} = \left( x_{j-1}, x_{j} \right) \) and \(h_j = x_{j} - x_{j-1}\) for all \(j = 1, 2, \ldots , J, h_0 = h_{J+1} = 0\), and \(h = \max _{1 \le j \le J} h_j\). Let \(\mathcal T _h\) denote the collection of the intervals \(\{I_j\}_{j=1}^J\) which form a partition of the domain \(\overline{\Omega }\). We also introduce the broken \(H^1\)-space and broken \(C^0\)-space

$$\begin{aligned} H^1(\mathcal T _h):= \prod _{I\in \mathcal T _h} H^1(I), \qquad C^0(\mathcal T _h):=\prod _{I\in \mathcal T _h} C^0(\overline{I}), \end{aligned}$$

and the broken \(L^2\)-inner product

$$\begin{aligned} (v,w)_{\mathcal{T }_h}:= \sum _{j=1}^J \int \limits _{I_j} v w\, dx \qquad \forall v,w\in L^2(\Omega ). \end{aligned}$$

For a fixed integer \(r \ge 0\), we define the standard DG finite element space \(V^h \subset H^1(\mathcal T _h)\subset L^2 (\mathcal{T }_h)\) as

$$\begin{aligned} V^h := \prod _{I \in \mathcal{T }_h} \mathcal{P }_{r} (I), \end{aligned}$$

where \( \mathcal{P }_{\textit{r}} (I)\) denotes the set of all polynomials on \(I\) with degree not exceeding \(r\). We also introduce the following standard jump notation:

$$\begin{aligned}{}[v_h(x_j)] := v_h(x_j^-)-v_h(x_j^+) \qquad \hbox {for } j=1,2,\cdots , J-1. \end{aligned}$$

We now are ready to formulate our LDG discretizations for Eqs. (1.6)–(1.12). First, for (fully) nonlinear equation (1.12) we simply approximate it by its broken \(L^2\)-projection into \(V^h\), namely,

$$\begin{aligned} {a}_0 \bigl (u_h, q^-_{h}, q^+_{h}, p^{- -}_{h}, p^{- +}_{h}, p^{+ -}_{h}, p^{+ +}_{h}; \phi _{0h} \bigr ) = 0 \qquad \forall \phi _{0h} \in V^h, \end{aligned}$$
(3.2)

where

$$\begin{aligned} {a}_0 (v, {\textit{q}}^-, q^+, p^{- -}, p^{- +}, p^{+ -}, p^{+ +}; \phi ) =\Bigl (\widehat{F}({\textit{p}}^{- -}, p^{- +}, p^{+ -}, p^{+ +}, q^{-}, q^{+}, v,\cdot ),\phi \Bigr )_{\mathcal{T }_h}. \end{aligned}$$

Next, we discretize the four linear equations (1.8)–(1.11). Notice that for given “sources” \(\{p^{\mu \nu } \}_{\mu , \nu = +, -}\), (1.6) and (1.8), (1.6) and (1.9), (1.7) and (1.10), and (1.7) and (1.11) are four (different) Poisson equations for \(u\). Thus, we can use the mixed upwinding LDG formulation for the Laplacian operator to discretize these equations. The only difference in the four equations will be how we choose our upwinding numerical fluxes for \(u_h, q^-_{h}\) and \(q^+_{h}\). To realize the above strategy, we first define the element-wise LDG formulation, and we then define the whole domain LDG formulation afterward.

3.1 Element-Wise LDG Formulation

Suppose that values for \(u_h(a^-), u_h(b^+), q^\pm _{h}(a^-)\), and \(q^\pm _{h}(b^+)\) are given. We postpone explaining how these values are chosen until Sect. 3.2. Our LDG discretization of Eqs. (1.6)–(1.11) is defined as follows: for all \(\phi ^\pm _{h}\in V^h\),

$$\begin{aligned} \int \limits _{I_j} {\textit{q}}^\pm _{h} \, \phi ^\pm _{h} \, dx + \int \limits _{I_j} u_h \, (\phi ^\pm _{h})_x \, dx = u_h(x_j^\pm ) \, \phi ^\pm _{h}(x_j^-) - u_h(x_{j-1}^\pm ) \, \phi ^\pm _{h} (x_{j-1}^+) \end{aligned}$$
(3.3)

and, for all \(\psi ^{\mu \nu }_{h} \in V^h\),

$$\begin{aligned} \int \limits _{I_j} p^{{{\mu }}\nu }_{\textit{h}} \, \psi ^{\mu \nu }_{h} \, dx + \int \limits _{I_j} q^\mu _{h} \, (\psi ^{\mu \nu }_{h})_x\, dx = q^\mu _{h}(x_j^\nu ) \, \psi ^{\mu \nu }_{h}(x_j^-) - q^\mu _{h}(x_{j-1}^\nu ) \, \psi ^{\mu \nu }_{h} (x_{j-1}^+) \end{aligned}$$
(3.4)

for \(\mu , \nu = +, -\), for all \(j=1,2,\cdots ,J\). Notice that the nodal values from the right or left and the choice of \(q^\pm _h\) in (3.4) follow directly from Eqs. (1.6)–(1.11).

3.2 Boundary Numerical Fluxes

To complete the construction, we must specify how the boundary numerical flux values for \(u_h, q^-_{h}\), and \(q^+_{h}\) are determined in the above formulation. Due to the inherent jumps of piecewise constant functions, which corresponds to the case \(r = 0\), we shall consider the two cases \(r \ge 1\) and \(r = 0\) separately.

When \(r \ge 1\), we have freedom to control how the functions \(u_h\), \(q^-_{h}\), and \(q^+_{h}\) approach the boundary. Thus, we can assume continuity across the boundary for \(u_h, q^-_{h}\), and \(q^+_{h}\). Considering the boundary conditions given by (3.1), the continuity requirement naturally leads to

$$\begin{aligned} u_h(a^\pm ) = u_a, \qquad u_h(b^\pm ) = u_b. \end{aligned}$$
(3.5)

On the other hand, since no boundary data for \(q^-_{h}\) or \(q^+_{h}\) is given, any choice of the boundary numerical fluxes for them is a guess (unless one already knows the exact solution \(u\)). Here we choose

$$\begin{aligned} q^\pm _{h}(a^-) = q^\pm _{h}(a^+), \qquad q^\pm _{h}(b^+) = q^\pm _{h}(b^-). \end{aligned}$$
(3.6)

It is important to note that both \(q^\pm _{h}(a^+)\) and \(q^\pm _{h}(b^-)\) are treated as unknowns in the above LDG formulation. The choice (3.6) is equivalent to requiring that \(q^\pm _{h}\) is continuous at the boundary nodes \(x=a\) and \(x=b\).

We now consider the case \(r=0\). To define the boundary numerical fluxes, we first examine the consequences of the interior flux choices represented by the above LDG formulation. Suppose \(\mathcal T _h\) is a uniform mesh and denote the midpoint of \(I_j\) by \(\hat{x}_j\) for all \(I_j \in \mathcal T _h\). Define \(U_j := u^h \left( \hat{x}_{j} \right) \). Then, it follows from (3.3) and (3.4) that

$$\begin{aligned} q^-_{h} \left( \hat{x}_j \right)&= \frac{ U_j - U_{j-1} }{h} := \delta _x^- U_j, \end{aligned}$$
(3.7)
$$\begin{aligned} q^+_{h} \left( \hat{x}_j \right)&= \frac{ U_{j+1} - U_j }{h} := \delta _x^+ U_j, \end{aligned}$$
(3.8)
$$\begin{aligned} p^{- -}_{h} \left( \hat{x}_j \right)&= \frac{q^-_{h}(\hat{x}_{j}) - q^-_{h}(\hat{x}_{j-1})}{h} = \frac{ U_{j-2} - 2 U_{j-1} + U_j }{h^2} := \delta _x^2 U_{j-1}, \end{aligned}$$
(3.9)
$$\begin{aligned} p^{- +}_{h} \left( \hat{x}_j \right)&= \frac{q^-_{h}(\hat{x}_{j+1}) - q^-_{h}(\hat{x}_{j})}{h} = \frac{ U_{j-1} - 2 U_j + U_{j+1} }{h^2} := \delta _x^2 U_{j}, \end{aligned}$$
(3.10)
$$\begin{aligned} p^{+ -}_{h} \left( \hat{x}_j \right)&= \frac{q^+_{h}(\hat{x}_{j}) - q^+_{h}(\hat{x}_{j-1})}{h} = \frac{ U_{j-1} - 2 U_j + U_{j+1} }{h^2} := \delta _x^2 U_{j}, \end{aligned}$$
(3.11)
$$\begin{aligned} p^{+ +}_{h} \left( \hat{x}_j \right)&= \frac{q^+_{h}(\hat{x}_{j+1}) - q^+_{h}(\hat{x}_{j})}{h} = \frac{ U_{j} - 2 U_{j+1} + U_{j+2} }{h^2} := \delta _x^2 U_{j+1}, \end{aligned}$$
(3.12)

for \(j = 3, 4, \ldots , J-2\). Thus, in order to define boundary values for \(u_h, q^-_{h}\), and \(q^+_{h}\), we need to define ghost values \(U_{-1}, U_0, U_{J+1}\), and \(U_{J+2}\) that are equivalent to extending the solution \(u\) to the outside of the domain \(\Omega \). Below we describe a natural way to do such an extension that is consistent with the interpretation of the auxiliary variables.

From the Dirichlet boundary data for \(u\), a natural choice is that \(U_{0} = u_a\) and \(U_{J+1} = u_b\). This is equivalent to assuming

$$\begin{aligned} u_h(a^-) = u_a, \qquad u_h(b^+) = u_b. \end{aligned}$$
(3.13)

In other words, we extend the boundary data for \(u\) away from the boundary over an interval of length \(h\). Due to the inherent discontinuities of the piecewise constant functions, \(u_h(a^+)\) and \(u_h(b^-)\) are treated as unknowns. Otherwise, the boundary data would be extended into the interior of the domain over an interval of length \(h\).

From (3.7) and (3.8) we see that \(q^+_{h} \left( \hat{x}_j \right) = q^-_{h} \left( \hat{x}_{j+1} \right) \) and \(q^-_{h} \left( \hat{x}_j \right) = q^+_{h} \left( \hat{x}_{j-1} \right) \) in the interior of the domain. Extending this relationship to the boundary yields

$$\begin{aligned} q^+_{h} (a^-) = q^-_{h} (a^+), \qquad q^-_{h} ( b^+) = q^+_{h} (b^-), \end{aligned}$$
(3.14)

where both \(q^-_{h}(a^+)\) and \(q^+_h(b^-)\) are treated as unknowns in the above LDG formulation.

Finally, we need to define values for \(q^-_{h}(a^-)\) and \(q^+_{h}(b^+)\). Using [10] as a guide, we are led to choosing

$$\begin{aligned} q^-_{h}(a^-) = q^-_{h}(a^+), \qquad q^+_{h}(b^+) = q^+_{h}(b^-). \end{aligned}$$
(3.15)

We note that this is consistent with discretizing the auxiliary boundary conditions

$$\begin{aligned} (q^-_{h})_x(a) = (q^+_{h})_x(b) = 0. \end{aligned}$$
(3.16)

In order words, we require that \(q^-_{h}\) and \(q^+_{h}\) are constant across the boundary. Using ghost values, the above requirements are equivalent to imposing the constraints

$$\begin{aligned} U_{-1} = 2 u_a - U_1, \qquad U_{J+2} = 2 u_b - U_J. \end{aligned}$$

Remark 3.1

From the imposed boundary conditions we can see that the relationship \(p^{- +}_{h} = p^{+ -}_{h}\) has been extended to the boundaries. Thus, using the ghost values defined above and substituting the equations (3.7)–(3.12) into (3.2), we successfully recover the convergent finite difference method defined in [12] for the grid function \(U\). Hence, for \(r=0\), the convergence of the proposed LDG method is obtained. Heuristically, using higher order elements should increase the rate and/or accuracy of convergence.

3.3 Whole Domain LDG Formulation

Using the above element-wise LDG formulation (3.3) and (3.4), and substituting the boundary numerical flux values from Sect. 3.2, we get the following whole domain LDG discretization of (1.6)–(1.11):

$$\begin{aligned} \left( q^\pm _{h}, \phi ^\pm _{h} \right) _\mathcal{T _h} + {a}^\pm (u_h, \phi ^\pm _{h} )&= {f}^\pm (\phi ^\pm _{h}), \quad \forall \phi ^\pm _{h} \in V^h, \end{aligned}$$
(3.17)
$$\begin{aligned} \left( p^{\mu \nu }_{h}, \psi ^{\mu \nu }_{h} \right) _\mathcal{T _h} + {\textit{b}}^{\mu \nu } (q^-_{h}, q^+_{h};\psi ^{\mu \nu }_{h} )&= 0, \quad \forall \psi ^{\mu \nu }_{h} \in V^h, \,\, \mu , \nu = +, -, \end{aligned}$$
(3.18)

where

$$\begin{aligned} {a}^- (v, \varphi )&= ( v, \varphi _x)_\mathcal{T _h} - (1-\kappa _r) \, v(b^-) \, \varphi (b^-) -\sum _{j=1}^{J-1} v (x_{j}^-) \bigl [ \varphi (x_{j}) \bigr ], \\ {a}^+ (v, \varphi )&= ( v, \varphi _x)_\mathcal{T _h} + (1-\kappa _r) \, v(a^+) \, \varphi (a^+) -\sum _{j=1}^{J-1} v (x_{j}^+) \bigl [ \varphi (x_{j}) \bigr ], \\ {b}^{- -} (v^-, v^+; \varphi )&= ( v^-, \varphi _x)_\mathcal{T _h} + v^-(a^+) \, \varphi (a^+) - v^-(b^-) \, \varphi (b^-) -\sum _{j=1}^{J-1} v^- (x_{j}^-) \bigl [ \varphi (x_{j}) \bigr ], \\ {b}^{+ +} (v^-, v^+; \varphi )&= ( v^+, \varphi _x)_\mathcal{T _h} + v^+(a^+) \, \varphi (a^+) - v^+(b^-) \, \varphi (b^-) -\sum _{j=1}^{J-1} v^+ (x_{j}^+) \bigl [ \varphi (x_{j}) \bigr ], \\ {b}^{- +} (v^-, v^+; \varphi )&= ( v^-, \varphi _x)_\mathcal{T _h} + v^-(a^+) \, \varphi (a^+)- (1 - \kappa _r) \, v^+(b^-) \, \varphi ({{b}}^-) \\&\quad - \kappa _r \, v^-(b^-) \, \varphi (b^-) -\sum _{j=1}^{J-1} v^- (x_{j}^+) \bigl [ \varphi (x_{j}) \bigr ], \\ {b}^{+ -} (v^-, v^+; \varphi )&= ( v^+, \varphi _x)_\mathcal{T _h}+ (1 - \kappa _r) \, v^-(a^+) \, \varphi (a^+) + \kappa _r \, v^+(a^+) \, \varphi (a^+) \\&\quad - v^+(b^-) \, \varphi ({\textit{b}}^-) -\sum _{j=1}^{J-1} v^+ (x_{j}^-) \bigl [ \varphi (x_{j}) \bigr ], \end{aligned}$$

and

$$\begin{aligned} {f}^- (\phi )&= \kappa _r \, u_b \, \phi (b^-) - u_a \, \phi (a^+), \\ {f}^+ (\phi )&= u_b \, \phi (b^-) - \kappa _r \, u_a \, \phi (a^+), \end{aligned}$$

for

$$\begin{aligned} \kappa _r = \left\{ \begin{array}{ll} 0 &{} \text {if } r=0, \\ 1 &{} \text {otherwise}.\\ \end{array}\right. \end{aligned}$$
(3.19)

In summary, our nonstandard LDG methods for the fully nonlinear Dirichlet problem (1.1) and (3.1) are defined as seeking \(\bigl (u_h, q^-_{h}, q^+_{h}, p^{- -}_{h}, p^{- +}_{h}, p^{+ -}_{h}, p^{+ +}_{h} \bigr ) \in \left( V^h \right) ^7\) such that (3.2), (3.17), and (3.18) hold.

We conclude the section with a few remarks.

Remark 3.2

  1. (a)

    Looking backwards, (3.17) and (3.18) provide a proper interpretation for each of \(q^\pm _{h}\) and \(p^{\mu \nu }_{h}\) for \(\mu , \nu = +, -\), for a given function \(u_h\). Each \(q^\pm _{h}\) defines a discrete derivative for \(u_h\) and each \(p^{\mu \nu }_{h}\) defines a discrete second-order derivative for \(u_h\). The functions \(q^-_{h}\) and \(q^+_{h}\) should be very close to each other if \(u_x\) exists. Similarly, the functions \(p^{- -}_{h}, p^{- +}_{h}, p^{+ -}_{h}\), and \(p^{+ +}_{h}\) should be very close to each other if \(u_{x x}\) exists. However, their discrepancies are expected to be large if \(u_x\) or \(u_{x x}\), respectively, do not exist. The auxiliary functions \(q^\pm _{h}\) defined by (3.17) and the auxiliary functions \(p^{\mu \nu }_{h}\) defined by (3.18) can be regarded as high order extensions of their lower order finite difference counterparts defined in [12].

  2. (b)

    It is easy to check that the linear equations defined by (3.17)–(3.18) are linearly independent.

  3. (c)

    Notice that (3.2), (3.17), and (3.18) form a nonlinear system of equations, with the nonlinearity only appearing in \({a}_0\). Thus, a nonlinear solver is necessary in implementing the above scheme. In Sect. 5, an iterative method is used with initial guess given by the linear interpolant of the boundary data. Since a good initial guess is essential for most nonlinear solvers to converge, another possibility is to first linearize the nonlinear operator and solve the resulting linear system first. However, we show in our numerical tests that the simple initial guess works well in many cases. We suspect that the g-monotonicity of \(\widehat{F}\) enlarges the domain of “good” initial guesses over which the iterative method converges.

4 Formulation of Fully Discrete LDG Methods for Parabolic Problems

The goal of this section is to extend the LDG methods for elliptic problems to solving the initial-boundary value problem (1.2) using the method of lines. Let the initial condition be given by

$$\begin{aligned} u(x,0) = u_0(x), \qquad \forall x \in \Omega , \end{aligned}$$
(4.1)

and the boundary conditions be given by

$$\begin{aligned} u(a,t) = u_a(t), \qquad u(b,t) = u_b(t), \qquad \forall t \in (0,T]. \end{aligned}$$
(4.2)

We shall consider both the implicit trapezoidal rule and the (explicit) fourth order classical Runge–Kutta method (i.e., RK4) for the time-discretization. In practice, the time-discretization scheme should be chosen to match the order of the spatial discretization. Thus, when using a piecewise constant element, a sufficient choice for the time discretization would be forward or backward Euler. However, when using higher order elements, a higher order scheme such as RK4 should be chosen.

We first formulate the semi-discrete in space discretization for Eq. (1.2), which is a straightforward adaptation of the one described in Sect. 3. Let \(\phi \in V^h\). Replacing the PDE operator with a numerical operator in (1.2), and using the LDG framework of Sect. 3, we obtain the semi-discrete equation

$$\begin{aligned} \bigl ( \left( u_{h} \right) _t, \phi _h \bigr )_\mathcal{T _h} = - \bigl ( \widehat{F}\left( p^{- -}_{h}, p^{- +}_{h}, p^{+ -}_{h}, p^{+ +}_{h}, q^-_{h}, q^+_{h}, u_h, \cdot , t \right) , \phi _h \bigr )_\mathcal{T _h}, \; \forall \phi _h \in V^h, \nonumber \\ \end{aligned}$$
(4.3)

where, given \(u_h\) at time \(t\), corresponding values for \(q^\pm _{h}\) and \(p^{\mu \nu }_{h}\) can be found using the methodology below.

We now describe a full discretization procedure for (1.2) by applying an ODE solver to the semi-discrete equations given in (4.3). For a fixed integer \(M>0\), let \(\Delta t = \frac{T}{M}\) and \(t_k := k \, \Delta t\) for \(k \in (0,M]\). Notationally, \(u_h^n(x) \in V^h\) will be an approximation for \(u(x, t_n)\) for \(n = 0, 1, \ldots , M\). We define the initial value \(u_h^0\) to be the \(L^2\)-projection of \(u_0\), namely,

$$\begin{aligned} \bigl ( u_h^0, \phi _h \bigr )_\mathcal{T _h} = \bigl ( u_0, \phi _h \bigr )_\mathcal{T _h}, \qquad \forall \phi _h \in V^h. \end{aligned}$$
(4.4)

Next, we introduce several “one-sided” discrete differential operators, which will be used to define explicit time-stepping schemes and to define the auxiliary variables at time \(t=0\) in implicit time-stepping schemes. We first define two “one-sided” first-order discrete derivatives \(\mathcal Q ^{-,k}_h v, \mathcal Q ^{+,k}_h v \in V^h\) for a given function \(v(\cdot , t_k)\in H^1(\mathcal T _h)\) by

$$\begin{aligned} \bigl (\mathcal Q ^{-,k}_h v, \phi _h \bigr )_\mathcal{T _h}&= \kappa _r \, u_b(t_k) \, \phi _{h}(b^-) - u_a(t_k) \, \phi _{h}(a^+) + (1-\kappa _r) \, v(b^-) \, \phi _{h}(b^-) \nonumber \\&\quad \quad - \bigl ( v, (\phi _h )_{x} \bigr )_\mathcal{T _h} + \sum _{j=1}^{J-1} v(x_j^-) \, \bigl [ \phi _{h}(x_j) \bigr ], \quad \forall \phi _{h} \in V^h, \end{aligned}$$
(4.5)
$$\begin{aligned} \bigl (\mathcal Q ^{+,k}_h v, \phi _{h} \bigr )_\mathcal{T _h}&= u_b(t_k) \, \phi _{h}(b^-) - \kappa _r \, u_a(t_k) \, \phi _{h}(a^+) - (1-\kappa _r) \, v(a^+) \, \phi _{h}(a^+) \nonumber \\&\quad \quad - \bigl ( v, (\phi _h)_{x} \bigr )_\mathcal{T _h} + \sum _{j=1}^{J-1} v(x_j^+) \, \bigl [ \phi _{h}(x_j) \bigr ], \qquad \forall \phi _{h} \in V^h. \end{aligned}$$
(4.6)

The above definitions are inspired by (3.17). The super-index \(k\) on \(Q_h^{\pm ,k}\) indicates that the definitions are \(t\)-dependent because of the boundary terms.

We also define four discrete “one-sided” second order discrete derivatives \(\mathcal P _h^{\mu \nu , k} v \in V^h, \mu , \nu = +, -\), at time \(t_k\) by

$$\begin{aligned} \bigl (\mathcal P _h^{- -, k} v, \psi _{h} \bigr )_\mathcal{T _h}&= \mathcal Q _h^{-,k} v(b^-) \, \psi _{h}(b^-) - \mathcal Q _h^{-,k} v(a^+) \, \psi _{h}(a^+) - \bigl ( \mathcal Q _h^{-,k} v, (\psi _{h})_x \bigr )_\mathcal{T _h} \nonumber \\&\quad + \sum _{j=1}^{J-1} \mathcal Q _h^{-,k} v(x_j^-) \, \bigl [ \psi _{h}(x_j) \bigr ],\quad \forall \psi _{h} \in V^h, \end{aligned}$$
(4.7)
$$\begin{aligned} \bigl (\mathcal P _h^{+ +,k} v, \psi _{h} \bigr )_\mathcal{T _h}&= \mathcal Q _h^{+,k} v(b^-) \, \psi _h(b^-) - \mathcal Q _h^{+,k} v(a^+) \, \psi _{h}(a^+)- \bigl ( \mathcal Q _h^{+,k} v, (\psi _h)_{x} \bigr )_\mathcal{T _h} \nonumber \\&\quad + \sum _{j=1}^{J-1} \mathcal Q _h^{+,k} v(x_j^+) \, \bigl [ \psi _{h}(x_j) \bigr ], \quad \forall \psi _{h} \in V^h, \end{aligned}$$
(4.8)

and

$$\begin{aligned} \bigl (\mathcal P _h^{- +,k} v, \psi _{h} \bigr )_\mathcal{T _h}&= (1-\kappa _r) \, \mathcal Q _h^{+,k} v(b^-) \, \psi _{h}(b^-) + \kappa _r \, \mathcal Q _h^{-,k} v(b^-) \, \psi _{h}(b^-) \nonumber \\&\quad - \mathcal Q _h^{-,k} v(a^+) \, \psi _{h}(a^+) - \bigl ( \mathcal Q _h^{-,k} v, (\psi _h)_{x} \bigr )_\mathcal{T _h}\nonumber \\&\quad + \sum _{j=1}^{J-1} \mathcal Q _h^{-,k} v(x_j^+) \, \bigl [ \psi _{h}(x_j) \bigr ],\quad \forall \psi _{h} \in V^h, \end{aligned}$$
(4.9)
$$\begin{aligned} \bigl (\mathcal P _h^{+ -, k} v, \psi _{h} \bigr )_\mathcal{T _h}&= \mathcal Q _h^{+,k} v(b^-) \, \psi _{h}(b^-) - (1-\kappa _r) \, \mathcal Q _h^{-,k} v(a^+) \, \psi _{h}(a^+) \nonumber \\&\quad - \kappa _r \, \mathcal Q _h^{+,k} v(a^+) \, \psi _{h}(a^+) - \bigl ( \mathcal Q _h^{+,k} v, (\psi _h)_{x} \bigr )_\mathcal{T _h}\nonumber \\&\quad + \sum _{j=1}^{J-1} \mathcal Q _h^{+,k} v(x_j^-) \, \bigl [ \psi _{h}(x_j) \bigr ],\quad \forall \psi _{h} \in V^h, \end{aligned}$$
(4.10)

where \(\kappa _r\) is defined by (3.19). The above four definitions are motivated by (3.18).

Lastly, to simplify the presentation, we introduce the operator notation

$$\begin{aligned} \widehat{F}_k [v] := \widehat{F}\left( \mathcal P _h^{- -, k} v, \mathcal P _h^{- +, k} v, \mathcal P _h^{+ -, k} v, \mathcal P _h^{+ +, k} v, \mathcal Q _h^{-, k} v, \mathcal Q _h^{+, k} v, v, x, t_k \right) . \end{aligned}$$
(4.11)

Using the new notation, the semi-discrete equation can be rewritten compactly as

$$\begin{aligned} \bigl ( (u_{h})_t(\cdot , t_k), \phi _h \bigr )_\mathcal{T _h} = - \bigl ( \widehat{F}_k \left[ u_h(\cdot , t_k) \right] , \phi _h\bigr )_\mathcal{T _h}, \quad \forall \phi _h\in V^h, \, \, k \in (0,M]. \end{aligned}$$
(4.12)

4.1 The Fourth Order Classical Runge–Kutta Method

A straightforward application of the fourth order classical Runge–Kutta (RK4) method to (4.12) yields

$$\begin{aligned} \bigl ( u_h^n, \phi _h \bigr )_\mathcal{T _h} = \bigl ( u_h^{n-1}, \phi _h \bigr )_\mathcal{T _h} + \frac{1}{6} \bigl ( \xi _1 + 2 \xi _2 + 2 \xi _3 + \xi _4, \phi _h \bigr )_\mathcal{T _h}, \quad \forall \phi \in V^h, \, n=1,2,\ldots , M, \end{aligned}$$

where

$$\begin{aligned} \bigl ( \xi _1, \phi _h\bigr )_\mathcal{T _h}&= - \Delta t \bigl ( \widehat{F}_{n-1} [ u_h^{n-1} ], \phi _h \bigr )_\mathcal{T _h}, \\ \bigl ( \xi _2, \phi _h \bigr )_\mathcal{T _h}&= - \Delta t \left( \widehat{F}_{n-\frac{1}{2}} \left[ u_h^{n-1} + \frac{1}{2} \xi _1\right] , \phi _h \right) _\mathcal{T _h} , \\ \bigl ( \xi _3, \phi _h \bigr )_\mathcal{T _h}&= - \Delta t \left( \widehat{F}_{n-\frac{1}{2}} \left[ u_h^{n-1} + \frac{1}{2} \xi _2 \right] , \phi _h \right) _\mathcal{T _h}, \\ \bigl ( \xi _4, \phi _h \bigr )_\mathcal{T _h}&= - \Delta t \bigl ( \widehat{F}_{n} [ u_h^{n-1} + \xi _3 ], \phi _h \bigr )_\mathcal{T _h}. \end{aligned}$$

Notice that in the above explicit time-stepping scheme, the function \(u_h^{n}\) is defined as an \(L^2\)-projection of the source data based on \(u_h^{n-1}\). However, the boundary conditions are not enforced in the definition for \(u_h^n\). To take care of the boundary conditions, we choose to enforce them weakly, which requires the introduction of a modified \(L^2\)-projection. Specifically, for any \(v\in L^2(\Omega )\), we recall that the standard \(L^2\)-projection \(\mathbb P _h v\in V^{\textit{h}}\) of \(v\) is defined by

$$\begin{aligned} \bigl ( \mathbb P _h v, \phi _h \bigr )_\mathcal{T _h} = \bigl (v, \phi _h \bigr )_\mathcal{T _h}, \qquad \forall \phi _h \in V^h. \end{aligned}$$
(4.13)

For any \(v\in C^0(\mathcal T _h)\), we introduce a modified \(L^2\)-projection \(\mathbb P _h^k : L^2(\Omega )\cap C^0(\mathcal T _h)\rightarrow V^h\) at time \(t_k \in (0, T]\) by

$$\begin{aligned} \bigl ( \mathbb P _h^k v, \phi _h \bigr )_\mathcal{T _h}&+ \frac{1}{\sqrt{h}} \Bigl (\mathbb P _h^k v(a) \phi _h(a) + \mathbb P _h^k v (b) \phi _h(b) \Bigr ) \nonumber \\&= \bigl (v, \phi _h \bigr )_\mathcal{T _h} + \frac{1}{\sqrt{h}} \Bigl (u_a(t_k) \, \phi _h(a^+) + u_b(t_k) \, \phi _h(b^-) \Bigr ), \quad \forall \phi _h\in V^h.\nonumber \\ \end{aligned}$$
(4.14)

Clearly, the boundary conditions (4.2) are weakly enforced in (4.14) via a penalty technique, an idea which dates back to Nitsche [20].

Using the above discrete differential operators \(\mathcal Q _h^{\pm , k}\) and \(\mathcal P _h^{\mu \nu , k}\) for \(\mu , \nu = +, -\), the projection operators \(\mathbb P _h^k\) and \(\mathbb P _h\), and using the notation given in (4.11), our fully-discrete RK4 method for the initial-boundary value problem (1.2), (4.2), and (4.1) is defined as follows: for \(n = 1,2, \ldots , M\),

$$\begin{aligned} u_h^{n}&= \mathbb P _h^{n} \left( u_h^{n-1} + \frac{1}{6}\left( \xi _1^{n-1} + 2 \xi _2^{n-1} + 2 \xi _3^{n-1} + \xi _4^{n-1} \right) \right) , \end{aligned}$$
(4.15)
$$\begin{aligned} \xi _1^{n-1}&= - \Delta t \, \mathbb P _h \widehat{F}_{n-1} [ u_h^{n-1}], \end{aligned}$$
(4.16)
$$\begin{aligned} \xi _2^{n-1}&= - \Delta t \, \mathbb P _h \widehat{F}_{n-\frac{1}{2}} \left[ u_h^{n-1} + \frac{1}{2}\xi _1^{n-1} \right] , \end{aligned}$$
(4.17)
$$\begin{aligned} \xi _3^{n-1}&= - \Delta t \, \mathbb P _h \widehat{F}_{n-\frac{1}{2}} \left[ u_h^{n-1} + \frac{1}{2} \xi _2^{n-1} \right] , \end{aligned}$$
(4.18)
$$\begin{aligned} \xi _4^{n-1}&= - \Delta t \, \mathbb P _h \widehat{F}_{n} [ u_h^{n-1} + \xi _3^{n-1} ], \end{aligned}$$
(4.19)
$$\begin{aligned} u_h^0&= \mathbb P _h u_0. \end{aligned}$$
(4.20)

We remark that it is easy to verify that the value \(\xi _4^{n-1}\) actually already takes into account the boundary conditions at time \(t_n\) because of the evaluation calls \(Q_h^{-,n}\) and \(Q_h^{+,n}\), which in turn have the boundary conditions built-in. Thus, in the above formulation, the boundary condition enforcement can actually be successfully relaxed by replacing \(\mathbb P _h^n\) with \(\mathbb P _h\) in (4.15). However, for other explicit methods a weak boundary condition enforcement method such as the above modified \(L^2\)-projection is necessary, especially if the boundary conditions are not consistent with the initial condition. For example, in the forward Euler method, defined by

$$\begin{aligned} u_h^n=\mathbb P _h^n \bigl ( u_h^{n-1} -\Delta t \widehat{F}_{n-1}[u_h^{n-1}]\bigr ), \end{aligned}$$
(4.21)

we can see that the approximation at time \(t_n\) relies upon the modified \(L^2\)-projection in order to see the Dirichlet boundary condition at the current time.

4.2 The Trapezoidal Method

Applying the trapezoidal rule to (4.12), we obtain

$$\begin{aligned} \Bigl ( u_h^n + \frac{\Delta t}{2} \widehat{F}_n [ u_h^n ], \phi _h \Bigr )_\mathcal{T _h} = \Bigl ( u_h^{n-1} -\frac{\Delta t}{2} \widehat{F}_{n-1} [ u_h^{n-1} ], \phi _h \Bigr )_\mathcal{T _h}, \quad \forall \phi _h \in V^h, \end{aligned}$$

and \(n = 1, 2, \ldots , M\). Thus, using the trapezoidal rule to discretize (4.12), and using the implicit equalities

$$\begin{aligned} q_{h}^{-,{\textit{n}}} = \mathcal Q _h^{-,n} u_h^n, \qquad q_{h}^{+,n} = \mathcal Q _h^{+,n} u_h^n, \end{aligned}$$

and

$$\begin{aligned} p_{h}^{- -, n} = \mathcal P _h^{- -, n} u_h^n, \quad p_{h}^{- +, n} = \mathcal P _h^{- +, n} u_h^n, \quad p_{h}^{+ -, n} = \mathcal P _h^{+ -, n} u_h^n, \quad p_{h}^{+ +, n} = \mathcal P _h^{+ +, n} u_h^n, \end{aligned}$$

for \(n = 1, 2, \ldots , M\), the fully discrete trapezoidal LDG method for approximating solutions to (1.2), (4.1), and (4.2) is defined by seeking \((u_h^n, q_{h}^{-, n}, q_{h}^{+, n}, p_{h}^{- -, n}, p_{h}^{- +, n}, p_{h}^{+ -, n}, \) \(p_{h}^{+ +, n}) \in (V^h)^7\) such that

$$\begin{aligned} \Bigl ( u_h^n + \frac{\Delta t}{2} \widehat{F}_n [ u_h^n ], \phi _{0h} \Bigr )_\mathcal{T _h}&= \Bigl ( u_h^{n-1} -\frac{\Delta t}{2} \widehat{F}_{n-1} [ u_h^{n-1} ], \phi _{0h} \Bigr )_\mathcal{T _h}, \,\,\, \forall \phi _{0h} \in V^h, \nonumber \\ \end{aligned}$$
(4.22)
$$\begin{aligned} \bigl ( q_{h}^{\pm , n}, \phi _{h}^\pm \bigr )_\mathcal{T _h} + \widehat{a}^\pm \left( u_h^n, \phi ^\pm _{h} \right)&= g^\pm \left( t^n, \phi ^\pm _{h} \right) ,\quad \forall \phi ^\pm _{h} \in V^h, \end{aligned}$$
(4.23)
$$\begin{aligned} \bigl ( p_{h}^{\mu \nu , n}, \psi _{h}^{\mu \nu } \bigr )_\mathcal{T _h}+ \widehat{b}^{\mu \nu } \left( q_h^{-, n}, q_{h}^{+, n} ; \psi _{h}^{\mu \nu } \right)&= 0, \quad \forall \psi _{h}^{\mu \nu } \in V^h, \mu , \nu = +,-, \end{aligned}$$
(4.24)

where \(u^0_h = \mathbb P _h u_0, q_{h}^{\pm , 0} = \mathcal Q _h^{\pm , 0} u_h^0\), \(p_{h}^{\mu \nu , 0} = \mathcal P _h^{\mu \nu , 0} u_h^0\) for \(\mu , \nu = +, -\), and

$$\begin{aligned} \widehat{{\textit{a}}}^- (v^n, \varphi )&= ( v^n, \varphi _x)_\mathcal{T _h} -(1-\kappa _r) \, v^n(b^-) \, \varphi (b^-)-\sum _{j=1}^{J-1} v^n (x_{j}^-) \bigl [ \varphi (x_{j}) \bigr ], \\ \widehat{{\textit{a}}}^+ (v^n, \varphi )&= ( v^n, \varphi _x)_\mathcal{T _h} + (1-\kappa _r) \, v^n(a^+) \, \varphi (a^+)-\sum _{j=1}^{J-1} v^n (x_{j}^+) \bigl [ \varphi (x_{j}) \bigr ], \\ \widehat{{\textit{b}}}^{- -} (v^{-,n}, v^{+,n}; \varphi )&= ( v^{-,n}, \varphi _x)_\mathcal{T _h} + v^{-,n}(a^+) \, \varphi (a^+) - v^{-,n}(b^-) \, \varphi (b^-) \\&\quad -\sum _{j=1}^{J-1} v^{-,n} (x_{j}^-) \bigl [ \varphi (x_{j}) \bigr ], \\ \widehat{{\textit{b}}}^{+ +} (v^{-,n}, v^{+,n}; \varphi )&= ( v^{+,n}, \varphi _x)_\mathcal{T _h} + v^{+,n}(a^+) \, \varphi (a^+) - v^{+,n}(b^-) \, \varphi (b^-) \\&\quad -\sum _{j=1}^{J-1} v^{+,n} (x_{j}^+) \bigl [ \varphi (x_{j}) \bigr ], \\ \widehat{{\textit{b}}}^{- +} (v^{-,n}, v^{+,n}; \varphi )&= ( v^{-,n}, \varphi _x)_\mathcal{T _h} + v^{-,n}(a^+) \, \varphi (a^+)- (1 - \kappa _r) \, v^{+,n}(b^-) \, \varphi (b^-) \\&\quad - \kappa _r \, v^{-,n}(b^-) \, \varphi (b^-) -\sum _{j=1}^{J-1} v^{-,n} (x_{j}^+) \bigl [ \varphi (x_{j}) \bigr ], \\ \widehat{{\textit{b}}}^{+ -} (v^{-,n}, v^{+,n}; \varphi )&= ( v^{+,n}, \varphi _x)_\mathcal{T _h}+ (1 - \kappa _r) \, v^{-,n}(a^+) \, \varphi (a^+) + \kappa _r \, v^{+,n}(a^+) \, \varphi (a^+) \\&\quad - v^{+,n}(b^-) \, \varphi (b^-) -\sum _{j=1}^{J-1} v^{+,n} (x_{j}^-) \bigl [ \varphi (x_{j}) \bigr ], \\ {\textit{g}}^- (t^n, \phi )&= \kappa _r \, u_b(t^n) \, \phi (b^-) - u_a(t^n) \, \phi (a^+), \\ {\textit{g}}^+ (t^n, \phi )&= u_b(t^n) \, \phi (b^-) - \kappa _r \, u_a(t^n) \, \phi (a^+). \end{aligned}$$

Again, \(\kappa _r\) is defined by (3.19). Notice that the above fully discrete formulation amounts to approximating a non-homogeneous fully nonlinear elliptic equation at each time step using the LDG method defined in Sect. 3.

5 Numerical Experiments

In this section, we present a series of numerical tests to demonstrate the utility of the proposed LDG methods for fully nonlinear PDEs of the types (1.1) and (1.2). In all of our tests we shall use uniform spatial meshes as well as uniform temporal meshes for the time-dependent problems. To solve the resulting nonlinear algebraic systems, we use the Matlab built-in nonlinear solver fsolve. For the elliptic problems we choose the initial guess as the linear interpolant of the boundary data. For parabolic problems, we let \(u^0_h = \mathbb P _h u_0\), and then define all auxiliary variables by \(q_{h}^{\pm , 0} = \mathcal Q _h^{\pm , 0} u_h^0\) and \(p_{h}^{\mu \nu , 0} = \mathcal P _h^{\mu \nu , 0} u_h^0\) for \(\mu , \nu = +, -\). Also, the initial guess for fsolve at the \(n\)th time step will be chosen as the computed solution at the previous time step when using implicit methods. The role of the numerical moment will be further explored in Sect. 5.3.

For our numerical tests, errors will be measured in the \(L^\infty \) norm and the \(L^2\) norm, where the errors are measured at the current time step for the time-dependent problems. For both elliptic and parabolic test problems where the error is dominated by the spatial discretization errors, it appears that the spatial errors are of optimal order \(\mathcal O (h^{s})\) for most problems, where \(s = \hbox {min} \{ r+1, k \}\) for the viscosity solution \(u \in H^k(\Omega )\). However, for a couple of problems, we observe less than optimal rates of convergence. We note that the actual convergence rates have not yet been analyzed, and may also depend on the regularity of the operator \(F\) in addition to the regularity of \(u\).

5.1 Elliptic Test Problems

We first present the results for four test problems of type (1.1). Both Monge–Ampère and Bellman types of equations will be tested.

Test 1 Consider the elliptic Monge–Ampère problem

$$\begin{aligned} - u_{x x}^2 + 1&= 0, \quad 0 < x < 1, \\ u(0) = 0, \quad u(1)&= \frac{1}{2}. \end{aligned}$$

It is easy to check that this problem has exactly two classical solutions:

$$\begin{aligned} u^+ (x) = \frac{1}{2} x^2, \quad u^- (x) = - \frac{1}{2} x^2 + x, \end{aligned}$$

where \(u^+\) is convex and \(u^-\) is concave. Note that \(u^+\) is the unique viscosity solution which we want our numerical schemes to converge to. In Sect. 5.3 we shall give some insights about the selectiveness of our schemes.

We approximate the given problem for various degree elements (\(r = 0,1,2\)) to see how the approximation converges with respect to \(h\). Note, when \(r=0,1\), the solution is not in the DG space \(V^h\). The numerical results are shown in Fig. 1. We observe that the approximations using \(r=2\) are almost exact for each mesh size. This is consistent with the fact \(u^+ \in V^h\) when \(r = 2\).

Fig. 1
figure 1

Test 1 with \(\alpha = 10\)

Test 2 Consider the problem

$$\begin{aligned}&- u_{ x x}^3 + u_{x x} + S(x)^3 - S(x) = 0, \quad -1 < x < 1, \\&\quad u(-1) = - \sin (1) - 8 \cos (0.5) + 9, \quad u(1) = \sin (1) - 8 \cos (0.5) + 9, \end{aligned}$$

where

$$\begin{aligned} S(x) = \left\{ \begin{array}{ll} \frac{2 x}{|x|} \cos (x^2) - 4 x^2 \sin (x |x|) + 2 \cos (\frac{x}{2}) + 2, &{} x \ne 0, \\ - 4 x^2 \sin (x |x|) + 2 \cos (\frac{x}{2}) + 2, &{} x = 0. \end{array}\right. \end{aligned}$$

This problem has the exact solution \(u(x) = \sin \left( x | x | \right) - 8 \cos \left( \frac{x}{2} \right) + x^2 + 8 \in H^2(-1,1)\). Note that this problem is not monotone decreasing in \(u_{x x}\), and the exact solution is not twice differentiable at \(x = 0\). However, the derivative of \(F\) with respect to \(u_{x x}\) is uniformly bounded. The numerical results are shown in Fig. 2. As expected, we can see from the plot that the error appears largest around the point \(x = 0\), and both the accuracy and order of convergence improve as the order of the element increases. For finer meshes, we see the rates of convergence begin to deteriorate. Theoretically, we expect the rates of convergence to be bounded by two for high-order bases due to the lower regularity of the solution.

Fig. 2
figure 2

Test 2 with \(\alpha = 6\)

Test 3 Consider the stationary Hamilton-Jacobi-Bellman problem with finite dimensional control set

$$\begin{aligned} {\mathop {\text {min}}\limits _{{\theta (x) \in \{1,2 \} }}} \left\{ - \theta u_{ x x } + u_{x} - u + S(x) \right\}&= 0, \qquad -1 < x < 1, \\ u(-1) = -1, \quad u(1)&= 1, \end{aligned}$$

where

$$\begin{aligned} S(x) = \left\{ \begin{array}{ll} -12 x^2 - 4 |x|^3 + x |x|^3, &{} {\textit{x}} < 0 \\ 24 x^2 - 4 |x|^3 + x |x|^3, &{} {\textit{x}} \ge 0.\\ \end{array}\right. \end{aligned}$$

This problem has the exact solution \(u(x) = x |x|^3 \in H^4(-1,1)\) corresponding to \(\theta ^* (x) = 1\) for \(x < 0\) and \(\theta ^*(x) = 2\) for \(x \ge 0\). Approximating the problem using various order elements, we have the following results recorded in Fig. 3. Due to the low regularity of the solution, we expect the rates of convergence to be bounded by four for high-order bases. We observe that the rates of convergence for \(r=0,1,2\) appear to be optimal on average, while the rates of convergence for \(r=3\) appear to be limited to three. However, we still see increased accuracy for \(r=3\) when compared to \(r=2\).

Fig. 3
figure 3

Test 3 with \(\alpha = 4\)

Test 4 Consider the stationary Hamilton-Jacobi-Bellman problem with infinite dimensional control set

$$\begin{aligned} \inf _{0 \le \theta (x) \le 1} \left\{ - \theta u_{ x x } + \theta ^2 \, x^2 \, u_{x} + \frac{1}{x} u + S(x) \right\}&= 0,\quad 1.2 < x < 4 , \\ u(1.2) = 1.44 \ln 1.2, \quad u(4)&= 16 \ln 4, \end{aligned}$$

where

$$\begin{aligned} S(x) = \frac{4 \ln (x)^2 + 12 \ln (x) + 9 - 8 x^4 \ln (x)^2 - 4 x^4 \ln (x)}{4 x^3 \left[ 2 \ln (x) + 1 \right] }. \end{aligned}$$

This problem has the exact solution \(u(x) = x^2 \ln x\) corresponding to the control function \(\theta ^* (x) = \frac{2 \ln (x) + 3}{2 x^3 \left[ 2 \ln (x) + 1 \right] }\). Approximating the problem using various order elements, we obtain the results recorded in Fig. 4.

Fig. 4
figure 4

Test 4 with \(\alpha = 4\)

5.2 Parabolic Test Problems

We now implement the proposed fully discrete RK4 and trapezoidal LDG methods for approximating fully nonlinear parabolic equations of the form (1.2). While the above formulation makes no attempt to formally quantify a CFL condition for the RK4 method, for the tests we assume a CFL constraint of the form \(\Delta t = \kappa _t h^2\), and note that the constant \(\kappa _t\) appears to decrease as the order of the element increases. Below we implement both the RK4 method and the trapezoidal method for each test problem. However, we make no attempt to classify and compare the efficiency of the two methods. Instead, we focus on testing and demonstrating the usability of both fully discrete schemes and their promising potentials. For explicit scheme tests, we record the parameter \(\kappa _t\), and for implicit scheme tests, we record the time step size \(\Delta t\). Note that the row \(0^*\) in the figures corresponding to the RK4 method refers to elements with \(r=0\) that use the standard \(L^2\) projection operator in (4.15).

Test 5 Let \(\Omega = (0,1), u_a(t) = t^4, u_b = \frac{1}{2} + t^4\), and \(u_0(x) = \frac{1}{2} x^2\). We consider the problem (1.2), (4.1), and (4.2) with

$$\begin{aligned} F(u_{xx}, u_x, u, t, x) = -u_{x x} \, u + \frac{1}{2} x^2 + t^4 - 4 \, t^3 + 1. \end{aligned}$$

It is easy to verify that this problem has a unique classical solution \(u(x,t) = 0.5 \, x^2 + t^4 + 1\). Notice that the PDE is actually quasi-linear, but does provide a measure of the effectiveness of the implementation. The numerical results for RK4 are presented in Fig. 5 and the results for the trapezoidal method are shown in Fig. 6. As expected, RK4 appears to recover the exact solution when \(r=2\).

Fig. 5
figure 5

Test 5: Computed solutions at \(T = 1\) using \(\kappa _t = 0.001, \alpha = 2\)

Fig. 6
figure 6

Test 5: Computed solution at \(T = 1\) using \(\Delta t = 0.001\) and \(\alpha = 2\)

Test 6 Let \(\Omega = (0,2), u_a(t) = 1, u_b = e^{2 (t+1)}\), and \(u_0(x) = e^x\). We consider the problem (1.2), (4.1), and (4.2) with

$$\begin{aligned} F(u_{x x}, u_x, u, t, x) = - u_x \ln \bigl ( u_{x x} + 1 \bigr ) + S(x,t), \end{aligned}$$

and

$$\begin{aligned} S(x,t) = e^{(t+1) x} \Big (x - (t+1) \ln \bigl ((t+1)^2 e^{(t+1) x}+1 \bigr ) \Big ). \end{aligned}$$

It is easy to verify that this problem has a unique classical solution \(u(x,t) = e^{(t+1) x}\). Notice that this problem is nonlinear in both \(u_{x x}\) and \(u_x\). Furthermore, the exact solution \(u\) cannot be factored into the form \(u(x,t) = G(t) \, Y (x)\) for some functions \(G\) and \(Y\). Results for RK4 are given in Fig. 7, and results for the trapezoidal method are shown in Fig. 8. We note that RK4 was unstable without using the very restrictive values for \(\kappa _t\) recorded in Fig. 7. However, for RK4, we observe optimal rates of convergence in the spatial variable while the rates for the trapezoidal method appear to be limited by the lower rate of convergence for the time-stepping scheme.

Fig. 7
figure 7

Test 6: Computed solutions at time \(T = 0.5\) using \(\kappa _t = 0.005, 0.001, 0.0005, 0.0001\) for \(r=0, 1, 2, 3\), respectively, and \(\alpha = 4\). Left figure uses the standard \(L^2\) projection operator

Fig. 8
figure 8

Test 6: Computed solutions at time \(T = 0.5\) using \(\Delta t = 0.005\) and \(\alpha = 4\)

Test 7 Let \(\Omega = (0, 2 \pi ), u_a(t) = 0, u_b = 0\), and \(u_0(x) = \sin (x)\). We consider the problem (1.2), (4.1), and (4.2) with

$$\begin{aligned} F(u_{x x}, u_x, u, t, x) = - {\mathop {\text {min}}\limits _{{\theta (t, x) \in \{1,2 \}}}} \Big \{A_\theta \, u_{x x}-c(x,t) \cos (t) \, \sin (x) - \sin (t) \, \sin (x) \Big \}, \end{aligned}$$

where \(A_1 = 1, A_2 = \frac{1}{2}\), and

$$\begin{aligned} c(x,t) = \left\{ \begin{array}{ll} 1, &{} \text {if } 0 < t \le \frac{\pi }{2} \hbox { and } 0 < x \le \pi \text { or } \frac{\pi }{2} < t \le \pi \text { and } \pi < x < 2 \pi , \\ \frac{1}{2}, &{} \hbox {otherwise}. \end{array}\right. \end{aligned}$$

It is easy to check that this problem has a unique classical solution \(u (x,t) = \cos (t) \sin (x)\). Notice that this problem has a finite dimensional control parameter set, and the optimal control is given by

$$\begin{aligned} \theta ^* (t, x) = \left\{ \begin{array}{ll} 1, &{} \hbox {if } c(x,t) = 1, \\ 2, &{} \hbox {if } c(x,t) = \frac{1}{2}. \end{array}\right. \end{aligned}$$

The numerical results are reported in Fig. 9 for RK4 and in Fig. 10 for the trapezoidal method.

Fig. 9
figure 9

Test 7: Computed solutions at time \(T = 3.10\) using \(\kappa _t = 0.05, 0.005, 0.001, 0.0005\) for \(r=0, 1, 2, 3\), respectively, and \(\alpha = 2\). Left plot uses the standard \(L^2\) projection operator

Fig. 10
figure 10

Test 7: Computed solutions at time \(T = 3.10\) using \(\Delta t = 0.031\) and \(\alpha = 2\)

Test 8 Let \(\Omega = (0,3), u_a(t) = e^{-t}, u_b = 8 \, e^{-t}\), and \(u_0(x) = | x - 1 |^3\). We consider the problem (1.2), (4.1), and (4.2) with

$$\begin{aligned} F(u_{x x}, u_x, u, t, x) = - \inf _{-1 \le \theta (t,x) \le 1} \Big \{ | x-1 | u_{x x} + \theta u_x \Big \} - | x-1 |^2 \, \left( | x-1 | - 3 \right) \, e^{-t}, \end{aligned}$$

It is easy to verify that the problem has the exact solution \(u(t,x) = | x - 1 |^3 \, e^{-t}\). Notice that the above operator is not elliptic for \(x = 1\). For each value of \(t\), we have \(u \in H^3(0,3)\). Also, this problem has a bang-bang type control with the optimal control given by

$$\begin{aligned} \theta ^* (t,x) = \left\{ \begin{array}{ll} 1, &{} \text {if } x < 1, \\ -1, &{} \text {if } x > 1. \end{array}\right. \end{aligned}$$

We can see from the results for the RK4 method in Fig. 11 and the results for the trapezoidal method in Fig. 12 that the spatial rates of convergence appear to be limited to two instead of the optimal rate of three for \(r \ge 2\), while the accuracy appears to increase with respect to the element degree.

Fig. 11
figure 11

Test 8: Computed solutions at time \(T = 1\) using \(\kappa _t = 0.05, 0.005, 0.001, 0.0005\) for \(r=0, 1, 2, 3\), respectively, and \(\alpha = 2\)

Fig. 12
figure 12

Test 8: Computed solutions at time \(T = 1\) using \(\Delta t = 0.001\) and \(\alpha = 2\)

5.3 The Role of the Numerical Moment

In this section, we focus on understanding the role of the numerical moment. We first give two ways to interpret the numerical moment, and then we explore the utility of the numerical moment. The role of the numerical moment can heuristically be understood as follows when the numerical moment is rewritten in the form

$$\begin{aligned} h^2 \, \alpha \, \Bigl (\frac{ p^{- -}_{h} - p^{- +}_{h} - p^{+ -}_{h} + p^{+ +}_{h}}{h^2}\Bigr ). \end{aligned}$$

Letting \(r = 0\), we see that \(\frac{ p^{- -}_{h} - p^{- +}_{h} - p^{+ -}_{h} + p^{+ +}_{h}}{h^2}\) is an \(\mathcal{O }( h^2)\) approximation to \(u_{x x x x}\). Then, we can see that the numerical moment acts as a centered difference approximation for \(\Delta ^2 u\) multiplied by a factor that tends to zero with rate \(\mathcal O ( h^2)\). Thus, at the PDE level, we are in essence approximating the fully nonlinear second order elliptic operator

$$\begin{aligned} F \left( u_{x x}, u_x, u, x \right) \end{aligned}$$

by the quasilinear fourth order operator \(\widetilde{F}_\rho \), where

$$\begin{aligned} \widetilde{F}_\rho \left( u_{x x x x}, u_{x x}, u_x, u, x \right) =\rho \, u_{x x x x} + F \left( u_{x x}, u_x, u, x \right) . \end{aligned}$$

In the limit as \(\rho \rightarrow 0\), we heuristically expect that the solution of the fourth order problem converges to the unique viscosity solution of the second order problem. Using a convergent family of fourth order quasilinear PDEs to approximate a fully nonlinear second order PDE has previously been considered for PDEs such as the Monge–Ampère equation, the prescribed Gauss curvature equation, the infinity-Laplace equation, and linear second order equations of non-divergence form. The method is known as the vanishing moment method and serves as an analogue to the vanishing viscosity method for first order Hamilton-Jacobi equations where the PDE is perturbed by a second order derivative term. We refer the reader to [9, 11] for a detailed exposition.

We now express the numerical moment using jumps defined on the interior nodes. Observe, by equations (3.18),

$$\begin{aligned}&\left( p^{- -}_{h} - p^{- +}_{h} - p^{+ -}_{h} + p^{+ +}_{h}, \varphi _h \right) _\mathcal{T _h} \\&\quad = - b^{- -} \left( q_h^-, q_h^+ ; \varphi _h \right) + b^{- +} \left( q_h^-, q_h^+ ; \varphi _h \right) + b^{+ -} \left( q_h^-, q_h^+ ; \varphi _h \right) - b^{+ +} \left( q_h^-, q_h^+ ; \varphi _h \right) \\&\quad = (1 - \kappa _r) \left( q_h^-(a^+) - q_h^+(a^+) \right) \, \varphi _h(a^+) + (1 - \kappa _r) \left( q_h^-(b^-) - q_h^+(b^-) \right) \, \varphi _h(b^-) \\&\quad \quad + \sum _{j=1}^{J-1} \left( \big [ q_h^-(x_j) \big ] - \big [ q_h^+(x_j) \big ] \right) \, \big [ \varphi _h(x_j) \big ] \end{aligned}$$

for all \(\varphi _h \in V^h\), where \(\kappa _r\) is defined in (3.19). Thus, the Lax-Friedrichs-like numerical operator with a numerical moment amounts to the addition of nonstandard jump/stabilization terms to an \(L^2\) projection of the fully nonlinear PDE operator into \(V^h\). The jump/stabilization terms penalize the differences in \(q_h^-\) and \(q_h^+\). For comparison, the numerical moment using the IP-DG formulation in [16] takes the form

$$\begin{aligned} \sum _{j=1}^{J-1} \big [ u_h(x_j) \big ] \, \big [ \varphi _h(x_j) \big ] , \end{aligned}$$

a standard jump/stabilization term. Due to only having a single approximation for \(\nabla u\) in the IP-DG framework, a standard jump/stabilization term that corresponds to \(q_h^-\) and \(q_h^+\) would take the form

$$\begin{aligned} \sum _{j=1}^{J-1} \frac{1}{2} \big [ q_h^-(x_j) + q_h^+(x_j) \big ] \, \big [ \varphi _h(x_j) \big ], \end{aligned}$$

where we penalize the sum of \(q_h^-\) and \(q_h^+\). Therefore, the above nonstandard LDG formulation that uses two independent approximations for \(\nabla u\) allows for the formulation of a new jump/stabilization term that is not analogous to penalty terms from the IP-DG literature. We also note that while the numerical moment can be rewritten using jumps, numerical experiments indicate generic solvers such as fsolve appear to succeed in finding a root more frequently when using the presented mixed formulation with the numerical moment implemented as a function of the various second-order derivative approximations.

For the remainder of the section, we focus on observed consequences of the numerical moment in our test problems. In particular, we observe that the proposed schemes using a numerical moment can eliminate the numerical artifacts that arise as consequences from using a standard discretization, and in certain cases when the numerical artifacts are not fully eliminated, the algebraic system has enough structure to design solvers that emphasize the monotonicity in \(\frac{p^{- +}_h+p^{+ -}_h}{2}\) and are consistent in searching for solutions at which the nonlinear PDE problem is elliptic.

We again consider the Monge–Ampère type problem from Test 1 in Sect. 5.1. The given problem has two classical PDE solutions \(u^+\) and \(u^-\). However, there exists infinitely many \(C^1\) functions that satisfy the PDE and boundary conditions almost everywhere, as seen by \(\widehat{\mu }\) in (5.1). These almost everywhere solutions will correspond to what we call numerical artifacts in that algebraic solutions for a given discretization may correspond to these functions. It is well known that using a standard discretization scheme for the Monge–Ampère problem can yield multiple solutions, many of which are numerical artifacts that do not correspond to PDE solutions [11]. For example, let \(\mu \in H^2(0,1) \setminus C^2(0,1)\) be defined by

$$\begin{aligned} \widehat{\mu }(x) = \left\{ \begin{array}{ll} \frac{1}{2} x^2 + \frac{1}{4} x, &{} \text {for } x < 0.5, \\ -\frac{1}{2} x^2 + \frac{5}{4} x - \frac{1}{4}, &{} \text {for } x \ge 0.5. \end{array}\right. \end{aligned}$$
(5.1)

Furthermore, suppose \(x_j = 0.5\) for some \(j = 2, 3, \ldots , J-1\). Then, when using a standard central difference discretization, \(\widehat{\mu }\) corresponds to a numerical solution, yielding a numerical artifact.

We now consider our discretization that uses a numerical moment. When \(\alpha =0\), we have no numerical moment. As a result, we have numerical artifacts as in the standard central difference discretization case. Suppose \(r=0\). Then, for \(\alpha \ne 0\), inspection of (3.9)–(3.12) yields the fact that \(p^{- +}_{h}\) cannot jump from a value of \(1\) to a value of \(-1\) when going across \(x_j=0.5\). Thus, the numerical moment penalizes discontinuities in \(p^{\mu \nu }_{h}, \mu , \nu = +, -\), and, as a result, the numerical moment eliminates numerical artifacts such as \(\widehat{\mu }\). Similarly, for \(r=1\), we can see that \(\widehat{\mu }\) does not correspond to a numerical solution. However, in this case, the algebraic system does have a small residual that may trap solvers such as fsolve. Thus, for \(r=0\) and \(r=1\), the numerical moment penalizes differences in \(p^{\mu \nu }_{h}, \mu , \nu = +, -\), that arise from discontinuities in \(u_h, q^-_{h}\), and \(q^+_{h}\). Hence, it eliminates numerical artifacts such as \(\widehat{\mu }\). We note that the same test using the IP-DG framework in [16] does appear to have a numerical artifact corresponding to \(\widehat{\mu }\) when using \(r=1\). Thus, the LDG formulation is more successful at removing numerical artifacts for this example when using \(r = 1\). Furthermore, the IP-DG formulation does not allow for \(r=0\).

We now consider \(r \ge 2\), in which case \(\widehat{\mu } \in V^h\). Furthermore, since \(\widehat{\mu } \in C^1\), we will end up with \(u_h = \widehat{\mu }, q^-_{h} = q^+_{h}\), and \(p^{\pm \mp }_{h} = p^{\pm \pm }_h\) being a numeric solution, where

$$\begin{aligned} q^-_{h}(x) = \left\{ \begin{array}{ll} x+\frac{1}{4}, &{} \text {for } x < 0.5, \\ -x + \frac{5}{4}, &{} \text {for } x > 0.5, \end{array}\right. \qquad \text {and} \qquad p^{- -}_{h}(x) = \left\{ \begin{array}{ll} 1, &{} \text {for } x < 0.5, \\ -1, &{} \text {for } x > 0.5. \end{array}\right. \end{aligned}$$

Thus, by the equalities of \(p^{\mu \nu }_{h}, \mu , \nu = +, -\), the numerical moment is always zero and we do have numerical artifacts. These equalities are a consequence of the continuity of \(u_h\), \(q^-_{h}\), and \(q^+_{h}\). With the extra degrees of freedom for \(r\ge 2\), we allow \(C^1\) to be embedded into our approximation space \(V^h\), thus creating possible solutions with a zero-valued numerical moment. The numerical moment acts as a penalty term for differences in \(p^{\mu \nu }_{h}, \mu , \nu = +, -\), which are a consequence of differences in \(q^-_{h}\) and \(q^+_{h}\) that naturally arise for nontrivial functions when \(r=0\) or \(r=1\).

Even with the possible presence of numerical artifacts for the above discretization when \(r \ge 2\), the numerical moment can be exploited at the solver level. We now present a splitting algorithm for solving the resulting nonlinear algebraic system that uses the numerical moment to strongly emphasize the fact that the viscosity solution of the PDE should preserve the monotonicity required by the definition of ellipticity. Again, we emphasize that the following algorithm is based upon the mixed formulation where the numerical moment is a function of the various second-order derivative approximations.

Algorithm 5.1

  1. (1)

    Pick an initial guess for \(u_h\).

  2. (2)

    Form initial guesses for \(q^-_{h}, q^+_{h}, p^{- -}_{h}, p^{- +}_{h}, p^{+ -}_{h}\), and \(p^{+ +}_{h}\) using equations (3.17) and (3.18).

  3. (3)

    Solve Eq. (3.2) for \(\frac{p^{- +}_{h}+p^{+ -}_{h}}{2}\).

  4. (4)

    Solve Eq. (3.17) for \(+\) and \(-\) and the equation formed by averaging (3.18) for \(\mu =-, \nu =+\) and \(\mu =+,\nu =-\) for \(u_h, q^-_{h}\), and \(q^+_{h}\).

  5. (5)

    Solve Eq. (3.18) for \(\mu , \nu = +, -\) for \(p^{- -}_{h}, p^{- +}_{h}, p^{+ -}_{h}\), and \(p^{+ +}_{h}\).

  6. (6)

    Repeat Steps 3–5 until the change in \(\frac{p^{- +}_{h}+p^{+ -}_{h}}{2}\) is sufficiently small.

We note that step (3) requires solving a nonlinear equation. However, the nonlinear equation is both monotone and entirely local with respect to the unknown function. Also, step (4) of Algorithm 5.1 requires solving a nonstandard Poisson discretization. The analysis for the corresponding Poisson discretization can be found in [18].

For the next numerical tests, we will show that using Algorithm 5.1 with a sufficiently large coefficient for the numerical moment destabilizes numerical artifacts such as \(\widehat{\mu }\) and steers the approximation towards the viscosity solution of the PDE. Let \(\overline{u}(x) = \frac{x}{2}\). Then, \(\overline{u}\) is the secant line formed by the boundary data for the given boundary value problem. We now approximate the solution of the Monge–Ampère type problem from Test 1 in Sect. 5.1 by using 100 iterations of Algorithm 5.1 followed by using fsolve on the full system to solve the global discretization given by (3.2), (3.17), and (3.18). We take the initial guess to be

$$\begin{aligned} u_{h}^{(0)} = \frac{3}{4} \widehat{\mu } + \frac{1}{4} \overline{u}, \end{aligned}$$

where, for \(r=0, u_h^{0}\) is first projected into \(V^h\). From Fig. 13, we see that the numerical moment drives the solution towards the viscosity solution \(u^+\) when \(r = 0\) and \(\alpha \) is positive. From Fig. 14, we see that the numerical moment also drives the solution towards the viscosity solution \(u^+\) when \(r = 2\) and \(\alpha \) is positive, despite the presence of numerical artifacts. From Fig. 15, we see that the moment drives the solution towards the viscosity solution of \(F(u_{x x}, u_x, u, x) := u_{x x}^2 - 1\) given by \(u^-\) for \(r = 0\) and \(r=2\) when \(\alpha \) is chosen to be negative. In each figure, the middle graph corresponds to \(\widehat{\mu }\). Clearly, we recover the numerical artifact corresponding to \(\widehat{\mu }\) when \(\alpha =0\). Thus, the numerical moment plays an essential role in either eliminating numerical artifacts at the discretization level or handling numerical artifacts at the solver level.

Fig. 13
figure 13

Left \(\alpha = 40, h = 1/40\), and \(r=0\). Right \(\alpha = 0, h = 1/40\), and \(r=0\)

Fig. 14
figure 14

Left \(\alpha = 20, h = 1/20\), and \(r=2\). Right \(\alpha = 0, h = 1/20\), and \(r=2\)

Fig. 15
figure 15

Left \(\alpha = -40, h = 1/40\), and \(r=0\). Right \(\alpha = -20, h = 1/20\), and \(r=2\)

The IP-DG framework presented in [16] has similar behavior for the preceding numerical tests when using \(r = 2\) with a solver analogous to Algorithm 5.1, where again we have a numerical artifact corresponding to \(\widehat{\mu }\). However, due to the wider availability of IP-DG Poisson solvers in the literature, there is currently greater potential to speed up step (4) in Algorithm 5.1 using the IP-DG formulation. Again, we see that the IP-DG formulation has potential for increased speed at the solver level over the corresponding LDG formulation.

We make one final note about using the iterative solver given by Algorithm 5.1. Using fsolve to solve the full system with the initial guess given by \(u_h^{(0)}\) resulted in either not finding a root for many tests (\(r=1\)) or converging to a numerical artifact with a discontinuous second order derivative at another node in the mesh (\(r=2\)). In order to use fsolve for the given test problem, the initial guess should either be restricted to the class of functions where \(p^{- +}_{h}\) and \(p^{+ -}_{h}\) preserve the ellipticity of the nonlinear operator, the initial guess should be preconditioned by first using fsolve with \(r = 0,1\), or the initial guess should be preconditioned using Algorithm 5.1. When using \(r=0\) and a non-ellipticity-preserving initial guess, solving the full system of equations with fsolve still has the potential to converge to \(u^-\) even for \(\alpha > 0\). The strength of Algorithm 5.1 is that it strongly enforces the requirement that \(\widehat{F}\) is monotone decreasing in \(p^{- +}\) and \(p^{+ -}\) over each iteration. Thus, a sufficiently large value for \(\alpha \) drives the approximation towards the class of ellipticity-preserving functions if the algorithm converges.