1 Introduction

In \( \mathbb {R}^{d} \), given a bounded domain Ω with Lipschitz boundary  Ω and \( \hat {\boldsymbol {\sigma }}_{\boldsymbol {n}}\in H^{-1/2}(\partial \Omega )=\mathrm {tr}\ H(\mathrm {div},\Omega ) \), ω ∈ H 1( Ω) solves the Neumann problem,

$$\displaystyle \begin{aligned} \left\lbrace \begin{aligned} \dfrac{\partial\omega}{\partial\boldsymbol{n}} &= \hat{\boldsymbol{\sigma}}_{\boldsymbol{n}} \quad&& \text{on } \partial\Omega\\ -\mathrm{div} \left(\mathrm{grad}\ \omega \right) +\omega &= 0 \quad&& \text{in } \Omega \end{aligned} \right. , \end{aligned} $$
(1)

if and only if σ ∈ H(div,  Ω) which solves the Dirichlet problem,

$$\displaystyle \begin{aligned} \left\lbrace \begin{aligned} \boldsymbol{\sigma}\cdot\boldsymbol{n}&=\hat{\boldsymbol{\sigma}}_{\boldsymbol{n}} \quad&& \text{on } \partial\Omega\\ -\mathrm{grad}\left( \mathrm{div}\ \boldsymbol{\sigma}\right) +\boldsymbol{\sigma} &= 0 \quad&& \text{in } \Omega \end{aligned} \right. , \end{aligned} $$
(2)

satisfies σ = grad ω [3]. This is obvious at the continuous level. The question is whether we can find a set of finite dimensional function spaces such that σ h = grad ω h holds if ω h and σ h solve the discrete Neumann and Dirichlet problems respectively. The answer is yes.

Throughout this paper, we restrict ourselves to \( \mathbb {R}^{3} \). We will first construct the primal polynomial spaces and their algebraic dual representations, and then use them to discretize problems (1) and (2) such that the identity σ h = grad ω h holds at the discrete level in any curvilinear domain for any polynomial approximation degree. This work extends [7, 9], where similar dual Neumann–Dirichlet problems are considered, to 3-dimensional space. These primal spaces and their algebraic dual representations can be ideal for the so-called mimetic or structure-preserving discretizations [1, 4, 8, 11, 12]. Together with their trace spaces, they can be used for the hybrid finite element methods which first decompose the domains into discontinuous elements then connect them with Lagrange multipliers living in the trace spaces [2, 13, 14].

The outline of this paper is as follows: In Sect. 2, we introduce the construction of polynomial spaces and their algebraic dual representations. The discrete formulations of the Neumann–Dirichlet problems and the proof of their equivalence at the discrete level follow in Sect. 3. A 3-dimensional numerical test case is then presented in Sect. 4. Finally, conclusions are drawn in Sect. 5.

2 Function Spaces

2.1 Primal Polynomial Spaces

Let \( -1 = \xi ^{i}_{0}<\xi ^{i}_{1}<\cdots <\xi ^{i}_{I^{i}}=1 \), i = 1, 2, 3, being three partitionings of [−1, 1]. The associated Lagrange polynomials are

$$\displaystyle \begin{aligned}h_{j}(\xi^{i})=\prod_{m=0,m\neq j}^{I^{i}}\dfrac{\xi^{i} - \xi^{i}_{m}}{\xi_{j}^{i}-\xi_{m}^{i}},\ j=0,1,\cdots,I^{i}.\end{aligned}$$

They are polynomials of degree I i which satisfy the Kronecker delta property, \( h_{j}(\xi ^{i}_{k}) = \delta _{jk} \). The associated edge functions can be derived as [6],

$$\displaystyle \begin{aligned}e_{j}(\xi^{i}) = - \sum_{k=0}^{j-1}\dfrac{\mathrm{d} h_{k}(\xi^{i})}{\mathrm{d} \xi^{i}},\ j=1,2,\cdots,I^{i},\end{aligned}$$

which are polynomials of degree I i − 1. Edge functions also satisfy the Kronecker delta property, but in the integral sense,

$$\displaystyle \begin{aligned} \int_{\xi^{i}_{k-1}}^{\xi^{i}_{k}}e_{j}(\xi^{i})\ \mathrm{d}\xi^{i} = \delta_{jk}. \end{aligned}$$

Consider a reference domain \( \left . \Omega _{\mathrm {ref}}\right |{ }_{\xi ^1,\xi ^2,\xi ^3}:=[-1,1]^3 \). With the tensor product, we can construct finite dimensional scalar function space \( \mathcal {P}^{I^{1}, I^{2}, I^{3}} \) spanned by polynomial basis functions

$$\displaystyle \begin{aligned}\left\lbrace h_{i}(\xi^{1})h_{j}(\xi^{2})h_{k}(\xi^{3})\right\rbrace, \end{aligned}$$

and vector-valued function space \( \mathcal {L}^{I^{1}, I^{2}, I^{3}} \) spanned by polynomial basis functions

$$\displaystyle \begin{aligned} \left\lbrace e_{i}(\xi^{1})h_{j}(\xi^{2})h_{k}(\xi^{3}),\ h_{i}(\xi^{1})e_{j}(\xi^{2})h_{k}(\xi^{3}),\ h_{i}(\xi^{1})h_{j}(\xi^{2})e_{k}(\xi^{3})\right\rbrace.\end{aligned}$$

Let \(\omega ^{h} \in \mathcal {P}^{I^{1}, I^{2}, I^{3}} \) be

$$\displaystyle \begin{aligned} \omega^{h} = \sum_{i=0}^{I^{1}}\sum_{j=0}^{I^2}\sum_{k=0}^{I^3}w_{i,j,k}h_{i}(\xi^{1})h_{j}(\xi^{2})h_{k}(\xi^{3}). \end{aligned} $$
(3)

Due to the way of constructing the edge functions, we can easy derive \( \boldsymbol {\rho }^{h}=\mathrm {grad}\ \omega ^{h} \in \mathcal {L}^{I^{1},I^{2},I^{3}} \),

$$\displaystyle \begin{aligned}\boldsymbol{\rho}^{h}=\mathrm{grad}\ \omega^{h} =(\rho_{1},\ \rho_{2},\ \rho_{3})^{\mathsf{T}},\end{aligned}$$

where [6],

$$\displaystyle \begin{aligned}\rho_{1} = \sum_{i=1}^{I^{1}}\sum_{j=0}^{I^2}\sum_{k=0}^{I^3} \left( w_{i,j,k}-w_{i-1,j,k}\right)e_{i}(\xi^{1})h_{j}(\xi^{2})h_{k}(\xi^{3}),\end{aligned}$$
$$\displaystyle \begin{aligned}\rho_{2} = \sum_{i=0}^{I^{1}}\sum_{j=1}^{I^2}\sum_{k=0}^{I^3} \left( w_{i,j,k}-w_{i,j-1,k}\right)h_{i}(\xi^{1})e_{j}(\xi^{2})h_{k}(\xi^{3}),\end{aligned}$$
$$\displaystyle \begin{aligned}\rho_{3} = \sum_{i=0}^{I^{1}}\sum_{j=0}^{I^2}\sum_{k=1}^{I^3} \left( w_{i,j,k}-w_{i,j,k-1}\right)h_{i}(\xi^{1})h_{j}(\xi^{2})e_{k}(\xi^{3}).\end{aligned}$$

Let \(\underline {\omega } \), \(\underline {\boldsymbol {\rho }} \) be the vectors of expansion coefficients of ω h, ρ h. We can obtain

$$\displaystyle \begin{aligned} \underline{\boldsymbol{\rho}} = \mathbb{E}\ \underline{\omega}, \end{aligned} $$
(4)

where \( \mathbb {E} \) is called the incidence matrix. The incidence matrix is very sparse, only consists of ± 1 as non-zero entries. If we squeeze, stretch or distort the domain, of course, the polynomial basis functions change, but the incidence matrix will remain the same. It only depends on the topology of the mesh and the numbering of the degrees of freedom. And it is exact. In other words, it introduces no extra error. All these features make it an excellent discrete counterpart of the grad operator. Examples of incidence matrices can be found in [8, 10,11,12].

For a comprehensive explanation of these polynomial basis functions, we refer to [6]. In isogeometric analysis, tensor-product B-splines with similar properties have been developed, see, for example [5]. For tetrahedral elements, an analogue development can be found in [15].

From (3), we can derive the trace of ω h, for example, on the back boundary of Ωref, \( \Gamma _{\mathrm {b}}=\left \lbrace \xi ^{1}=-1,\ \xi ^{2},\ \xi ^{3} \in [-1, 1]\right \rbrace \),

$$\displaystyle \begin{aligned} \mathrm{tr}_{\mathrm{b}}\ \omega^{h} = \sum_{j=0}^{I^2}\sum_{k=0}^{I^3}w_{0,j,k}h_{0}(-1)h_{j}(\xi^{2})h_{k}(\xi^{3}). \end{aligned}$$

Let \(\underline {\omega }_{\mathrm {b}} \) be the vector of expansion coefficients of trb ω h. Clearly, there exists a linear operator \( \mathbb {N}_{\mathrm {b}} \) such that

$$\displaystyle \begin{aligned}\underline{\omega}_{\mathrm{b}} = \mathbb{N}_{\mathrm{b}}\ \underline{\omega}.\end{aligned}$$

The same processes can be done for other boundaries. If we collect the traces of ω h on all boundaries and combine their vectors of expansion coefficients and corresponding linear operators, we can eventually obtain

$$\displaystyle \begin{aligned}\underline{\omega}_{\mathrm{tr}} = \mathbb{N}\ \underline{\omega},\end{aligned}$$

where the matrix \( \mathbb {N} \), like \( \mathbb {E} \), is sparse and only depends on the topology of the mesh and the numbering of the degrees of freedom. Furthermore, it contains only 1 as non-zero entries. An example of \( \mathbb {N} \) can be found in [7]. Now, we can conclude that the trace space, \( \mathit {P}^{I^1,I^2,I^3} = \mathrm {tr}\ \mathcal {P}^{I^1,I^2,I^3} \), is given as

$$\displaystyle \begin{aligned}\mathit{P}^{I^1,I^2,I^3} := \mathit{P}_{-1}^{I^2,I^3} \cup \mathit{P}_{1}^{I^2,I^3}\cup\mathit{P}_{-1}^{I^1,I^3}\cup\mathit{P}_{1}^{I^1,I^3}\cup\mathit{P}_{-1}^{I^1,I^2}\cup\mathit{P}_{1}^{I^1,I^2},\end{aligned}$$

where \( \mathit {P}_{-1}^{I^2,I^3} \) is the space spanned by \(\left \lbrace h_{0}(-1)h_{j}(\xi ^{2})h_{k}(\xi ^3) \right \rbrace \), \( \mathit {P}_{1}^{I^2,I^3} \) is the space spanned by \(\left \lbrace h_{I^1}(1)h_{j}(\xi ^{2})h_{k}(\xi ^3) \right \rbrace \) and so on. Notice that the polynomial basis functions in \(\left \lbrace h_{0}(-1)h_{j}(\xi ^{2})h_{k}(\xi ^3) \right \rbrace \) are exactly the same as those in \(\left \lbrace h_{I^1}(1)h_{j}(\xi ^{2})h_{k}(\xi ^3) \right \rbrace \) because \( h_{0}(-1) = h_{I^1}(1) = 1 \). But here we still distinguish them because they represent basis functions at different boundaries.

2.2 Algebraic Dual Polynomial Spaces

We first consider the space \( \mathcal {P}^{I^1,I^2,I^3} \). Let \( \mathbb {M}_{\mathcal {P}} \) be the symmetric mass matrix, for example,

$$\displaystyle \begin{aligned} \begin{aligned} &{\mathbb{M}_{\mathcal{P}}}_{i+j(I^1+1)+k(I^1+1)(I^2+1),\ l+m(I^1+1)+n(I^1+1)(I^2+1)} :=\\ &\qquad \qquad \iiint_{\Omega_{\mathrm{ref}}}h_{i}(\xi^{1})h_{j}(\xi^{2})h_{k}(\xi^{3}) h_{l}(\xi^{1})h_{m}(\xi^{2})h_{n}(\xi^{3})\ \mathrm{d}\xi^{1}\mathrm{d}\xi^{2}\mathrm{d}\xi^{3}. \end{aligned} \end{aligned}$$

The associated algebraic dual polynomial representations, or simply dual polynomials, are linear combinations of the polynomial basis functions, or simply primal polynomials, defined in the previous section,

$$\displaystyle \begin{aligned} \begin{aligned} &\left[ \widetilde{h_{0,0,0}}(\xi^{1},\xi^2,\xi^{3}),\ \cdots,\ \widetilde{h_{I^1,I^2,I^3}}(\xi^{1},\xi^2,\xi^{3})\right] \\&\qquad \qquad \qquad := \left[ h_{0}(\xi^{1})h_{0}(\xi^{2})h_{0}(\xi^{3}),\ \cdots,\ h_{I^1}(\xi^{1})h_{I^2}(\xi^{2})h_{I^3}(\xi^{3}) \right]\mathbb{M}_{\mathcal{P}}^{-1}. \end{aligned} \end{aligned}$$

These dual polynomials are always well-defined. This is because the primal polynomials are linearly independent. So the mass matrix \( \mathbb {M}_{\mathcal {P}} \) is injective and surjective, therefore invertible. Let the finite dimensional space spanned by \( \left \lbrace \widetilde {h_{i,j,k}}(\xi ^{1},\xi ^2,\xi ^{3})\right \rbrace \) be denoted by \( \widetilde {\mathcal {P}}^{I^1, I^2, I^3} \). We say \( \widetilde {\mathcal {P}}^{I^1, I^2, I^3} \) is the algebraic dual space of the primal space \( \mathcal {P}^{I^1, I^2, I^3} \). Note that \( \mathcal {P}^{I^1, I^2, I^3} \) and \( \widetilde {\mathcal {P}}^{I^1, I^2, I^3} \) actually represent the same space. The change of basis functions only leads to a different representation. Therefore, we also call the algebraic dual space a dual representation. Let \( \widetilde {\mathbb {M}}_{\mathcal {P}} \) be the mass matrix of \( \widetilde {\mathcal {P}}^{I^1,I^2,I^3} \), we can easily see that

$$\displaystyle \begin{aligned} \widetilde{\mathbb{M}}_{\mathcal{P}}\mathbb{M}_{\mathcal{P}}=\mathcal{I}, \end{aligned} $$
(5)

where \( \ mathcal {I} \) is the identity matrix. Similarly, we can derive the algebraic dual space \( \widetilde {\mathcal {L}}^{I^1,I^2,I^3} \) of the primal space \( \mathcal {L}^{I^1,I^2,I^3} \). Let \( \widetilde {\mathbb {M}}_{\mathcal {L}} \) and \( \mathbb {M}_{\mathcal {L}} \) be their mass matrices, we have

$$\displaystyle \begin{aligned} \widetilde{\mathbb{M}}_{\mathcal{L}}\mathbb{M}_{\mathcal{L}}=\mathcal{I}. \end{aligned} $$
(6)

If \( \boldsymbol {\rho }^{h}\in \mathcal {L}^{I^1,I^2,I^3} \), σ h, whose vector of expansion coefficients \(\underline {\boldsymbol {\sigma }} \) satisfies

$$\displaystyle \begin{aligned} \underline{\boldsymbol{\sigma}} = \mathbb{M}_{\mathcal{L}}\ \underline{\boldsymbol{\rho}}, \end{aligned} $$
(7)

will be the representation of ρ h in the algebraic dual space \(\widetilde { \mathcal {L}}^{I^1,I^2,I^3} \).

To explain how the algebraic dual space of the trace space \( \mathit {P}^{I^1,I^2,I^3} \) is derived, we take \( \mathit {P}_{-1}^{I^2,I^3} \) as example. We already know that \( \mathit {P}_{-1}^{I^2,I^3} \) is a space spanned by primal polynomials \(\left \lbrace h_{0}(-1)h_{j}(\xi ^{2})h_{k}(\xi ^3) \right \rbrace \). With these primal polynomials, we can compute its mass matrix, denoted by \( \mathbb {M}_{\mathrm {b}} \). The dual polynomials are then computed by

$$\displaystyle \begin{aligned} \begin{aligned} &\left[ \widetilde{h_{0,0,0}}(-1,\xi^2,\xi^{3}),\ \cdots,\ \widetilde{h_{0,I^2,I^3}}(-1,\xi^2,\xi^{3})\right] \\ &\qquad \qquad \qquad = \left[ h_{0}(-1)h_{1}(\xi^{2})h_{1}(\xi^3),\ \cdots,\ h_{0}(-1)h_{I^2}(\xi^{2})h_{I^3}(\xi^3)\right]\mathbb{M}_{\mathrm{b}}^{-1}. \end{aligned} \end{aligned}$$

The algebraic dual space \( \widetilde {\mathit {P}}_{-1}^{I^2,I^3} \)is spanned by dual polynomials \( \left \lbrace \widetilde {h_{0,j,k}}(-1,\xi ^2,\xi ^{3}) \!\right \rbrace \). The algebraic dual space of the trace space \( \mathit {P}^{I^1,I^2,I^3} \) eventually can be written as

$$\displaystyle \begin{aligned}\widetilde{\mathit{P}}^{I^1,I^2,I^3} = \widetilde{\mathit{P}}_{-1}^{I^2,I^3} \cup \widetilde{\mathit{P}}_{1}^{I^2,I^3}\cup\widetilde{\mathit{P}}_{-1}^{I^1,I^3}\cup\widetilde{\mathit{P}}_{1}^{I^1,I^3}\cup\widetilde{\mathit{P}}_{-1}^{I^1,I^2}\cup\widetilde{\mathit{P}}_{1}^{I^1,I^2}.\end{aligned}$$

The divergence of \( \boldsymbol {\sigma }^{h}\in \widetilde {\mathcal {L}}^{I^1,I^2,I^3} \) can be done with the help of the boundary value \( \hat {\boldsymbol {\sigma }}^{h}\in \widetilde {\mathit {P}}^{I^1,I^2,I^3} \). With vector proxies, it can be written as

$$\displaystyle \begin{aligned} \underline{\mathrm{div}\ \boldsymbol{\sigma}}^{h} = \mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h} - \mathbb{E}^{\mathsf{T}} \underline{\boldsymbol{\sigma}}^{h}. \end{aligned} $$
(8)

A detailed introduction of algebraic dual polynomial spaces is given in [9].

2.3 Function Spaces in Curvilinear Domains

So far, all polynomial spaces are defined only in the reference domain \( \left .\Omega _{\mathrm {ref}}\right |{ }_{\xi ^1,\xi ^2,\xi ^3}=[-1,1]^3 \). Consider an arbitrary domain Ω and a \( \mathcal {C}^1 \) diffeomorphism \( \Phi :\left . \Omega _{\mathrm {ref}}\right |{ }_{\xi ^1,\xi ^2,\xi ^3}\to \left . \Omega \right |{ }_{x^1,x^2,x^3} \). In Ω, the primal polynomials change. Therefore, the mass matrices will also change. But the process of constructing dual polynomials does not change. And as we mentioned before, the metric-independent incidence matrix \( \mathbb {E} \) and the matrix \( \mathbb {N} \) remain the same. The way of converting polynomials in Cartesian domain into those in curvilinear domains follows the general coordinate transformation process, for example, see [16].

From now on, notations mentioned in this section not only refer to the reference domain Ωref, but also refer to the physical domain Ω.

3 Weak Formulations

3.1 Discrete Neumann Problem

With integration by parts, we can derive the weak formulation of the Neumann problem, (1), written as: For given \( \hat {\boldsymbol {\sigma }}\in H^{-1/2}(\partial \Omega ) \), find ω ∈ H 1( Ω) such that

$$\displaystyle \begin{aligned} \left( \mathrm{grad}\ \omega,\ \mathrm{grad}\ \bar{\omega}\right) _{L^2} + \left( \omega,\ \bar{\omega}\right) _{L^2} = \left\langle \mathrm{tr}\ \bar{\omega},\ \hat{\boldsymbol{\sigma}}\right\rangle ,\quad\forall \bar{\omega} \in H^1(\Omega).\end{aligned} $$
(9)

Note that on the right hand side, we use \( \left \langle \cdot ,\cdot \right \rangle \) to represent the duality pairing between \( \mathrm {tr}\ \bar {\omega }\in H^{1/2}(\partial \Omega ) \) and \( \hat {\boldsymbol {\sigma }} \in H^{-1/2}(\partial \Omega ) \). We use finite dimensional space \( \mathcal {P}^{I^1,I^2,I^3} \) to approximate the space H 1( Ω) and use the algebraic dual trace space \( \widetilde {\mathit {P}}^{I^1,I^2,I^3} \) to approximate the space H −1∕2( Ω). Then we obtain

$$\displaystyle \begin{aligned} \left( \mathrm{grad}\ \omega^{h},\ \mathrm{grad}\ \bar{\omega}^{h}\right) _{L^2} = \underline{\bar{\omega}}^{h,\mathsf{T}}\ \mathbb{E}^{\mathsf{T}}\mathbb{M}_{\mathcal{L}}\mathbb{E}\ \underline{\omega}^{h},\end{aligned} $$
$$\displaystyle \begin{aligned} \left( \omega^{h},\ \bar{\omega}^{h}\right) _{L^2} = \underline{\bar{\omega}}^{h,\mathsf{T}}\ \mathbb{M}_{\mathcal{P}}\ \underline{\omega}^{h}, \end{aligned}$$

and

$$\displaystyle \begin{aligned} \int_{\partial\Omega}\mathrm{tr}\ \bar{\omega}^{h}\ \hat{\boldsymbol{\sigma}}^{h}\ \mathrm{d}\Gamma = \underline{\bar{\omega}}^{h,\mathsf{T}}\ \mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h}, \end{aligned}$$

which eventually leads to the discrete formulation of (9),

$$\displaystyle \begin{aligned} \mathbb{E}^{\mathsf{T}}\mathbb{M}_{\mathcal{L}}\mathbb{E}\ \underline{\omega}^{h} + \mathbb{M}_{\mathcal{P}}\ \underline{\omega}^{h} = \mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h}. \end{aligned} $$
(10)

3.2 Discrete Dirichlet Problem

For the Dirichlet problem, (2), the weak formulation is given as: For given \( \hat {\boldsymbol {\sigma }} \in H^{-1/2}(\partial \Omega )\), find σ ∈ H(div,  Ω), \( \mathrm {tr}\ \boldsymbol {\sigma }= \hat {\boldsymbol {\sigma }} \) such that

$$\displaystyle \begin{aligned} \left( \mathrm{div}\ \boldsymbol{\sigma},\ \mathrm{div}\ \bar{\boldsymbol{\sigma}}\right) _{L^2} + \left( \boldsymbol{\sigma},\ \bar{\boldsymbol{\sigma}}\right) _{L^2} = 0,\quad\forall \bar{\boldsymbol{\sigma}}\in H_{0}(\mathrm{div},\Omega).\end{aligned} $$
(11)

We use algebraic dual space \( \widetilde {\mathcal {L}}^{I^1,I^2,I^3} \) to approximate H(div,  Ω). With \( \hat {\boldsymbol {\sigma }}^{h} \in \widetilde {\mathit {P}}^{I^1,I^2,I^3} \) given and (8), we obtain

$$\displaystyle \begin{aligned} \left( \mathrm{div}\ \boldsymbol{\sigma}^{h},\ \mathrm{div}\ \bar{\boldsymbol{\sigma}}^{h}\right) _{L^2} = - \underline{\bar{\boldsymbol{\sigma}}}^{h,\mathsf{T}}\ \mathbb{E}\widetilde{\mathbb{M}}_{\mathcal{P}}\left( \mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h} -\mathbb{E}^{\mathsf{T}}\ \underline{\boldsymbol{\sigma}}^{h}\right) ,\end{aligned} $$

and

$$\displaystyle \begin{aligned} \left( \boldsymbol{\sigma}^{h},\ \bar{\boldsymbol{\sigma}}^{h}\right) _{L^2} = \underline{\bar{\boldsymbol{\sigma}}}^{h,\mathsf{T}}\ \widetilde{\mathbb{M}}_{\mathcal{L}}\ \underline{\boldsymbol{\sigma}}^{h}. \end{aligned}$$

Therefore, the discrete formulation of (11) is written as

$$\displaystyle \begin{aligned} \mathbb{E}\widetilde{\mathbb{M}}_{\mathcal{P}}\mathbb{E}^{\mathsf{T}}\ \underline{\boldsymbol{\sigma}}^{h} + \widetilde{\mathbb{M}}_{\mathcal{L}}\ \underline{\boldsymbol{\sigma}}^{h}= \mathbb{E}\widetilde{\mathbb{M}}_{\mathcal{P}}\mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h}. \end{aligned} $$
(12)

3.3 Equivalence Between Discrete Formulations

Now it is time to check if the equivalence between (1) and (2) holds at the discrete level. In other words, it is time to check if the statement that \(\underline {\omega }^{h} \) solves (10) if and only if \(\underline {\boldsymbol {\sigma }}^{h}=\mathrm {grad}\\underline {\omega }^{h} \) solves (12) is correct.

From (4) and (7), we know that \(\underline {\boldsymbol {\sigma }}^{h} \),

$$\displaystyle \begin{aligned} \underline{\boldsymbol{\sigma}}^{h} = \mathbb{M}_{\mathcal{L}}\mathbb{E}\ \underline{\omega}^{h},\end{aligned} $$
(13)

is the vector representation of grad ω h in the dual space. If we insert (13) into (12), we obtain

$$\displaystyle \begin{aligned} \mathbb{E}\widetilde{\mathbb{M}}_{\mathcal{P}}\mathbb{E}^{\mathsf{T}}\mathbb{M}_{\mathcal{L}}\mathbb{E}\ \underline{\omega}^{h} + \widetilde{\mathbb{M}}_{\mathcal{L}}\mathbb{M}_{\mathcal{L}}\mathbb{E}\ \underline{\omega}^{h}= \mathbb{E}\widetilde{\mathbb{M}}_{\mathcal{P}}\mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h}. \end{aligned} $$
(14)

From (10), we know that

$$\displaystyle \begin{aligned} \mathbb{E}^{\mathsf{T}}\mathbb{M}_{\mathcal{L}}\mathbb{E}\ \underline{\omega}^{h} = -\mathbb{M}_{\mathcal{P}}\ \underline{\omega}^{h} + \mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h}. \end{aligned} $$
(15)

By inserting (15) into (14), we get

$$\displaystyle \begin{aligned} \mathbb{E}\widetilde{\mathbb{M}}_{\mathcal{P}}\left( -\mathbb{M}_{\mathcal{P}}\ \underline{\omega}^{h} + \mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h}\right) + \widetilde{\mathbb{M}}_{\mathcal{L}}\mathbb{M}_{\mathcal{L}}\mathbb{E}\ \underline{\omega}^{h}= \mathbb{E}\widetilde{\mathbb{M}}_{\mathcal{P}}\mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h}. \end{aligned} $$
(16)

From (5) and (6), we know that (16) holds, which proves the equivalence.

If the equivalence holds, relation \( \left \|\omega ^{h}\right \|{ }_{H^1(\Omega )} = \left \|\boldsymbol {\sigma }^{h}\right \|{ }_{H(\mathrm {div},\Omega )} \) should also be satisfied. To prove this, we have

$$\displaystyle \begin{aligned} \begin{aligned} \left\|\boldsymbol{\sigma}^{h}\right\|{}_{H(\mathrm{div},\Omega)}^2 &\stackrel{\text{(8)}}{=} \underline{\boldsymbol{\sigma}}^{h,\mathsf{T}}\ \widetilde{ \mathbb{M}}_{\mathcal{L}}\ \underline{\boldsymbol{\sigma}}^{h} + \left( \mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h} - \mathbb{E}^{\mathsf{T}} \underline{\boldsymbol{\sigma}}^{h}\right) ^{\mathsf{T}}\widetilde{ \mathbb{M}} _{\mathcal{P}}\left( \mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h} - \mathbb{E}^{\mathsf{T}} \underline{\boldsymbol{\sigma}}^{h}\right) \\ &\stackrel{\text{(13)}}{=} \left( \mathbb{M}_{\mathcal{L}}\mathbb{E}\ \underline{\omega}^{h}\right)^{\mathsf{T}}\widetilde{ \mathbb{M}}_{\mathcal{L}}\left( \mathbb{M}_{\mathcal{L}}\mathbb{E}\ \underline{\omega}^{h}\right) \\&\quad + \left[ \mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h} -\mathbb{E}^{\mathsf{T}} \left( \mathbb{M}_{\mathcal{L}}\mathbb{E}\ \underline{\omega}^{h}\right) \right] ^{\mathsf{T}}\widetilde{ \mathbb{M}} _{\mathcal{P}}\left[\mathbb{N}^{\mathsf{T}}\ \underline{\hat{\boldsymbol{\sigma}}}^{h} - \mathbb{E}^{\mathsf{T}} \left( \mathbb{M}_{\mathcal{L}}\mathbb{E}\ \underline{\omega}^{h}\right) \right] \\ &\stackrel{\text{(10)}}{=}\underline{\omega}^{h,\mathsf{T}}\ \mathbb{E}^{\mathsf{T}}\mathbb{M}_{\mathcal{L}}\mathbb{E}\ \underline{\omega}^{h} + \underline{\omega}^{h,\mathsf{T}}\ \mathbb{M}_{\mathcal{P}}\widetilde{ \mathbb{M}}_{\mathcal{P}}\mathbb{M}_{\mathcal{P}}\ \underline{\omega}^{h}\\ &=\left\|\omega^{h}\right\|{}_{H^1(\Omega)}^2 , \end{aligned} \end{aligned}$$

where we constantly use (5) and (6) and the fact that mass matrices are symmetric.

4 Numerical Test

Consider the mapping Φ which maps the Cartesian reference domain \( \left . \Omega _{\mathrm {ref}} \right |{ }_{\xi ^1,\xi ^2,\xi ^3}{:=} [-1,1]^3\) into the physical domain \( \left . \Omega \right |{ }_{x^1,x^2,x^3} = [0,1]^3 \) by

$$\displaystyle \begin{aligned} x^i = \dfrac{1}{2} + \dfrac{1}{2}\left( \xi^i + c\prod_{j}\sin{}(\pi\xi^j)\right),\ i=1,2,3. \end{aligned}$$

When the deformation coefficient c = 0, the domain Ω is Cartesian. Otherwise the domain is curvilinear, meaning that a curvilinear coordinate system parametrizes Ω. Examples of such curvilinear domains in \( \mathbb {R}^2 \) are shown in Fig. 1.

Fig. 1
figure 1

Curvilinear domains for c = 0.15 (Left) and c = 0.3 (Right) in \(\mathbb {R}^2 \). The gray lines illustrate the coordinate lines

A manufactured solution of the Neumann problem, (1), is

$$\displaystyle \begin{aligned} \omega_{\mathrm{exact}} = e^{x^1}+ e^{x^2} + e^{x^3}. \end{aligned}$$

Clearly, \( \boldsymbol {\sigma }_{\mathrm {exact}}=\mathrm {grad}\ \omega _{\mathrm {exact}} = \left ( e^{x^1},\ e^{x^2},\ e^{x^3}\right ) ^{\mathsf {T}} \) solves the Dirichlet problem, (2).

In the domains of different deformation coefficient c, with the boundary condition \( \hat {\boldsymbol {\sigma }}=\mathrm {tr}\ \boldsymbol {\sigma }_{\mathrm {exact}} \) imposed, we solve the discrete formulations (10) and (12) using Gauss–Lobatto–Legendre (GLL) polynomial spaces of degree I 1 = I 2 = I 3 = N.

The results of the L 2-error of \( \left ( \boldsymbol {\sigma }^{h}-\mathrm {grad}\ \omega ^{h}\right ) \) are shown in Fig. 2 (Left) where we can see that the relation σ h = grad ω h is preserved up to the machine precision. With the growth of the polynomial degree, the error increases slowly because of the accumulation of the machine error as the amount of degrees of freedom grows significantly.

In Table 1, the results of the H 1-norm of ω h and H(div)-norm of σ h are presented. It is shown that the relation \( \left \|\omega ^{h}\right \|{ }_{H^1(\Omega )} = \left \|\boldsymbol {\sigma }^{h}\right \|{ }_{H(\mathrm {div},\Omega )} \) holds for all polynomial degrees irrespective of whether we use the Cartesian domain, c = 0, or curvilinear domains, c = 0.15, 0.3. It is also seen that the results always converge to the analytical value \( \left \|\omega _{\mathrm {exact}}\right \|{ }_{H^1}= \left \|\boldsymbol {\sigma }^{h}\right \|{ }_{H(\mathrm {div})}=6.0730653668\). The p-convergence for the H 1-error of ω h, therefore also for the H(div)-error of σ h, is shown in Fig. 2 (Right), which shows the exponential convergence of the method.

Table 1 The H 1-norm of ω h and H(div)-norm of σ h for polynomial degree N = 2, 4, ⋯ , 20 and deformation coefficient c = 0, 0.15, 0.3
Fig. 2
figure 2

The L 2-error of \(\left (\boldsymbol {\sigma }^{h}-\mathrm {grad}\ \omega ^{h} \right ) \) (Left) and the p-convergence of the H 1-error of ω h (Right) for N = 2, 4, ⋯ , 20 and c = 0, 0.15, 0.3

5 Conclusions

By constructing and using primal polynomial spaces and their algebraic dual representations both in the domain and on the boundary, we successfully preserve the equivalence of the div-grad Neumann problem and the grad-div Dirichlet problem at the discrete level in 3-dimensional curvilinear domains. This suggests the further usage of these spaces to structure-preserving methods and hybrid methods.