1 Introduction

Photovoltaic cells have been intensively studied in nanoscience and nanotechnology researchs, due to the possibility of obtaining electrical energy from the sunlight, which is consider as a green energy choice. This renewable resource of energy can be used in place of fossil fuels, in order to achieve lower harmful emissions into the atmosphere, a reduced carbon footprint and fewer air pollutants.

For some decades, the search of new sustainable sources of electrical energy has encouraged projects whose main goals consist on improving the capability to collect sunlight of the photovoltaic cells with periodic surface-relief gratings and increasing the electrical energy generation. In fact, one of the strategies to increase the efficiency of light harvesting by solar cells, is the use of plasmonic structures that enhance the intensity of the electromagnetic field [32]. The key idea is to texture the surface of the metallic back-reflector of a thin-film solar cell by periodic corrugations of size proportional to the wavelength. Under some conditions [32], this configuration produces an excitement of the electrons placed on the surface of the metal, generating a wave that propagates through the surface called surface plasmon polariton (SPP) wave. For instance, this occurs when the propagation constant \(\beta ^\textrm{SPP}\) of a SPP wave and the propagation constant \(\beta ^{inc}\) of the incident wave satisfy \(\beta ^\textrm{SPP}=\beta ^{inc} + 2n\pi \), for some \(n \in \mathbb {Z}\) in the transverse magnetic (TM) polarization, see Sections \(2\text{. }1\) and \(2\text{. }2\) of [32]. In the same direction, multiple SPP waves can be generated by placing a periodic multi-layered isotropic dielectric material on top of the metallic back-reflector [19]. Furthermore, structures involving different type of materials have been considered in order to optimize the performance of the cells, see for example [46] and references therein. In those cases, it is possible to maximize the spectrally averaged electron hole pair density and the solar-spectrum-integrated power-flux density [4, 19, 37, 45]. This optimization process is expensive from the computational point of view since the functionals to maximize depend on the solution to Maxwell’s equations and also on geometric and optical parameters. This fact motivates the development and analysis of new methods able to reduce the computational costs. In this regards, some authors have used numerical techniques in order to state and approximate the solution of boundary value problems, in which the effect of unpolarized or polarized incident plane waves on the surface of the cell and a wide range of geometrical and optical parameters in the frequency-domain Maxwell’s equations, have been considered. Among them, we highlight the exact modal method [23], the moment method (MoM) [33], the rigorous coupled-wave approach (RCWA) [37, 46], the finite-difference time-domain (FDTD) method [27], the finite element method (FEM) [5, 26, 35, 36, 42, 46], and hybridizable discontinuous Galerkin (HDG) methods [10, 11, 13, 14, 20, 39, 47]. We focus our study on the latter.

Perhaps, from the numerical analysis point of view, three main challenges arise from the model: the complex-valued electric permittivity, the quasi-periodic boundary condition and the outgoing radiation condition above and below the solar cell structure. Most of the known studies assume a positive electric permittivity and consider prescribed boundary data. Under that assumption, in [20] an HDG method to study the three-dimensional time harmonic Maxwell’s equations coupled with the impedance boundary condition was proposed, in the case of high wave numbers. The stability and error estimates for the method were deduced by employing the constraint \(\kappa h \le 1\). Based on the reliable results showed in the above work and in [14, 39], some authors considered complex-valued permittivities [10, 35, 47] and not perfect conducting boundary conditions. More precisely, in [47] a high-order HDG scheme for Maxwell’s equations augmented with the hydrodynamic model, for the conduction-band electrons in noble metals, is stated. The radiation conditions can be handled by boundary element methods [24], absorbing boundary conditions (ABCs) [38], Dirichlet-to-Neumann (DtN) tecniques, based on Fourier expansions [1] and by the perfectly matched layer (PML) technique, [8, 15, 41].

Inspired in the application described above, in this work we consider a problem in which the time harmonic Maxwell’s equations are defined in a bounded domain \(\Omega \subset \mathbb {R}^3\) occupied by one period of a bi-periodic structure, illuminated by an incident electromagnetic wave. Our heterogeneous domain \(\Omega \) corresponds to the disjoint union between the region \(\Omega _d\), occupied by an isotropic dielectric material with positive real relative permittivity and a metallic region denoted \(\Omega _m\), whose relative permittivity is a complex-valued number with negative real part, see [10]. On the top and bottom boundaries of the unit cell, we consider Dirichlet type conditions and impose quasi-periodic conditions on the vertical walls of \(\Omega \). Quasi-periodic conditions can be added to the system of equations defined in symmetric or asymmetric domains with periodic characteristics, see Sections \(3\text{. }1\) and \(3\text{. }3\) of [26] and Section 2 of [48]. These kind of boundary conditions differ by a complex exponential factor or Bloch phase, on the parallel walls of the domain. In order to carry out an a priori error analysis of our 3D problem subjected to Dirichlet and quasi-periodic conditions, we based on the analysis developed in [10]. Even though we are not considering exactly the original model since we impose Dirichlet boundary condition at the top and bottom walls instead of dealing with the outgoing radiation condition, this “simplified” problem posses several challenges that must be addressed first. Therefore, we consider the analysis that we will present in this manuscript constitutes as a key stepping stone towards the goal of studying the full model.

On the other hand, the change of material across the non-smooth metallic interface, might produce singularities near the corners. Moreover, as previously discussed, the magnitude of electromagnetic field is high near the metal surface due to the plasmonic effect. Therefore, in that region, the finite element mesh must be fine enough to capture this phenomena accurately. This can be efficiently achieved by an adaptive scheme able detect where to localize the mesh refinement based on an error indicator.

In the case of an a posteriori error indicator for Maxwell’s equations, one of the main challenges are the non-coercivity of the bilinear form and the low regularity of the exact solution. Residual based a posteriori error estimates for Maxwell’s equations in electromagnetic scattering problems were introduced in [7, 34]. The author in [34] showed how an a posteriori error indicator can be derived using an adjoint equation approach and also the fact that there is a limit on the maximum diameter of the elements in a grid, imposed by the non-coercivity of the bilinear form. Later, [43] proved the reliability of the residual error estimators on Lipschitz domains, which had been proposed and analyzed in [7]. In [28], the authors derived an hp-type a posteriori error estimate for the time-harmonic Maxwell’s equations and, in [31], carried out an a posteriori error analysis for the time-dependent Maxwell’s equations. For the steady state coercive Maxwell’s equations, the authors in [13] provided a computable residual-based a posteriori error estimator, which is independent of the regularity parameter of the solution and it is based on the error measured in terms of a mesh-dependent energy norm. On the other hand, by using hierarchical basis, [6] proposed a hierarchical error estimator for quasi-magnetostatic eddy current problem discretized by means of lowest order curl-conforming finite elements on tetrahedral meshes. They provided a saturation assumption in order to guarantee the reliability and efficiency of the estimator.

In this manuscript, we extend the residual-based a posteriori error estimator for the coercive Maxwell’s equations, developed in [13]. We will establish reliability and local efficiency of the error estimator proposed for our HDG scheme, by using approximation properties of continuous functions, Helmholtz decompositions, the Scott-Zhang interpolation operator and a standard localization technique, based on element and face bubble functions [2]. Moreover, in the context of discontinuous Galerkin methods, it is crucial the use of a continuous approximation of a discontinuous piece-wise polynomial function [29, 30], sometimes called Oswald interpolant inspired in the work by [40] for piecewise linear approximations. This interpolant has been employed in the deduction of a posteriori error estimators for HDG methods [3, 12, 16, 17]. In our case, we modify this operator in such a way that it preserves quasi-periodic boundary conditions (see Appendix A.2).

The rest of this paper is organized as follows. In Sect. 2 we define the truncated domain and introduce the boundary value problem. In Sect. 3, we propose an HDG method and prove it is well posed. Then, we briefly describe the stability analysis and the error analysis for the method. The residual-based a posteriori error estimator for our HDG method is developed and analyzed in the fourth section. Finally, in Sect. 5 we show some numerical results by using uniform refined meshes and adaptive refined meshes.

2 Problem Statement

Through the manuscript we will use standard simplified terminology for Sobolev spaces and norms, where vector-valued functions are bold-faced. In particular, if \(\mathcal {O}\) is a domain in \(\mathbb {R}^3\), \(\Sigma \) is an open or closed Lipschitz surface, and \(s\in \mathbb {R}\), we set \(\textbf{H}^{s}(\mathcal {O}):= [\textrm{H}^{s}(\mathcal {O})]^{3}\), \(\textbf{H}^{s}(\Sigma ):= [\textrm{H}^{s}(\Sigma )]^{3}\) and their corresponding norms \(\Vert \cdot \Vert _{s,\mathcal {O}}\) for \(\textrm{H}^{s}(\mathcal {O})\) and \(\textbf{H}^{s}(\mathcal {O})\); and \(\Vert \cdot \Vert _{s,\Sigma }\) for \(\textrm{H}^{s}(\Sigma )\) and \(\textbf{H}^{s}(\Sigma )\). In the case \(s=0\), we write \(\textrm{L}^2(\mathcal {O})\), \(\textbf{L}^2(\mathcal {O})\), \(\textrm{L}^2(\Sigma )\) and \(\textbf{L}^2(\Sigma )\) instead of \(\textrm{H}^{0}(\mathcal {O})\), \(\textbf{H}^{0}(\mathcal {O})\), \(\textrm{H}^{0}(\Sigma )\) and \(\textbf{H}^{0}(\Sigma )\), respectively; and in the notation for their norms, the first subindex will not be included. For \(s> 0\), we write \(|\cdot |_{s,\mathcal {O}}\) for the \(\textrm{H}^{s}\)- and \(\textbf{H}^{s}\)-seminorms. From ahead, \(\mathbb {P}_k(\mathcal {O})\) denotes the space of complex-valued polynomials of degree less or equal than \(k \ge 0\), \(\textbf{P}_k(\mathcal {O}):=[\mathbb {P}_k(\mathcal {O})]^3\) and by \((\cdot ,\cdot )_{\mathcal {O}}\) and \(\langle \cdot ,\cdot \rangle _{\partial \mathcal {O}}\), we denote the \(\textrm{L}^2(\mathcal {O})\) and \(\textrm{L}^2(\partial \mathcal {O})\) inner products, respectively.

In addition, we introduce the following spaces

$$\begin{aligned} \textrm{H}(\textrm{div}_{\epsilon };\mathcal {O})&:= \{ \textbf{w} \in \textbf{L}^2(\mathcal {O}) : \nabla \cdot \left( \mathbf {\epsilon w}\right) \in \textrm{L}^2(\mathcal {O})\},\\ \textrm{H}(\textrm{div}^0_{\epsilon };\mathcal {O})&:= \{ \textbf{w} \in \textbf{L}^2(\mathcal {O}) : \nabla \cdot \left( \mathbf {\epsilon w}\right) =0\},\\ \textrm{H}_{0}(\textrm{div};\mathcal {O})&:= \{\textbf{w} \in \textrm{H}(\textrm{div};\mathcal {O}): \textbf{w}\cdot \textbf{n}\vert _{\partial \mathcal {O}}=0\},\\ \textrm{H}_{\vartheta }(\textrm{div};\mathcal {O})&:= \{\textbf{w} \in \textrm{H}(\textrm{div};\mathcal {O}): \textbf{w}\cdot \textbf{n}\vert _{\vartheta }=0\},\\ \textrm{H}(\textbf{curl};\mathcal {O})&:=\{\textbf{w} \in \textbf{L}^2(\mathcal {O}): \nabla \times \textbf{w} \in \textbf{L}^2(\mathcal {O})\},\\ \textrm{H}_0(\textbf{curl};\mathcal {O})&:= \{\textbf{w} \in \textrm{H}(\textbf{curl};\mathcal {O}) : \textbf{w} \times \textbf{n}\vert _{\partial \mathcal {O}}=0 \},\\ \textrm{H}_{\vartheta }(\textbf{curl};\mathcal {O})&:=\{\textbf{w}\in \textrm{H}(\textbf{curl};\mathcal {O}): \textbf{w} \times \textbf{n}\vert _{\vartheta }=0\}, \end{aligned}$$

where \(\vartheta \subset \partial \mathcal {O}\) and \(\textbf{n}\) denotes the outward unit normal vector to \(\partial \mathcal {O}\). For a vector-valued function \(\textbf{w}\) defined on a face F, we denote by \(\textbf{w}^t:=(\textbf{n}\times \textbf{w})\times \textbf{n}\) and \(\textbf{w}^n:=(\textbf{w}\cdot \textbf{n}) \textbf{n}\) its tangential and normal components, respectively. It follows that \(\textbf{w}:=\textbf{w}^t+\textbf{w}^n\) and \(\textbf{w}^t\times \textbf{n}=\textbf{w}\times \textbf{n}\).

Furthermore, to avoid proliferation of unimportant constants, the expression \(A \le C B\), for some \(C > 0\) independent of the meshsize, will be replaced by \(A \lesssim B\).

Now, let us characterize our simply connected domain \(\Omega := (0,L) \times (0,L) \times (0,M)\), with \(L, M > 0\) with polyhedral connected boundary \(\Gamma := \Gamma _1 \cup \Gamma _2 \cup \Gamma _3 \cup \Gamma _4 \cup \Gamma _{\textrm{B}} \cup \Gamma _{\textrm{T}}\). Here,

$$\begin{aligned} \Gamma _1:&= \{(0,y,z): y \in (0,L), z \in (0,M)\},\quad&\Gamma _2:&= \{(L,y,z): y \in (0,L), z \in (0,M)\},\\ \Gamma _3:&= \{(x,0,z): x \in (0,L), z \in (0,M)\},\quad&\Gamma _4:&= \{(x,L,z): x \in (0,L), z \in (0,M)\},\\ \Gamma _{\textrm{B}}:&= \{(x,y,0): x \in (0,L), y \in (0,L)\},\quad&\Gamma _{\textrm{T}}:&= \{(x,y,M): x \in (0,L), y \in (0,L)\}. \end{aligned}$$

In applications arising from solar cell modeling, \(\Omega \) corresponds to one period of a bi-periodic array, where the unit cells are joined through quasi-periodic boundary conditions, which are imposed on the vertical walls of \(\Omega \), \(\Gamma _1\)-\(\Gamma _2\) and \(\Gamma _3\)-\(\Gamma _4\). In this phenomenon, after the sunlight illuminates the top boundary \(\Gamma _{\textrm{T}}\), outgoing and evanescent waves are generated, below the bottom boundary \(\Gamma _{\textrm{B}}\) and above \(\Gamma _{\textrm{T}}\), as well. In this work we assume that the data on \(\Gamma _{\textrm{B}}\) and \(\Gamma _{\textrm{T}}\) are prescribed, but we consider quasi-periodic boundary conditions on \(\Gamma _1\)-\(\Gamma _2\) and \(\Gamma _3\)-\(\Gamma _4\).

The domain \(\Omega \) is divided in two subdomains. A dielectric region \(\Omega _d\) with permittivity \(\epsilon _d \in \mathbb {R}^+ \) and a metallic region \(\Omega _m\) with electric permittivity \(\epsilon _m \in \mathbb {C}\), satisfying \(\text {Re}(\epsilon _m) < 0\) and \(\text {Im}(\epsilon _m) > 0\), as it was shown in Fig. 1.

Fig. 1
figure 1

Example of a domain \(\Omega \): a dielectric region \(\Omega _d\) placed on top of a metallic backreflector \(\Omega _m\)

Given \(\textbf{J} \in \textrm{H}(\textrm{div}^0;\Omega )\) and \(\hat{\textbf{g}} \in \gamma _t\left( \textrm{H}(\textbf{curl};\Omega ) \cap \textrm{H}(\textrm{div}_{\epsilon }^0;\Omega )\right) \), where \(\gamma _t\) denotes the tangential trace operator, we look for \(\textbf{E}\) and \(\textbf{H}\) such that

$$\begin{aligned} \nabla \times \textbf{E}&= i\,\omega \,\mu _0\, \textbf{H}, \hspace{1.4cm} \text {in} \quad \Omega , \end{aligned}$$
(1a)
$$\begin{aligned} \nabla \times \textbf{H}&= \textbf{J}-i\,\omega \,\epsilon _0\, \epsilon \,\textbf{E}, \hspace{0.71cm} \text {in} \quad \Omega , \end{aligned}$$
(1b)
$$\begin{aligned} \textbf{E} \times \textbf{n}&= \hat{\textbf{g}}, \hspace{2.4cm} \text {on} \quad \Gamma _{\textrm{B}} \cup \Gamma _{\textrm{T}}, \end{aligned}$$
(1c)
$$\begin{aligned} \textbf{E}(L,y,z)&= e^{i \alpha L} \textbf{E}(0,y,z),\hspace{0.71cm} y \in (0,L), z \in (0,M), \end{aligned}$$
(1d)
$$\begin{aligned} \textbf{E}(x,L,z)&= e^{i \beta L} \textbf{E}(x,0,z),\hspace{0.71cm} x\in (0,L), z \in (0,M), \end{aligned}$$
(1e)

where \(\textbf{E}\) denotes the electric field, \(\textbf{H}\) the magnetic field and \(\textbf{J}\) the current density, which satisfy an implicit \(e^{-i\omega t}\) dependence of time at frequency \(\omega > 0\). The other parameters are the permeability of free space \(\mu _0\), the electric permittivity of free space \(\epsilon _0\), the electric permittivity \(\epsilon \), the relative permittivity \(\epsilon _0 \epsilon \), the free-space wavenumber \(\kappa :=\omega \sqrt{\epsilon _0 \mu _0}\), the free-space wavelength \(\lambda _0:=2\pi /\kappa \) and the intrinsic impedance of the free space \(\eta _0:=\sqrt{\mu _0/\epsilon _0}\). Furthermore, \(\mu _0=4\pi \times 10^{-7}\) Hm\(^{-1}\), \(\epsilon _0=8.854 \times 10^{-12}\) Fm\(^{-1}\), \(\textbf{n}\) denotes the outward unit normal to \(\Gamma \) and the permittivity is defined as \(\epsilon =\epsilon _m\) in \(\Omega _m\) and \(\epsilon =\epsilon _d\) in \(\Omega _d\). According to the theory that appears in Section 1.3 of [35], the solutions of (1) exist and have the form of a plane wave. A plane wave is defined as an electromagnetic wave whose polarization, \(\textbf{A}\), satisfies the property \(\textbf{A}\cdot (\alpha , \beta , \gamma )=0\), for \(\alpha := \kappa \sin \theta \cos \phi \), \(\beta := \kappa \sin \theta \sin \phi \) and \(\gamma := \kappa \cos \theta \), with \(\theta \in [0, \pi ]\) and \(\phi \in [0, 2 \pi ]\). Based on the form of the solutions it is possible to characterize the quasi-periodic boundary conditions, which in this problem were added by the Eqs. (1d) and (1e).

Let us introduce in (1) the change of variable \(\textbf{u}:=\epsilon _0^{1/2}\textbf{E}\), \(\textbf{v}:=i \kappa \mu _0^{1/2} \textbf{H}\). By a Lagrange multiplier p, we impose the incompressibility condition \(\nabla \cdot (\epsilon \textbf{E})=0\), which can be deduced from the second equation. For a more detailed description of (1), we refer to [35]. Then, we obtain the following problem: Find \(\textbf{u}\), \(\textbf{v}\) and p such that

$$\begin{aligned} \textbf{v}-\nabla \times \textbf{u}&= 0, \hspace{2.5cm} \text {in} \ \Omega , \end{aligned}$$
(2a)
$$\begin{aligned} \nabla \times \textbf{v}-\kappa ^2 \epsilon \textbf{u} + \overline{\epsilon } \nabla p&= \textbf{f}, \hspace{2.5cm} \text {in} \ \Omega , \end{aligned}$$
(2b)
$$\begin{aligned} \nabla \cdot (\epsilon \textbf{u})&= 0,\hspace{2.5cm} \text {in} \ \Omega , \end{aligned}$$
(2c)
$$\begin{aligned} \textbf{u} \times \textbf{n}&= \textbf{g}, \hspace{2.5cm} \text {on} \ \ \Gamma _{\textrm{B}} \cup \Gamma _{\textrm{T}}, \end{aligned}$$
(2d)
$$\begin{aligned} \textbf{u}\left( L, y, z\right)&= e ^{i \alpha L} \textbf{u}\left( 0, y, z\right) ,\hspace{6mm} y \in (0,L), z \in (0,M), \end{aligned}$$
(2e)
$$\begin{aligned} \textbf{u}\left( x, L, z\right)&= e ^{i \beta L} \textbf{u}\left( x, 0, z\right) ,\hspace{6mm} {x} \in (0,L), z \in (0,M), \end{aligned}$$
(2f)
$$\begin{aligned} p&= 0, \hspace{2.5cm} \text {on } \Gamma , \end{aligned}$$
(2g)

where \(\textbf{f}:= i \kappa \mu _0^{1/2} \, \textbf{J}\), \(\textbf{g}:=\epsilon _0^{1/2}\hat{\textbf{g}}\) and \(\overline{\epsilon }\) is the complex conjugate of \(\epsilon \). In order to simplify notation, we define \(\Gamma _0:= \Gamma _{\textrm{B}} \cup \Gamma _{\textrm{T}}\) and \(\Gamma _{\textrm{QP}}:=\Gamma _1 \cup \Gamma _2\cup \Gamma _3\cup \Gamma _4\).

Now, let us introduce the spaces

$$\begin{aligned} \textrm{H}^{\textrm{QP}}(\textbf{curl};\Omega )&:= \left\{ \textbf{w} \in \textrm{H}(\textbf{curl};\Omega ):\hspace{1mm} \textbf{w} \mid _{\Gamma _2}=e^{i \alpha L} \textbf{w} \mid _{\Gamma _1}, \textbf{w} \mid _{\Gamma _4}=e^{i \beta L} \textbf{w} \mid _{\Gamma _3}\right\} , \\ \textrm{H}_{\Gamma _0}^{\textrm{QP}}(\textbf{curl};\Omega )&:= \left\{ \textbf{w} \in \textrm{H}^{\textrm{QP}}(\textbf{curl};\Omega ):\hspace{1mm} \textbf{w} \times \textbf{n}_{\mid _{\Gamma _0}}=0\right\} , \\ \textbf{X}_{\textrm{QP}}&:= \textrm{H}_{\Gamma _0}^{\textrm{QP}}(\textbf{curl};\Omega ) \cap \textrm{H}(\textrm{div}^0_{\epsilon };\Omega ), \\ \textbf{X}_{\textrm{QP}}^{\textbf{g}}&:= \left\{ \textbf{w} \in \textrm{H}^{\textrm{QP}}(\textbf{curl};\Omega ) \cap \textrm{H}(\textrm{div}^0_{\epsilon };\Omega ) : \textbf{w} \times \textbf{n}_{\mid _{\Gamma _0}}=\textbf{g} \right\} , \end{aligned}$$

endowed with the \(\textrm{H}(\textbf{curl};\Omega )\)-norm, \(\Vert \textbf{w}\Vert _{\textrm{H}(\textbf{curl};\Omega )}:= (\Vert \textbf{w}\Vert ^2_{\Omega } + \Vert \nabla \times \textbf{w}\Vert ^2_{\Omega })^{1/2}\). With respect to the existence and uniqueness of the solutions of (2), we have the following Lemma.

Lemma 1

If \(\kappa ^2 \epsilon _d\) is not an eigenvalue of \( \nabla \times \nabla \times \) in \(\Omega _d\), then (2) has a unique solution \((\textbf{v},\textbf{u},p) \in \textrm{H}(\textbf{curl};\Omega )\times \textbf{X}_{\textrm{QP}}^{\textbf{g}} \times \textrm{H}_0^1(\Omega )\).

Proof

By tailoring the proofs showed in Section 5 of [9], we can guarantee the existence of a unique solution, when \(\textbf{g}=\textbf{0}\), for the following variational formulation: Find \(( \textbf{u}, p) \in \textbf{X}_{\textrm{QP}} \times \textrm{H}_0^1(\Omega )\) such that

$$\begin{aligned} \begin{aligned} ( \nabla \times \textbf{u}, \nabla \times \textbf{w})_{\Omega }-\kappa ^2 (\epsilon \textbf{u}, \textbf{w})_{\Omega }&= ( \textbf{f}, \textbf{w})_{\Omega },\\ ( \overline{\epsilon } \, \nabla p, \nabla q)_{\Omega }&= (\textbf{f}, \nabla q)_{\Omega }, \end{aligned} \end{aligned}$$
(3)

for all \((\textbf{w},q) \in \textbf{X}_{\textrm{QP}} \times \textrm{H}_0^1(\Omega )\).

In the case \(\textbf{g} \ne \textbf{0}\), we have that if \(\textbf{g} \in \gamma _{t}(\textrm{H}(\textbf{curl};\Omega ) \cap \textrm{H}(\textrm{div}_{\epsilon }^0;\Omega ))\) then, there exists a unique \(\varvec{\varphi } \in \textrm{H}(\textbf{curl};\Omega ) \cap \textrm{H}(\textrm{div}_{\epsilon }^0;\Omega )\), such that \(\gamma _{t}\left( \varvec{\varphi }\right) =\textbf{g}\). Moreover, by noting that \(\textbf{u}-\varvec{\varphi } \in \textbf{X}_{\textrm{QP}}\) is a solution of (3), we can conclude the uniqueness of \(\textbf{u}\); from which the existence and uniquenes of the solution of (2) is deduced. \(\square \)

3 The HDG Method

Let us begin by setting a shape-regular simplicial tetrahedrization \(\mathcal {T}_h\) of \(\Omega \), such that each \(\overset{\circ }{K}\ \in \mathcal {T}_h\) is completely contained in \(\Omega _m\) or \(\Omega _d\). Then, \(\mathcal {T}_h^m\) and \(\mathcal {T}_h^d\) will denote the sets of tetrahedra lying in \(\Omega _m\) and \(\Omega _d\), respectively. Furthermore, we define \(\partial \mathcal {T}_h:= \left\{ \partial K: K \in \mathcal {T}_h\right\} \) and \(\mathcal {E}_h:= \mathcal {E}_{I} \cup \mathcal {E}_{\Gamma }\), where \( \mathcal {E}_{I}\) and \(\mathcal {E}_{\Gamma }\) denote the interior and boundary faces induced by \(\mathcal {T}_h\), respectively. Due to the definition of \(\Gamma \), we will denote by \(\mathcal {E}_0\) and \(\mathcal {E}_{\textrm{QP}}\) the set of faces lying on \(\Gamma _0\) and \(\Gamma _{\textrm{QP}}\), respectively. We assume \(\mathcal {T}_h\) does not have hanging nodes. Moreover, let us also suppose conformity between the discretization of the periodic boundaries \(\Gamma _1\)-\(\Gamma _2\) and \(\Gamma _3\)-\(\Gamma _4\). More precisely, if \(F_1=\{(0,y,z)\}\) is a face of \(\Gamma _1\), we assume that \(F_2:=\{(L,y,z)\}\) is a face of \(\Gamma _2\). Similarly for \(\Gamma _3\) and \(\Gamma _4\). In addition, we set \(\Vert \cdot \Vert _{\mathcal {T}_h}:=(\cdot ,\cdot )_{\mathcal {T}_h}^{1/2}\) and \(\Vert \cdot \Vert _{\partial \mathcal {T}_h}:=\langle \cdot ,\cdot \rangle _{\partial \mathcal {T}_h}^{1/2}\), with

$$\begin{aligned} \displaystyle \left( \cdot ,\cdot \right) _{\mathcal {T}_h}:= \sum _{K \in \mathcal {T}_h} \left( \cdot ,\cdot \right) _K, \hspace{4mm} \displaystyle \langle \cdot ,\cdot \rangle _{\partial \mathcal {T}_h}:= \sum _{K \in \mathcal {T}_h} \langle \cdot ,\cdot \rangle _{\partial K}, \end{aligned}$$

where \((\cdot ,\cdot )_D\) and \(\langle \cdot ,\cdot \rangle _{G}\) denote standard \(\textrm{L}^2\)-complex inner products over regions \(D\subset \mathbb {R}^3\) and \(G\subset \mathbb {R}^2\), respectively.

For a vector-valued function \(\textbf{w}\), we define the tangential jump across \(F \in \mathcal {E}_I\) by \(\llbracket \textbf{w}\rrbracket _F:=\textbf{w}^+ \times \textbf{n}^+ + \textbf{w}^- \times \textbf{n}^-\). If \(F\in \mathcal {E}_0\), we set \(\llbracket \textbf{w}\rrbracket _F:=\textbf{w} \times \textbf{n}\). We will drop the subscript F, when there is no confusion. Let us now explain the jump operator acting on a face of a quasi-periodic boundary. If \(F \subset \Gamma _1\), we define \(\llbracket \textbf{w}\rrbracket _{\textrm{QP}}:=(e^{i\alpha L}\textbf{w} \times \textbf{n})\mid _{\Gamma _1} +( \textbf{w} \times \textbf{n})\mid _{\Gamma _2}\). In other words, if \(\textbf{w}\) is quasi-periodic on \(\Gamma _1\), then \(\llbracket \textbf{w}\rrbracket _{\textrm{QP}}=0\). Similarly, if \(F \subset \Gamma _3\), we define \(\llbracket \textbf{w}\rrbracket _{\textrm{QP}}:=(e^{i\beta L}\textbf{w} \times \textbf{n})\mid _{\Gamma _3} +( \textbf{w} \times \textbf{n})\mid _{\Gamma _4}\). For a scalar-valued function p, the jump across a face \(F \in \mathcal {E}_I\) is denoted by \(\llbracket q\rrbracket :=q^+-q^-\), whereas for a boundary face \(F \in \mathcal {E}_\Gamma \), we write \(\llbracket q\rrbracket :=q\).

Considering the above tetrahedrization of \(\overline{\Omega }\), we define the following approximation spaces

$$\begin{aligned} \textrm{Q}_h&:= \big \{q \in \textrm{L}^2(\Omega ) : q \mid _K \, \in \mathbb {P}_k(K), \,\forall \, \, K \in \mathcal {T}_h\big \},\\ \textrm{M}_h&:= \big \{\varrho \in \textrm{L}^2 (\mathcal {E}_h) : \varrho \mid _F \, \in \mathbb {P}_k(F), \,\forall \, \, F \in \mathcal {E}_h\big \},\\ \textbf{V}_h&:= \big \{\textbf{w} \in \textbf{L}^2(\Omega ) : \textbf{w}\mid _K \, \in \textbf{P}_k(K), \,\forall \, \, K \in \mathcal {T}_h\big \},\\ \mathrm {\textbf{M}}_h^t&:= \big \{\varvec{\rho } \in \textbf{L}^2\left( \mathcal {E}_h\right) : \varvec{\rho }\mid _F \, \in \textbf{P}_k(F), (\varvec{\rho }\cdot \textbf{n})\mid _F \,=0, \,\forall \, \, F \in \mathcal {E}_h\big \},\\ \mathrm {\textbf{M}}_{\textrm{QP}}^{\textbf{g}}&:= \left\{ \varvec{\rho } \in \mathrm {\textbf{M}}_h^t\ :\ \varvec{\rho }_{\mid _{\Gamma _2}}=e^{i \alpha L} \varvec{\rho }_{\mid _{\Gamma _1}},\ \varvec{\rho }_{\mid _{\Gamma _4}}=e^{i \beta L} \varvec{\rho }_{\mid _{\Gamma _3}},\ \varvec{\rho }_{\mid _{\Gamma _0}}\times \textbf{n}=\textrm{P}_{\textbf{M}_h^t}\textbf{g} \right\} \end{aligned}$$

where \(\textrm{P}_{\textbf{M}_h^t}\) is \(\textbf{L}^2\)-projections over \(\textbf{M}_h^t\).

The HDG scheme associated to (2) seeks the approximation \((\textbf{v}_h, \textbf{u}_h, p_h, \widehat{\textbf{u}}_h^t, \widehat{p}_h) \in \textbf{V}_h \times \textbf{V}_h \times \textrm{Q}_h \times \mathrm {\textbf{M}}_{\textrm{QP}}^{\textbf{g}} \times \textrm{M}_h\) of the exact solution \((\textbf{v}, \textbf{u}, p, \textbf{u}^t\vert _{\mathcal {E}_h}, p\vert _{\mathcal {E}_h})\), satisfying

$$\begin{aligned}&\left( \textbf{v}_h, \textbf{w}\right) _{\mathcal {T}_h}-\left( \textbf{u}_h, \nabla \times \textbf{w}\right) _{\mathcal {T}_h} - \left\langle \widehat{\textbf{u}}_h^t, \textbf{w}\times \textbf{n}\right\rangle _{\partial \mathcal {T}_h} =0, \end{aligned}$$
(4a)
$$\begin{aligned}&\left( \textbf{v}_h, \nabla \times \textbf{z}\right) _{\mathcal {T}_h} + \left\langle \widehat{\textbf{v}}_h^t,\textbf{z}\times \textbf{n}\right\rangle _{\partial \mathcal {T}_h} - \kappa ^2 \left( \epsilon \textbf{u}_h, \textbf{z}\right) _{\mathcal {T}_h} - \left( p_h, \nabla \cdot \left( \epsilon \textbf{z}\right) \right) _{\mathcal {T}_h}\nonumber \\&\quad + \left\langle \widehat{p}_h, \epsilon \textbf{z}\cdot \textbf{n}\right\rangle _{\partial \mathcal {T}_h} =\left( \textbf{f},\textbf{z}\right) _{\mathcal {T}_h}, \end{aligned}$$
(4b)
$$\begin{aligned}&\quad - \left( \epsilon \, \textbf{u}_h, \nabla q\right) _{\mathcal {T}_h}+ \langle \widehat{\epsilon \, \textbf{u}^n_h}\cdot \textbf{n}, q\rangle _{\partial \mathcal {T}_h} =0, \end{aligned}$$
(4c)
$$\begin{aligned}&\quad \left\langle \textbf{n}\times \widehat{\textbf{v}}_h^t, \varvec{\rho } \right\rangle _{\partial \mathcal {T}_h} =0, \end{aligned}$$
(4d)
$$\begin{aligned}&\langle \widehat{\epsilon \, \textbf{u}^n_h}\cdot \textbf{n}, \varrho \rangle _{\partial \mathcal {T}_h \setminus \, \Gamma } =0 , \end{aligned}$$
(4e)
$$\begin{aligned}&\quad \left\langle \widehat{p}_h, \varrho \right\rangle _{\Gamma } =0, \end{aligned}$$
(4f)

for all \((\textbf{w}, \textbf{z}, q, \varvec{\rho }, \varrho ) \in \textbf{V}_h \times \textbf{V}_h \times \textrm{Q}_h \times \mathrm {\textbf{M}}_{\textrm{QP}}^{\textbf{0}} \times \textrm{M}_h\), where the numerical fluxes \(\widehat{\textbf{v}}_h^t\) and \(\widehat{\epsilon \textbf{u}_h^n}\) defined on \(\partial \mathcal {T}_h\) are given by

$$\begin{aligned} \textbf{n} \times \widehat{\textbf{v}}_h^t&:= \textbf{n} \times \textbf{v}_h^t + \tau (\textbf{u}_h^t-\widehat{\textbf{u}}_h^t), \end{aligned}$$
(4g)
$$\begin{aligned} \widehat{\epsilon \textbf{u}_h^n}\cdot \textbf{n}&:= \epsilon \textbf{u}_h^n\cdot \textbf{n} + \tau _n (p_h-\widehat{p}_h). \end{aligned}$$
(4h)

The stabilization parameters \(\tau \) and \(\tau _n\) are complex-valued that satisfy \(\textrm{Re}(\tau )\ge 0\), \(\textrm{Im}(\tau )\le 0\), \(\textrm{Re}(\tau _n)\ge 0\) and \(\textrm{Im}(\tau _n)\ge 0\). These conditions ensure well-posedness of the scheme in agreement with Section 3 of [10].

We notice that, since the test function \(\varvec{\rho }\) belongs to \(\mathrm {\textbf{M}}_{\textrm{QP}}^{\textbf{0}}\), (4d) implies the quasi-periodicity of the numerical flux \(\widehat{\textbf{v}}_h^t\). In fact, taking \(\varvec{\rho } \ne 0\) on \(\Gamma _1 \cup \Gamma _2\) and \(\varvec{\rho }=0\) otherwise, we have that

$$\begin{aligned} \left\langle \textbf{n}\times \widehat{\textbf{v}}_h^t, \varvec{\rho } \right\rangle _{\Gamma _1}+ \left\langle \textbf{n}\times \widehat{\textbf{v}}_h^t, \varvec{\rho } \right\rangle _{\Gamma _2}&= 0, \end{aligned}$$

for all \(\varvec{\rho } \in \textbf{P}_k(\Gamma _1)\), due to the fact that \(\varvec{\rho }_{\mid _{\Gamma _2}}=e^{i \alpha L} \varvec{\rho }_{\mid _{\Gamma _1}}\). Now, if we denote by \(\varphi \) the bijective mapping that transforms a face in \(\Gamma _2\) into its corresponding face in \(\Gamma _1\), it holds

$$\begin{aligned} 0&= \left\langle \textbf{n}\times \widehat{\textbf{v}}_h^t, \varvec{\rho } \right\rangle _{\Gamma _1}+ \left\langle (\textbf{n}\times \widehat{\textbf{v}}_h^t) \circ \varphi , e^{i \alpha L} \varvec{\rho }\right\rangle _{\Gamma _1}=\left\langle \textbf{n}\times \widehat{\textbf{v}}_h^t+ (\textbf{n}\times \widehat{\textbf{v}}_h^t) \circ \varphi e^{-i \alpha L}, \varvec{\rho } \right\rangle _{\Gamma _1}, \end{aligned}$$

for all \(\varvec{\rho } \in \textbf{P}_k(\Gamma _1)\), from which,

$$\begin{aligned} 0=(\textbf{n}\times \widehat{\textbf{v}}_h^t+ (\textbf{n}\times \widehat{\textbf{v}}_h^t) \circ \varphi e^{-i \alpha L})\vert _{\Gamma _1}=\textbf{n}\times \widehat{\textbf{v}}_h^t\vert _{\Gamma _1}+ \textbf{n}\times \widehat{\textbf{v}}_h^te^{-i \alpha L} \vert _{\Gamma _2}. \end{aligned}$$

Remark 1

We emphasize that \(\widehat{\textbf{u}}_h^t\) and \(\widehat{\textbf{v}}_h^t\) are “single-valued” on any face \(F \in \mathcal {E}_h{\setminus } \mathcal {E}_{\textrm{QP}}\). Moreover, for faces in \(\mathcal {E}_{\textrm{QP}}\), the numerical fluxes are also single-valued, but in a “quasi-periodic sense”, namely, \(\llbracket \widehat{\textbf{u}}_h^t\rrbracket _{\textrm{QP}}=0\) and \(\llbracket \widehat{\textbf{v}}_h^t\rrbracket _{\textrm{QP}}=0\).

The authors in [10] analyzed the well-posedness and provided the error estimates for an HDG scheme similar to (4), but considered a prescribed boundary data \(\textbf{g}\) in the entire boundary \(\Gamma \). In our case, quasi-periodic boundary conditions are imposed on the vertical walls. This quasi-periodicity is imposed strongly on the space \(\mathrm {\textbf{M}}_{\textrm{QP}}^{\textbf{g}}\) for the numerical trace \(\widehat{\textbf{u}}_h^t\) and implies the quasi-periodicity of the flux \(\widehat{\textbf{v}}_h^t\), as it was explained before. These facts make possible to cancel out the contribution of the terms on \(\Gamma _1\) and \(\Gamma _2\) (\(\Gamma _3\) and \(\Gamma _4\)), during the deduction of the stability estimates of the scheme. Therefore, the same error analysis performed in [10] holds for (4). Even more, the analysis in it implies the following result for \(s \in (0, 1)\) and \(s \le t\) chosen as in section 3.2 of the same reference.

Corollary 1

Let \(\left( \textbf{v}, \textbf{u}, p\right) \in \textbf{H}^{l_{\textbf{u}}+1}(\mathcal {T}_h) \times \textbf{H}^{l_{\textbf{v}}+1}(\mathcal {T}_h) \times \textrm{H}^{l_{p}+1}(\mathcal {T}_h)\) and \(\left( \textbf{v}_h,\textbf{u}_h, p_h, \widehat{\textbf{u}}_h^t, \widehat{p}_h\right) \in \textbf{V}_h \times \textbf{V}_h \times \textrm{Q}_h \times \mathrm {\textbf{M}}_{\textrm{QP}}^{\textbf{g}} \times \textrm{M}_h\) be the solutions of (2) and (4), respectively, for \(l_{\textbf{v}}, l_{\textbf{u}}, l_p \in \left[ 0, k\right] \). If \(\tau \) and \(\tau _n\) are purely imaginary, \(s \in (0, 1)\) and \(s \le t\), there hold

$$\begin{aligned}&\Vert \textbf{v}-\textbf{v}_h \Vert _{\mathcal {T}_h} \lesssim \,h^{\min \{s,1/2\}}\left( h^{l_\textbf{v}}|\textbf{v}|_{l_\textbf{v}+1,\mathcal {T}_h} +h^{l_\textbf{u}}|\textbf{u}|_{l_\textbf{u}+1,\mathcal {T}_h} +h^{l_p}|p|_{l_p+1,\mathcal {T}_h}\right) \\&\quad \Vert \epsilon (\textbf{u}-\textbf{u}_h) \Vert _{\mathcal {T}_h} \lesssim \,h^s\left( h^{l_\textbf{v}}|\textbf{v}|_{l_\textbf{v}+1,\mathcal {T}_h} +h^{l_\textbf{u}}|\textbf{u}|_{l_\textbf{u}+1,\mathcal {T}_h} +h^{l_p}|p|_{l_p+1,\mathcal {T}_h}\right) , \end{aligned}$$

when \(|\tau |\) and \(|\tau _n|\) are of order one. If \(|\tau |\) is of order \(h^{-1}\) and \(|\tau _n|\) is of order h, then

$$\begin{aligned} \Vert \textbf{v}-\textbf{v}_h \Vert _{\mathcal {T}_h}&\lesssim h^{l_{\textbf{v}}+\min \{1,t\}} |\textbf{v}|_{ l_\textbf{v}+1,\mathcal {T}_h} +h^{l_{ \textbf{u}}+\min \{0,t-1\}} |\textbf{u}|_{ l_\textbf{u}+1,\mathcal {T}_h} + h^{l_p+\min \{s+1,t\}} \left| p\right| _{l_p+1, \, \mathcal {T}_h}\\ \Vert \epsilon (\textbf{u}-\textbf{u}_h) \Vert _{\mathcal {T}_h}&\lesssim \, h^{l_{\textbf{v}}+\min \{1,t\}} |\textbf{v}|_{ l_\textbf{v}+1,\mathcal {T}_h} +h^{l_{ \textbf{u}}+\min \{s,t-1\}} |\textbf{u}|_{ l_\textbf{u}+1,\mathcal {T}_h} + h^{l_p+1+\min \{s,t-1\}} \left| p\right| _{l_p+1, \mathcal {T}_h}. \end{aligned}$$

In addition, if \(\tau \) and \(\tau _n\) are not purely imaginary, then there exists \(h_0>0\) such that for all \(h<h_0\), the same result holds.

Remark 2

The numerical experiments reported in [10] show an experimental order of convergence better than the one predicted by the theory. More precisely, for smooth solutions and stabilization parameters with modulus proportional to one, the experimental rate of convergence is \(h^{k+1}\) for the \(\textrm{L}^2\)-error of the approximations of \(\varvec{u}\), \(\varvec{v}\) and p.

4 A Posteriori error analysis

In this section assuming that \(|\tau |\) and \(|\tau _n|\) with modulus proportional to one, we propose ‘under some circumstances’ a reliable and locally efficient error estimator for the energy-type error

$$\begin{aligned} E_h:= & {} \Vert \textbf{v}-\textbf{v}_h\Vert _{\mathcal {T}_h} + \Vert \nabla \times (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h} + h^{-1/2} \nonumber \\ {}{} & {} \Vert \tau ^{1/2} (\textbf{u}_h^t-\widehat{\textbf{u}}_h^t)\Vert _{\partial \mathcal {T}_h} \nonumber \\{} & {} + h^{-1/2} \Vert \tau _n^{1/2} (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h} + \Vert \nabla (p-p_h)\Vert _{\mathcal {T}_h} +\Vert \textbf{u}-\textbf{u}_h \nonumber \\ {}{} & {} \Vert _{\mathcal {T}_h} + \Vert p-p_h\Vert _{\mathcal {T}_h}.\nonumber \\ \end{aligned}$$
(5)

According to Remark 2, the order of convergence of \(E_h\) is \(h^{k}\) when the solution is sufficiently smooth.

We base our analysis on the techniques presented in [13], but keeping in mind that, in our context \(\Omega \) is occupied by an heterogeneous material because the relative permittivity is a complex-valued function.

Let us begin by defining the global error indicator:

$$\begin{aligned} \eta := \sum _{K \in \mathcal {T}_h} \left( \eta _K^2 + \sum _{F \subset \partial K} \eta _{F,1}^2 + \eta _{F,2}^2 + \eta _{F,3}^2 \right) + \sum _{F \in \mathcal {E}_I} \eta _{F,4}^2, \end{aligned}$$

where \(\eta _K\), \(\eta _{F,1}\), \(\eta _{F,2}\), \(\eta _{F,3}\) and \(\eta _{F,4}\) correspond to the local a posteriori error indicators, specified as follows.

For each \(K \in \mathcal {T}_h\),

$$\begin{aligned} \eta _{K,1}&:= h_K \Vert \textbf{f}-\overline{\epsilon } \nabla p_h + \kappa ^2 \epsilon \textbf{u}_h-\nabla \times (\nabla \times \textbf{u}_h)\Vert _K, \end{aligned}$$
(6a)
$$\begin{aligned} \eta _{K,2}&:= h_K \Vert \nabla \cdot \textbf{f} + \kappa ^2 \epsilon \nabla \cdot \textbf{u}_h-\nabla \cdot (\overline{\epsilon } \, \nabla p_h)\Vert _K, \end{aligned}$$
(6b)

and for \( F\subset \partial K\),

$$\begin{aligned} \eta _{F,1}&:= h_F^{-1/2} \Vert \tau ^{1/2} (\textbf{u}_h-\widehat{\textbf{u}}_h^t) \times \textbf{n} \Vert _F, \end{aligned}$$
(6c)
$$\begin{aligned} \eta _{F,2}&:= h_F^{-1/2} \Vert \tau _n^{1/2} (p_h-\widehat{p}_h)\Vert _F, \end{aligned}$$
(6d)
$$\begin{aligned} \eta _{F,3}&:= h_F^{1/2} \Vert (\textbf{v}_h-\nabla \times \textbf{u}_h) \times \textbf{n}\Vert _F. \end{aligned}$$
(6e)

Moreover, for each \(F \in \mathcal {E}_I\),

(6f)

In order to state the main result, we denote by \(\Pi _{\textbf{V}}\) and \(\Pi _\textrm{Q}\) the \(\textrm{L}^2\)-projections over \(\textbf{V}_h \) and \(\textrm{Q}_h\), see [18].

Theorem 1

Let \(\left( \textbf{v}, \textbf{u}, p\right) \in \textrm{H}(\textbf{curl};\Omega ) \times \textbf{X}_{\textrm{QP}}^{\textbf{g}} \times \textrm{H}_0^1(\Omega )\) and \((\textbf{v}_h, \textbf{u}_h, p_h, \widehat{\textbf{u}}_h^t, \widehat{p}_h) \in \textbf{V}_h \times \textbf{V}_h \times \textrm{Q}_h \times \mathrm {\textbf{M}}_{\textrm{QP}}^{\textbf{g}} \times \textrm{M}_h\) be the solutions of (2) and (4), respectively. Then, there exist \(C_1, C_2 > 0\) such that

$$\begin{aligned} E_h \le C_1 \eta \qquad \wedge \qquad C_2 \eta \le E_h + \textrm{osc}_{\textbf{f}} + \textrm{osc}_{\nabla \cdot \textbf{f}}, \end{aligned}$$

where \(\textrm{osc}_{\textbf{f}}:= \displaystyle \sum _{K \in \mathcal {T}_h} \textrm{osc} (\textbf{f},K)\), \(\textrm{osc} (\textbf{f},K):=h_K \Vert \textbf{f}-\Pi _{\textbf{V}} \textbf{f}\Vert _K\), \(\textrm{osc}_{\nabla \cdot \textbf{f}}:= \displaystyle \sum _{K \in \mathcal {T}_h} \textrm{osc} (\nabla \cdot \textbf{f},K)\) and \(\textrm{osc} (\nabla \cdot \textbf{f},K):=h_K \Vert \nabla \cdot \textbf{f}-\Pi _{\textrm{Q}} (\nabla \cdot \textbf{f})\Vert _K\).

In the forthcoming sections we will derive a sequence of results that will lead to the proof of Theorem 1. We will employ approximation properties for discontinuous functions and bubble functions.

4.1 Reliability

One of the main tools, usually employed in the context of DG methods is the conforming approximation of a piecewise polynomial function. In this direction, we obtained the following lemmas by using Proposition 4.5 of [25] and Theorem 2.2 of [29].

Lemma 2

Let \(\textbf{w} \in \textbf{V}_h\) and \(\widetilde{\textbf{g}}\) be the tangential trace of a function in \(\textbf{V}_h^c:= \textbf{V}_h \cap \textrm{H}({\textbf{curl}};\Omega )\). Then, there exists \(\textbf{w}^c \in \textbf{V}_h^c\) with \(\textbf{w}^c\times \textbf{n}\vert _{\Gamma _0}=\widetilde{\textbf{g}}\), such that

$$\begin{aligned} \Vert \textbf{w}-\textbf{w}^c\Vert _{\mathcal {T}_h}&\lesssim \Vert h^{1/2} \llbracket \textbf{w} \rrbracket \Vert _{\mathcal {E}_h\setminus \mathcal {E}_0} +\Vert h^{1/2} (\textbf{w} \times \textbf{n} -\widetilde{\textbf{g}}) \Vert _{\mathcal {E}_0}, \end{aligned}$$
(7a)
$$\begin{aligned} \Vert \nabla \times (\textbf{w}-\textbf{w}^c)\Vert _{\mathcal {T}_h}&\lesssim \Vert h^{-1/2} \llbracket \textbf{w} \rrbracket \Vert _{ \mathcal {E}_h \setminus \mathcal {E}_0} + \Vert h^{-1/2} (\textbf{w} \times \textbf{n} -\widetilde{\textbf{g}}) \Vert _{\mathcal {E}_0}. \end{aligned}$$
(7b)

Moreover, there exists \(\textbf{w}^{\textrm{QP}} \in \textbf{V}_h^c\) with tangential trace \(\widetilde{\textbf{g}}\) on \(\Gamma _0\) and quasi-periodic conditions on \(\Gamma _{\textrm{QP}}\), such that

(7c)
(7d)

In addition, let \(q \in \textrm{Q}_h\). There exists \(q^c \in \textrm{Q}_h^c:=\textrm{Q}_h \cap \textrm{H}_0^1(\Omega )\), such that

$$\begin{aligned} \Vert \nabla (q-q^c)\Vert _{\mathcal {T}_h}&\lesssim \Vert h^{-1/2} \llbracket q\rrbracket \Vert _{\mathcal {E}_I} \lesssim \Vert h^{-1/2} (q-\varrho )\Vert _{\partial \mathcal {T}_h}, \end{aligned}$$
(7e)

for any singled-valued function \(\varrho \) defined over \(\mathcal {E}_h\), such and \(\varrho \vert _{\Gamma }=0\).

The estimates (7a) and (7b) were proven in Proposition 4.5 of [25], whereas the proof of (7e) can be found in Theorem 2.2 of [29]. The results in (7c) and (7d) are consequence of (7a) and its proof will be postponed to the appendix (Appendix A.2).

In addition, we will employ the Scott-Zhang interpolant \(\Pi _{\textrm{SZ}}:\textrm{H}_{\vartheta }^1(\Omega )\rightarrow \textrm{Q}_h\cap \textrm{H}_{\vartheta }^1(\Omega )\), where \(\textrm{H}_{\vartheta }^1(\Omega ):=\{\phi \in \textrm{H}^1(\Omega )\,:\,\phi \vert _\vartheta =0 \}\) with \(\vartheta \subseteq \Gamma \). Note that if \(\phi \in \textrm{H}_0^1(\Omega )\) then \(\Pi _{\textrm{SZ}}\phi \in \textrm{Q}_h^c\). In the literature, it is known that it satisfies the following approximation properties [cf. [44]].

Lemma 3

Let \(K\in \mathcal {T}_h\) and \(F\in \mathcal {E}_h\). For any \(\phi \in \textrm{H}_{\vartheta }^1(\Omega )\), there hold

$$\begin{aligned} \Vert \phi -\Pi _{\textrm{SZ}} \phi \Vert _K\lesssim h_K |\phi |_{1,\omega _K},\\ \Vert \phi -\Pi _{\textrm{SZ}} \phi \Vert _F\lesssim h_F^{1/2} |\phi |_{1,\omega _F}, \end{aligned}$$

where \(\omega _K:=\cup \{K^\prime \in \mathcal {T}_h: \overline{K^\prime } \cap \overline{K} \ne \emptyset \}\) and \(\omega _F:=\cup \{K^\prime \in \mathcal {T}_h: \overline{K^\prime } \cap \overline{F} \ne \emptyset \}\).

Now, we are in position to prove an upper bound for the \(\textrm{L}^2\) and broken \(\textrm{H}^1\)- error on the pressure. As we will see, this bound depends on some of the terms of the error estimator and also on the \(\textrm{L}^2\)-error of the electric field. For the sake of simplicity in the exposition, from now on we assume that \(\textbf{g}\) is the tangential trace of a function in \(\textbf{V}_h^c \). Otherwise, oscillatory terms related to \(\textbf{g}\) would appear.

Lemma 4

For \((\textbf{v}, \textbf{u}, p) \in \textrm{H}({\textbf{curl}};\Omega ) \times \textbf{X}_{\textrm{QP}}^{\textbf{g}} \times \textrm{H}_0^1(\Omega )\) and \((\textbf{v}_h, \textbf{u}_h, p_h, \widehat{\textbf{u}}_h^t, \widehat{p}_h) \in \textbf{V}_h \times \textbf{V}_h \times \textrm{Q}_h \times \mathrm {\textbf{M}}_{\textrm{QP}}^{\textbf{g}} \times \textrm{M}_h\) the solutions of (2) and (4), respectively, there hold

$$\begin{aligned} \Vert p-p_h\Vert _{\mathcal {T}_h}&\lesssim \Vert \nabla (p-p_h)\Vert _{\mathcal {T}_h} + \Vert h^{-1/2} \, (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h}, \end{aligned}$$
(8a)
$$\begin{aligned} \Vert \nabla (p-p_h)\Vert _{\mathcal {T}_h}&\lesssim \sum _{K \in \mathcal {T}_h} \eta _{K,2} + \sum _{F \in \mathcal {E}_I} \eta _{F,4} + \kappa ^2 \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h} + \Vert h^{-1/2} (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h}. \end{aligned}$$
(8b)

Proof

By the discrete Poincaré inequality ( [18], Corollary \(5\text{. }4\)) and the fact that \(\widehat{p}_h\) is single-valued and vanishes at the boundary, we have that

from which (8a) follows. Now, in order to bound \(\Vert \nabla (p-p_h)\Vert _{\mathcal {T}_h}\), we employ the result in Lemma 2. More precisely, for \(p_h\in \textrm{Q}_h\) there exists \(p_h^c \in \textrm{Q}_h^c\) such that

$$\begin{aligned} \Vert \nabla (p_h-p_h^c)\Vert _{\mathcal {T}_h} \lesssim \Vert h^{-1/2} (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h}. \end{aligned}$$
(9)

On the other hand, by substituting \(\textbf{f}\) [cf. (2b)] in (4b) we obtain the next error equation

$$\begin{aligned} (\textbf{v}-\textbf{v}_h, \nabla \times \textbf{z})_{\mathcal {T}_h}{} & {} + \langle \textbf{v}^t-\widehat{\textbf{v}}_h^t, \textbf{z} \times \textbf{n}\rangle _{\partial \mathcal {T}_h} - \kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \textbf{z})_{\mathcal {T}_h}\nonumber \\{} & {} + (\overline{\epsilon } \nabla (p-p_h), \textbf{z})_{\mathcal {T}_h} + \langle p_h-\widehat{p}_h, \epsilon \textbf{z}\cdot \textbf{n} \rangle _{\partial \mathcal {T}_h}=0 \nonumber \\{} & {} \quad \quad \forall \textbf{z}\in \textbf{V}_h. \end{aligned}$$
(10)

Let \(\phi := p-p_h^c \in \textrm{H}_0^1(\Omega )\), by taking \(\textbf{z}:= \nabla \Pi _{\textrm{SZ}} \phi \) in (10), it follows that

$$\begin{aligned} - \kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \nabla \Pi _{\textrm{SZ}} \phi )_{\mathcal {T}_h} + (\overline{\epsilon } \nabla (p-p_h), \nabla \Pi _{\textrm{SZ}} \phi )_{\mathcal {T}_h} + \langle p_h-\widehat{p}_h,\epsilon \nabla \Pi _{\textrm{SZ}} \phi \cdot \textbf{n} \rangle _{\partial \mathcal {T}_h}=0, \end{aligned}$$

since \(\nabla \times \nabla \Pi _{\textrm{SZ}} \phi =0\) and \(\langle \textbf{v}^t-\widehat{\textbf{v}}_h^t, \nabla \Pi _{\textrm{SZ}} \phi \times \textbf{n}\rangle _{\partial \mathcal {T}_h}=0\). Then, if we rewrite \((\nabla (p-p_h), \epsilon \nabla \phi )_{\mathcal {T}_h}\) by using the above expression and the Green’s identity of \(\textrm{H}(\textrm{div}_{\epsilon };\mathcal {T}_h)\), we obtain that

$$\begin{aligned} (\nabla (p-p_h), \epsilon \nabla \phi )_{\mathcal {T}_h}&= (\nabla (p-p_h), \epsilon \nabla (\phi -\Pi _{\textrm{SZ}} \phi ))_{\mathcal {T}_h} \\ {}&+(\nabla (p-p_h), \epsilon \nabla \Pi _{\textrm{SZ}} \phi )_{\mathcal {T}_h}\\ {}&= (\nabla (p-p_h), \epsilon \nabla (\phi -\Pi _{\textrm{SZ}} \phi ))_{\mathcal {T}_h}\\&+\kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \nabla \Pi _{\textrm{SZ}} \phi )_{\mathcal {T}_h}\\ {}&-\langle p_h-\widehat{p}_h, \epsilon \nabla \Pi _{\textrm{SZ}} \phi \cdot \textbf{n} \rangle _{\partial \mathcal {T}_h}\\ {}&= -(\nabla \cdot (\overline{\epsilon } \nabla (p-p_h)), \phi -\Pi _{\textrm{SZ}} \phi )_{\mathcal {T}_h}\\ {}&+ \langle \overline{\epsilon } \nabla (p-p_h)\cdot \textbf{n}, \phi -\Pi _{\textrm{SZ}} \phi \rangle _{\partial \mathcal {T}_h}\\ {}&-\kappa ^2 (\nabla \cdot (\epsilon (\textbf{u}-\textbf{u}_h)), \Pi _{\textrm{SZ}} \phi )_{\mathcal {T}_h}\\&+\kappa ^2 \langle \epsilon (\textbf{u}-\textbf{u}_h)\cdot \textbf{n}, \Pi _{\textrm{SZ}} \phi \rangle _{\partial \mathcal {T}_h}\\ {}&-\langle \overline{\epsilon }(p_h-\widehat{p}_h), \nabla \Pi _{\textrm{SZ}}\phi \cdot \textbf{n} \rangle _{\partial \mathcal {T}_h}. \end{aligned}$$

Moreover, by Eq. (2b), we deduce that

$$\begin{aligned} (\nabla (p-p_h), \epsilon \nabla \phi )_{\mathcal {T}_h}&= (\nabla \cdot \textbf{f} + \kappa ^2 \nabla \cdot (\epsilon \textbf{u}_h)-\nabla \cdot (\overline{\epsilon } \nabla p_h), \Pi _{\textrm{SZ}} \phi -\phi )_{\mathcal {T}_h}\nonumber \\ {}&\qquad + \langle \overline{\epsilon } \nabla (p-p_h)\cdot \textbf{n}, \phi -\Pi _{\textrm{SZ}} \phi \rangle _{\partial \mathcal {T}_h}\nonumber \\&\qquad - \kappa ^2 (\nabla \cdot \epsilon (\textbf{u}-\textbf{u}_h), \phi )_{\mathcal {T}_h}\nonumber \\ {}&\qquad + \kappa ^2 \langle \epsilon (\textbf{u}-\textbf{u}_h)\cdot \textbf{n}, \Pi _{\textrm{SZ}} \phi -\phi \rangle _{\partial \mathcal {T}_h}\nonumber \\ {}&\qquad + \kappa ^2 \langle \epsilon (\textbf{u}-\textbf{u}_h)\cdot \textbf{n}, \phi \rangle _{\partial \mathcal {T}_h} - \langle \overline{\epsilon }(p_h-\widehat{p}_h), \nabla \Pi _{\textrm{SZ}} \phi \cdot \textbf{n} ,\rangle _{\partial \mathcal {T}_h}\nonumber \\&= (\nabla \cdot \textbf{f} + \kappa ^2 \nabla \cdot (\epsilon \textbf{u}_h) -\nabla \cdot (\overline{\epsilon } \nabla p_h), \Pi _{\textrm{SZ}} \phi -\phi )_{\mathcal {T}_h}\nonumber \\ {}&\qquad + \langle \overline{\epsilon } \nabla (p-p_h)\cdot \textbf{n}, \phi -\Pi _{\textrm{SZ}} \phi \rangle _{\partial \mathcal {T}_h} + \kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \nabla \phi )_{\mathcal {T}_h}\nonumber \\&\qquad + \kappa ^2 \langle \epsilon (\textbf{u}-\textbf{u}_h)\cdot \textbf{n}, \Pi _{\textrm{SZ}} \phi -\phi \rangle _{\partial \mathcal {T}_h} -\langle \overline{\epsilon }(p_h-\widehat{p}_h),\nonumber \\ {}&\qquad \nabla \Pi _{\textrm{SZ}} \phi \cdot \textbf{n}-\nabla \Pi _{\textrm{Q}}^0 \phi \cdot \textbf{n} \rangle _{\partial \mathcal {T}_h}, \end{aligned}$$
(11)

where \(\Pi _{\textrm{Q}}^0\) is the \(\textrm{L}^2\)-projection over \(\mathbb {P}_0(\mathcal {T}_h)\).

Now, let us bound each term on the right hand side of (11). We apply the Cauchy-Schwarz inequality, the approximation properties in Lemma 3, inverse inequality and the continuity of \(\overline{\epsilon }\nabla p\cdot \textbf{n}\), which is derived from the second equation of (2) and the fact that \(\textbf{f} \in \textrm{H}(\textrm{div}^0;\Omega )\). More precisely, for the first term, it holds

$$\begin{aligned} (\nabla \cdot \textbf{f} + \kappa ^2 \nabla \cdot (\epsilon \textbf{u}_h)&-\nabla \cdot (\overline{\epsilon } \nabla p_h), \Pi _{\textrm{SZ}} \phi -\phi )_{\mathcal {T}_h}\\&\lesssim h \, \Vert \nabla \cdot \textbf{f} + \kappa ^2 \nabla \cdot (\epsilon \textbf{u}_h)-\nabla \cdot (\overline{\epsilon } \nabla p_h)\Vert _{\mathcal {T}_h} \Vert \phi \Vert _{1,\mathcal {T}_h} \end{aligned}$$

and for the second term,

Similarly, we derive the following bounds for the third, fourth and fifth terms

$$\begin{aligned} \kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \nabla \phi )_{\mathcal {T}_h}&\lesssim \kappa ^2 \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h} \Vert \phi \Vert _{1,\mathcal {T}_h},\\ \kappa ^2 \langle \epsilon (\textbf{u}-\textbf{u}_h)\cdot \textbf{n}, \Pi _{\textrm{SZ}} \phi -\phi \rangle _{\partial \mathcal {T}_h}&\lesssim \kappa ^2 \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h} \Vert \phi \Vert _{1,\mathcal {T}_h},\\ \langle \overline{\epsilon }(p_h-\widehat{p}_h), (\nabla \Pi _{\textrm{SZ}} \phi -\nabla \Pi _{\textrm{Q}}^0 \phi )\cdot \textbf{n}\rangle _{\partial \mathcal {T}_h}&\lesssim \sum _{K \in \mathcal {T}_h} \Vert \overline{\epsilon } (p_h-\widehat{p}_h)\Vert _{\partial K} \Vert (\nabla \Pi _{\textrm{SZ}} \phi -\nabla \Pi _{\textrm{Q}}^0 \phi )\cdot \textbf{n}\Vert _{\partial K}\\&\lesssim \sum _{K \in \mathcal {T}_h} \Vert \overline{\epsilon } (p_h-\widehat{p}_h)\Vert _{\partial K} h_K^{-1/2} \Vert \nabla \Pi _{\textrm{SZ}} \phi -\nabla \Pi _{\textrm{Q}}^0 \phi \Vert _K\\&\lesssim \sum _{K \in \mathcal {T}_h} h_K^{-3/2} \Vert \overline{\epsilon } (p_h-\widehat{p}_h)\Vert _{\partial K} \Vert \Pi _{\textrm{SZ}} \phi -\Pi _{\textrm{Q}}^0 \phi \Vert _K\\&\lesssim \Vert h^{-1/2} \overline{\epsilon } (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h} \Vert \phi \Vert _{1,\mathcal {T}_h}. \end{aligned}$$

By replacing all the above bounds in (11), noticing that

$$\begin{aligned} \Vert \nabla (p-p_h^c)\Vert ^2_{\mathcal {T}_h} \lesssim | (\nabla (p-p_h), \epsilon \nabla \phi )_{\mathcal {T}_h} | + |(\nabla (p_h-p_h^c),\nabla \phi )_{\mathcal {T}_h}|, \end{aligned}$$

considering Lemma 3 and using Poincaré inequality applied to \(\Vert \phi \Vert _{\mathcal {T}_h}\), we deduce that

Finally, writing \(\nabla (p-p_h)=\nabla (p-p_h^c)+\nabla (p_h^c-p_h)\), using triangle inequality, (9) and the last expression, we obtain (8b). \(\square \)

In the next result, it is presented an upper bound for the \(\textrm{L}^2\)-error of the electric field that depends on the \(\textrm{L}^2\)-error of an approximation of its curl and the penalty terms. The former will be bounded later, by a computable quantity.

Lemma 5

Let \(\left( \textbf{v}, \textbf{u}, p\right) \in \textrm{H}(\textbf{curl};\Omega ) \times \textbf{X}_{\textrm{QP}}^{\textbf{g}} \times \textrm{H}_0^1(\Omega )\) and \((\textbf{v}_h, \textbf{u}_h, p_h, \widehat{\textbf{u}}_h^t, \widehat{p}_h) \in \textbf{V}_h \times \textbf{V}_h \times \textrm{Q}_h \times \mathrm {\textbf{M}}_{\textrm{QP}}^{\textbf{g}} \times \textrm{M}_h\) be the solutions of (2) and (4), respectively. There holds

$$\begin{aligned} \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h}&\lesssim \Vert \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert _{\mathcal {T}_h} + h^{1/2} \Vert \tau _n (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h} +\Vert h^{1/2} (\textbf{u}_h-\widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h} \end{aligned}$$
(12)

where \(\textbf{u}_h^{\textrm{QP}}\) is given by Lemma 2 for \(\textbf{u}_h\in \textbf{V}_h\).

Proof

First of all, thanks to Lemma 2, for \(\textbf{u}_h\in \textbf{V}_h\) there exists \(\textbf{u}_h^{\textrm{QP}} \in \textbf{V}_h^c\) with \(\textbf{u}_h^{\textrm{QP}}\times \textbf{n}\mid _{\Gamma _0}=\textbf{g}\) such that

Even more, the facts that \(\llbracket \widehat{\textbf{u}}_h^t\rrbracket =\varvec{0}\) on \(\mathcal {E}_I\), \(\llbracket \widehat{\textbf{u}}_h^t\rrbracket _{\textrm{QP}}=\varvec{0}\) on \(\Gamma _{\textrm{QP}}\) (cf. Remark 1) and \(\widehat{\textbf{u}}_h^t \times \textbf{n}\mid _{\Gamma _0}=\textbf{g}\), imply that

therefore, since \(\epsilon \) is a bounded function, we have that

$$\begin{aligned} \Vert \epsilon (\textbf{u}_h-\textbf{u}_h^{\textrm{QP}})\Vert _{\mathcal {T}_h} \lesssim&\, \Vert h^{1/2} (\textbf{u}_h-\widehat{\textbf{u}}_h^t)\times \textbf{n} \Vert _{\partial \mathcal {T}_h}. \end{aligned}$$
(13)

and, by the triangle inequality

$$\begin{aligned} \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h}&\lesssim \Vert \epsilon (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert _{\mathcal {T}_h} + \Vert h^{1/2} (\textbf{u}_h-\widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h}. \end{aligned}$$
(14)

Now, let us see the deduction of a bound for the term \(\Vert \epsilon (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert _{\mathcal {T}_h}\). For this purpose, we will use a Helmholtz decomposition, which will be demonstrated in the Appendix A.1. For \(\textbf{u}-\textbf{u}_h^{\textrm{QP}}\in \textbf{L}^2(\Omega )\) there exist \(\psi \in \textrm{H}_{\Gamma _0}^{1,\textrm{QP}}(\Omega )\) and \(\textbf{u}_s \in \textrm{H}_{\Gamma _{\textrm{QP}}}(\textrm{div}^0;\Omega )\), such that

$$\begin{aligned} \textbf{u}-\textbf{u}_h^{\textrm{QP}}=\nabla \psi + \textbf{u}_s \end{aligned}$$
(15)

and \(\Vert \textbf{u}-\textbf{u}_h^{\textrm{QP}}\Vert _{\Omega }^2=\Vert \nabla \psi \Vert _{\Omega }^2 + \Vert \textbf{u}_s\Vert _{\Omega }^2\) (see Proposition 1). Moreover, according with [21, Theorem 8.4], since \(\Omega \) is simply connected and \(\textbf{u}_s \in \textrm{H}_{\Gamma _{\textrm{QP}}}(\textrm{div}^0;\Omega )\) there exists a unique \(\widetilde{\textbf{z}} \in \textrm{H}_{\Gamma _0}(\textrm{div}^0;\Omega ) \cap \textrm{H}_{\Gamma _{\textrm{QP}}}(\textbf{curl};\Omega )\) such that \(\nabla \times \widetilde{\textbf{z}}=\textbf{u}_s\) and it satisfies

$$\begin{aligned} \Vert \widetilde{\textbf{z}}\Vert _{\textrm{H}(\textbf{curl};\Omega )} \lesssim \Vert \textbf{u}_s\Vert _{\Omega }. \end{aligned}$$
(16)

In the next part of the proof, we bound \(\Vert \textbf{u}_s\Vert _{\Omega }\) and \(\Vert \nabla \psi \Vert _{\Omega }\). First, we note that \((\textbf{u}-\textbf{u}_h^{\textrm{QP}}) \times \textbf{n}\mid _{\Gamma _0}=\textbf{0}\), since \(\textbf{u} \in \textbf{X}_{\textrm{QP}}^{\textbf{g}}\) and \(\textbf{g}\) is the tangential trace of \(\textbf{u}_h^{\textrm{QP}}\). By considering the orthogonal decomposition (15) and integrating by parts, we note that

$$\begin{aligned} \Vert \textbf{u}_s\Vert ^2_{\Omega }&=(\textbf{u}_s, \textbf{u}-\textbf{u}_h^{\textrm{QP}}-\nabla \psi )_{\Omega } =(\nabla \times \widetilde{\textbf{z}}, \textbf{u}-\textbf{u}_h^{\textrm{QP}})_{\Omega } -(\textbf{u}_s,\nabla \psi )_{\Omega }\\&=(\widetilde{\textbf{z}}, \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}}))_{\Omega } + \langle (\textbf{u}-\textbf{u}_h^{\textrm{QP}}) \times \textbf{n},\widetilde{\textbf{z}}^t \rangle _{\Gamma }\\&\quad +(\nabla \cdot \textbf{u}_s,\psi )_{\Omega } - \langle \textbf{u}_s\cdot \textbf{n},\psi \rangle _{\Gamma } =(\widetilde{\textbf{z}}, \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}}))_{\Omega } \end{aligned}$$

where the first boundary term vanishes due to the fact that \(\textbf{u}-\textbf{u}_h^{\textrm{QP}} \in \textrm{H}_{\Gamma _0}(\textbf{curl};\Omega )\), \(\widetilde{\textbf{z}} \in \textrm{H}_{\Gamma _{\textrm{QP}}}(\textbf{curl};\Omega )\) and the other terms because \(\textbf{u}_s \in \textrm{H}_{\Gamma _{\textrm{QP}}}(\textrm{div}^0;\Omega )\) and \(\psi \vert _{\Gamma _0}=0\). Therefore, by the Cauchy-Schwarz inequality and (16), it holds

$$\begin{aligned} \Vert \textbf{u}_s\Vert ^2_{\Omega }\lesssim \Vert \textbf{u}_s\Vert _{\Omega } \Vert \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert _{\Omega }, \end{aligned}$$

thus

$$\begin{aligned} \Vert \textbf{u}_s\Vert _{\Omega }&\lesssim \Vert \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert _{\mathcal {T}_h}. \end{aligned}$$
(17)

Now, in order to bound \(\Vert \nabla \psi \Vert _{\Omega }\), we also employ the aforementioned orthogonal decomposition and the addition and subtraction of \(\textbf{u}_h\), as follows

$$\begin{aligned} \Vert \nabla \psi \Vert ^2_{\Omega }=(\textbf{u}-\textbf{u}_h^{\textrm{QP}}-\textbf{u}_s,\nabla \psi )_{\Omega } = (\textbf{u}-\textbf{u}_h^{\textrm{QP}},\nabla \psi )_{\Omega } =(\epsilon ^{-1} \epsilon (\textbf{u}-\textbf{u}_h + \textbf{u}_h -\textbf{u}_h^{\textrm{QP}}), \nabla \psi )_{\mathcal {T}_h}, \end{aligned}$$

in order to conclude that,

$$\begin{aligned} \Vert \nabla \psi \Vert ^2_{\Omega }&\lesssim |(\epsilon (\textbf{u}-\textbf{u}_h), \nabla \psi )_{\mathcal {T}_h}| + |(\epsilon (\textbf{u}_h -\textbf{u}_h^{\textrm{QP}}), \nabla \psi )_{\mathcal {T}_h}|. \end{aligned}$$
(18)

Then, taking into account (2c) and (4c), we deduce the following error equation

$$\begin{aligned} -(\epsilon (\textbf{u}-\textbf{u}_h), \nabla q)_{\mathcal {T}_h} + \langle (\epsilon \textbf{u}-\widehat{\epsilon \textbf{u}_h^n})\cdot \textbf{n}, q\rangle _{\partial \mathcal {T}_h}=0, \end{aligned}$$

for all \(q\in \textrm{Q}_h\). From which, after applying the Green’s identity of \(\textrm{H}(\textrm{div}; \mathcal {T}_h)\), it is obtained that

$$\begin{aligned} (\nabla \cdot \epsilon (\textbf{u}-\textbf{u}_h), q)_{\mathcal {T}_h} + \langle (\epsilon \textbf{u}_h-\widehat{\epsilon \textbf{u}_h^n})\cdot \textbf{n}, q\rangle _{\partial \mathcal {T}_h}&=0 \quad \forall q \in \textrm{Q}_h. \end{aligned}$$
(19)

Now, if we integrate by parts in the first term of (18), add and subtract \((\nabla \cdot \epsilon (\textbf{u}-\textbf{u}_h), \Pi _{\textrm{SZ}} \psi )_{\mathcal {T}_h}\), integrate by parts \((\nabla \cdot \epsilon (\textbf{u}-\textbf{u}_h), \Pi _{\textrm{SZ}} \psi )_{\mathcal {T}_h}\), use the fact that \(\textbf{u}\in \textrm{H}(\textrm{div}^0_{\epsilon };\Omega )\) and choose \(q=\Pi _{\textrm{SZ}} \psi \in \textrm{Q}_h\) in (19), we can get that

$$\begin{aligned} (\epsilon ({\textbf {u}}-{\textbf {u}}_h), \nabla \psi )_{\mathcal {T}_h}&= -(\nabla \cdot \epsilon ({\textbf {u}}-{\textbf {u}}_h), \psi )_{\mathcal {T}_h} + \langle \epsilon ({\textbf {u}}-{\textbf {u}}_h)\cdot {\textbf {n}}, \psi \rangle _{\partial \mathcal {T}_h}\\ {}&= (\nabla \cdot \epsilon ({\textbf {u}}-{\textbf {u}}_h), \Pi _{\text {SZ}} \psi -\psi )_{\mathcal {T}_h}\\ {}&\quad - (\nabla \cdot \epsilon ({\textbf {u}}-{\textbf {u}}_h), \Pi _{\text {SZ}} \psi )_{\mathcal {T}_h}+ \langle \epsilon ({\textbf {u}}-{\textbf {u}}_h)\cdot {\textbf {n}}, \psi \rangle _{\partial \mathcal {T}_h}\\ {}&= (\nabla \cdot (\epsilon {\textbf {u}}_h), \psi -\Pi _{\text {SZ}} \psi )_{\mathcal {T}_h} +\langle (\epsilon {\textbf {u}}-\widehat{\epsilon {\textbf {u}}_h^n})\cdot {\textbf {n}}, \Pi _{\text {SZ}} \psi \rangle _{\mathcal {E}_{\text {QP}}} \\ {}&\quad + \langle \epsilon ({\textbf {u}}-{\textbf {u}}_h)\cdot {\textbf {n}}, \psi -\Pi _{\text {SZ}} \psi \rangle _{\partial \mathcal {T}_h \setminus (\mathcal {E}_{\text {QP}}\cup \mathcal {E}_0) },\end{aligned}$$

where in the last step we have made use of the fact that \( \langle (\epsilon \textbf{u}-\widehat{\epsilon \textbf{u}_h^n})\cdot \textbf{n}, \Pi _{\textrm{SZ}} \psi \rangle _{\partial \mathcal {T}_h{\setminus } \mathcal {E}_{\textrm{QP}}}=0\), due to \(\Pi _{\textrm{SZ}} \psi \in \textrm{H}_{\Gamma _0}^1(\Omega )\), the continuity of the normal trace of \(\epsilon \textbf{u}\) and the fact that \(\widehat{\epsilon \textbf{u}_h^n}\) is a single-valued function. We also used the fact that \(\Pi _{\textrm{SZ}} \psi -\psi =0\) on \(\mathcal {E}_{\textrm{QP}}\cup \mathcal {E}_0\). By the Cauchy-Schwarz inequality, the the definition of \(\llbracket \cdot \rrbracket _{\textrm{QP}}\) and the approximation properties of the Scott-Zhang projector in Lemma 3, it follows that

(20)

where we have made use of the fact that \(\llbracket \psi \rrbracket _{\textrm{QP}}=0\) because \(\psi \in \textrm{H}_{\Gamma _0}^{1,\textrm{QP}}(\Omega )\). Taking into account that \(\epsilon \textbf{u}\in \textrm{H}(\textrm{div}; \Omega )\), \(\widehat{\epsilon \textbf{u}_h^n}\) is single-valued and (4h), we have

(21)

Recalling that \(\nabla \cdot (\epsilon \textbf{u})=0\), taking \(q:=\nabla \cdot (\epsilon \textbf{u}_h)\) in (19), by using the Cauchy-Schwarz inequality, the discrete trace inequality and (4h), there holds

$$\begin{aligned} \Vert \nabla \cdot (\epsilon \textbf{u}_h)\Vert ^2_{ \mathcal {T}_h}&= \langle (\epsilon \textbf{u}_h-\widehat{\epsilon \textbf{u}_h^n})\cdot \textbf{n},\nabla \cdot (\epsilon \textbf{u}_h)\rangle _{\partial \mathcal {T}_h} \le \Vert (\epsilon \textbf{u}_h-\widehat{\epsilon \textbf{u}_h^n})\cdot \textbf{n}\Vert _{\partial \mathcal {T}_h} \Vert \nabla \cdot (\epsilon \textbf{u}_h)\Vert _{\partial \mathcal {T}_h}\\&\le \Vert (\epsilon \textbf{u}_h-\widehat{\epsilon \textbf{u}_h^n})\cdot \textbf{n}\Vert _{\partial \mathcal {T}_h}h^{-1/2} \Vert \nabla \cdot (\epsilon \textbf{u}_h)\Vert _{\mathcal {T}_h} \le h^{-1/2}\Vert \tau _n (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h}\Vert \nabla \cdot (\epsilon \textbf{u}_h)\Vert _{\mathcal {T}_h} \end{aligned}$$

thus

$$\begin{aligned} \Vert \nabla \cdot (\epsilon \textbf{u}_h)\Vert _{ \mathcal {T}_h} \lesssim h^{-1/2} \Vert \tau _n (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h}. \end{aligned}$$
(22)

Therefore, by using the Cauchy-Schwarz inequality in (18), from (20), (21), (22) and (13), it follows that

$$\begin{aligned} \Vert \nabla \psi \Vert _{\Omega }&\lesssim h^{1/2} \Vert \tau _n (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h} + \Vert h^{1/2} (\textbf{u}_h- \widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h}. \end{aligned}$$
(23)

Finally, (12) follows by combining (14), (15), (23) and (17). \(\square \)

In the following lemma, let us proceed to obtain a computable upper bound for the \(\textrm{L}^2\)-error of the curl of the electric field and its quasi-periodic approximation.

Lemma 6

Let \(\left( \textbf{v}, \textbf{u}, p\right) \in \textrm{H}(\textbf{curl};\Omega ) \times \textbf{X}_{\textrm{QP}}^{\textbf{g}} \times \textrm{H}_0^1(\Omega )\) and \((\textbf{v}_h, \textbf{u}_h, p_h, \widehat{\textbf{u}}_h^t, \widehat{p}_h) \in \textbf{V}_h \times \textbf{V}_h \times \textrm{Q}_h \times \mathrm {\textbf{M}}_{\textrm{QP}}^{\textbf{g}} \times \textrm{M}_h\) be the solutions of (2) and (4), respectively. Then,

$$\begin{aligned} \Vert \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert _{\mathcal {T}_h}\lesssim & {} \Vert h^{-1/2} (\textbf{u}_h- \widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h} +h^{\ell -1} \sum _{K \in \mathcal {T}_h}\ \eta _{K,1} +h^{\ell }\Vert {h^{-1/2}} \tau (\widehat{\textbf{u}}_h^t-\textbf{u}_h^t)\Vert _{\partial \mathcal {T}_h}\nonumber \\{} & {} +h^{\ell -1} \sum _{K\in \mathcal {T}_h}\sum _{F\in \partial K}\eta _{F,3} +h^{1/2} \Vert \tau _n (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h} +h^{\ell -1/2}\Vert p_h-\widehat{p}_h\Vert _{\partial \mathcal {T}_h}\nonumber \\ \end{aligned}$$
(24)

where \(\textbf{u}_h^{\textrm{QP}}\) is given by Lemma 2 for \(\textbf{u}_h\in \textbf{V}_h\) and \(\ell \in (0,1)\) such that the continuous embedding

$$\begin{aligned} \textrm{H}_{\Gamma _{\textrm{QP}}}(\textrm{div}_{\epsilon }^0;\Omega )\cap \textrm{H}_{\Gamma _0}(\textbf{curl};\Omega )\hookrightarrow \textbf{H}^{\ell }(\Omega ) \end{aligned}$$
(25)

holds.

Proof

Let \(\textbf{u}_h^{\textrm{QP}} \in \textbf{V}_h^c\) be the quasi-periodic approximation of \(\textbf{u}_h\) with \(\textbf{u}_h^{\textrm{QP}}\times \textbf{n}\mid _{\Gamma _0}=\textbf{g}\) provided in Lemma 2. Let us consider the Helmholtz decomposition of \(\textbf{u}-\textbf{u}_h^{\textrm{QP}} \in \textbf{L}^2(\Omega )\) (Appendix A.1):

$$\begin{aligned} \textbf{u}-\textbf{u}_h^{\textrm{QP}}=\nabla \varphi + \textbf{v}_s, \end{aligned}$$
(26)

with \(\Vert \textbf{u}-\textbf{u}_h^{\textrm{QP}}\Vert ^2_{\Omega }=\Vert \nabla \varphi \Vert ^2+\Vert \textbf{v}_s\Vert ^2\), where \(\varphi \in \textrm{H}_{\Gamma _0}^{1,\textrm{QP}}(\Omega )\) and \(\textbf{v}_s \in \textrm{H}_{\Gamma _{\textrm{QP}}}(\textrm{div}_{\epsilon }^0;\Omega )\). In addition, since \((\textbf{u}-\textbf{u}_h^{\textrm{QP}})\times \textbf{n}=\varvec{0}\) on \(\Gamma _0\) and \(\nabla \varphi \times \textbf{n}\vert _{\Gamma _0}=\textrm{curl}\vert _{\Gamma _0}\varphi =\varvec{0}\), we conclude that \(\textbf{v}_s \in \textrm{H}_{\Gamma _0}(\textbf{curl};\Omega )\). Thus, for \(\textbf{v}_s \in \textrm{H}_{\Gamma _{\textrm{QP}}}(\textrm{div}_{\epsilon }^0;\Omega )\cap \textrm{H}_{\Gamma _0}(\textbf{curl};\Omega )\) there exists \(\ell \in (0,1)\) such that \(\textbf{v}_s \in \textbf{H}^{\ell }(\Omega )\) and \(\Vert \textbf{v}_s\Vert _{\ell ,\Omega }\lesssim \Vert \textbf{v}_s\Vert _{\textrm{H}(\textbf{curl};\Omega )}\), thanks the continuous embedding \(\textrm{H}_{\Gamma _{\textrm{QP}}}(\textrm{div}_{\epsilon }^0;\Omega )\cap \textrm{H}_{\Gamma _0}(\textbf{curl};\Omega )\hookrightarrow \textbf{H}^{\ell }(\Omega )\) (see Remark 8.7 in [21]).

Then, adding and subtracting \(\textbf{u}_h\), it follows that

$$\begin{aligned} \Vert \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert ^2_{\mathcal {T}_h}&= (\nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}}), \nabla \times (\nabla \varphi + \textbf{v}_s))_{\mathcal {T}_h}\\&= (\nabla \times (\textbf{u}-\textbf{u}_h), \nabla \times \textbf{v}_s)_{\mathcal {T}_h}+ (\nabla \times (\textbf{u}_h-\textbf{u}_h^{\textrm{QP}}), \nabla \times \textbf{v}_s)_{\mathcal {T}_h}. \end{aligned}$$

For the second term, according to (7d), we have that

(27)

where in the last step, we have used the facts that \(\llbracket \widehat{\textbf{u}}_h^t\rrbracket =0\) on \(\mathcal {E}_I\), \(\llbracket \widehat{\textbf{u}}_h^t\rrbracket _{\textrm{QP}}=0\) on \(\mathcal {E}_{\textrm{QP}}\) (Remark 1) and \(\widehat{\textbf{u}}_h^t \times \textbf{n}=\textbf{g}\) on \(\Gamma _0\). Thus, since \(\nabla \times \textbf{v}_s=\nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\) and apply the Young inequality, as follows

$$\begin{aligned} \begin{aligned} \Vert \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert ^2_{\mathcal {T}_h}&\lesssim (\nabla \times (\textbf{u}-\textbf{u}_h), \nabla \times \textbf{v}_s)_{\mathcal {T}_h} +\Vert h^{-1/2} (\textbf{u}_h- \widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h}^2 . \end{aligned} \end{aligned}$$
(28)

Now, if we use the \(\textbf{L}^2\)-projector over \(\textbf{P}_0(\mathcal {T}_h)\), \(\Pi _{\textbf{V}}^0\) (see [35]), in the first term of (28), apply the Green’s identity of \(\textrm{H}(\textbf{curl};\mathcal {T}_h)\), use (2a) and (2b), it follows that

$$\begin{aligned} \begin{aligned} (\nabla \times (\textbf{u}-&\textbf{u}_h), \nabla \times \textbf{v}_s)_{\mathcal {T}_h} \\&= (\nabla \times (\textbf{u}-\textbf{u}_h), \nabla \times (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s))_{\mathcal {T}_h}\\&= (\nabla \times \nabla \times (\textbf{u}-\textbf{u}_h), \textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)_{\mathcal {T}_h} \\&\qquad - \langle (\nabla \times (\textbf{u}-\textbf{u}_h))^t, (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s) \times \textbf{n} \rangle _{\partial \mathcal {T}_h}\\&= (\textbf{f}-\overline{\epsilon } \nabla p + \kappa ^2 \epsilon \textbf{u}-\nabla \times \nabla \times \textbf{u}_h,\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)_{\mathcal {T}_h} \\&\qquad - \langle (\textbf{v}-\nabla \times \textbf{u}_h)^t, (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\times \textbf{n} \rangle _{\partial \mathcal {T}_h}. \end{aligned} \end{aligned}$$
(29)

Now, by taking \(\textbf{z}:= \Pi _{\textbf{V}}^0 \textbf{v}_s\) in (10) and applying the Green’s identity of \(\textrm{H}(\textrm{div};\mathcal {T}_h)\) to the fourth term of the obtained equation, we have

$$\begin{aligned} 0= & {} (\textbf{v}-\textbf{v}_h, \nabla \times \Pi _{\textbf{V}}^0 \textbf{v}_s)_{\mathcal {T}_h} + \langle \textbf{v}^t-\widehat{\textbf{v}}_h^t, \Pi _{\textbf{V}}^0 \textbf{v}_s \times \textbf{n} \rangle _{\partial \mathcal {T}_h} - \kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \Pi _{\textbf{V}}^0 \textbf{v}_s)_{\mathcal {T}_h}\\{} & {} - (p-p_h, \nabla \cdot (\epsilon \Pi _{\textbf{V}}^0 \textbf{v}_s))_{\mathcal {T}_h} + \langle p-\widehat{p}_h, \epsilon \Pi _{\textbf{V}}^0 \textbf{v}_s\cdot \textbf{n} \rangle _{\partial \mathcal {T}_h}, \end{aligned}$$

from which,

$$\begin{aligned} 0=\langle \textbf{v}^t-\widehat{\textbf{v}}_h^{\,t}, \Pi _{\textbf{V}}^0 \textbf{v}_s \times \textbf{n} \rangle _{\partial \mathcal {T}_h} - \kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \Pi _{\textbf{V}}^0 \textbf{v}_s)_{\mathcal {T}_h} +\langle p-\widehat{p}_h,\epsilon \Pi _{\textbf{V}}^0 \textbf{v}_s\cdot \textbf{n} \rangle _{\partial \mathcal {T}_h},\nonumber \\ \end{aligned}$$
(30)

thanks to the fact that \(\epsilon \) is a piecewise constant. Then, by using (30), let us rewrite the second term on the right hand side of (29), thus

$$\begin{aligned} \langle (\textbf{v}-\nabla \times \textbf{u}_h)^t&, (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\times \textbf{n} \rangle _{\partial \mathcal {T}_h}\\ =&\langle \textbf{v}^t, \textbf{v}_s\times \textbf{n}\rangle _{\partial \mathcal {T}_h} -\langle \textbf{v}^t, \Pi _{\textbf{V}}^0 \textbf{v}_s\times \textbf{n}\rangle _{\partial \mathcal {T}_h} -\langle (\nabla \times \textbf{u}_h)^t, (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\times \textbf{n}\rangle _{\partial \mathcal {T}_h}\\ =&\langle \textbf{v}^t, \textbf{v}_s \times \textbf{n}\rangle _{\partial \mathcal {T}_h} -\langle \widehat{\textbf{v}}_h^t, \Pi _{\textbf{V}}^0 \textbf{v}_s \times \textbf{n} \rangle _{\partial \mathcal {T}_h} - \kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \Pi _{\textbf{V}}^0 \textbf{v}_s)_{\mathcal {T}_h}\\&+\langle p-\widehat{p}_h, \epsilon \Pi _{\textbf{V}}^0 \textbf{v}_s\cdot \textbf{n}\rangle _{\partial \mathcal {T}_h} -\langle (\nabla \times \textbf{u}_h)^t, (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\times \textbf{n}\rangle _{\partial \mathcal {T}_h}. \end{aligned}$$

Let us note that the first term on the right hand side vanishes, since \(\textbf{v}_s \in \textrm{H}_{\Gamma _0}(\textbf{curl};\Omega )\), \(\textbf{u}\), \(\textbf{u}_h^{\textrm{QP}}\) and \(\varphi \) satisfies quasi-periodic conditions. In fact, by using the definitions of \(\textbf{v}\) [cf. (2a)] and \(\textbf{v}_s\) [cf. (26)], we have that

$$\begin{aligned} \langle \textbf{v}^t, \textbf{v}_s\times \textbf{n}\rangle _{\partial \mathcal {T}_h} =&\langle \textbf{v}^t, \textbf{v}_s \times \textbf{n}\rangle _{\partial \mathcal {T}_h \setminus \Gamma } +\langle \textbf{v}^t, \textbf{v}_s \times \textbf{n}\rangle _{\Gamma _0} +\langle \textbf{v}^t, \textbf{v}_s \times \textbf{n}\rangle _{\Gamma _{\textrm{QP}}}\\ =&\langle \textbf{v}^t, \textbf{v}_s \times \textbf{n}\rangle _{\Gamma _{\textrm{QP}}} =\langle (\nabla \times \textbf{u})^t, \textbf{v}_s \times \textbf{n}\rangle _{\Gamma _{\textrm{QP}}}\\ =&\langle (\nabla \times \textbf{u})^t, (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\times \textbf{n}\rangle _{\Gamma _{\textrm{QP}}} -\langle (\nabla \times \textbf{u})^t, \nabla \varphi \times \textbf{n}\rangle _{\Gamma _{\textrm{QP}}} \\=&\langle (\nabla \times \textbf{u})^t, (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\times \textbf{n}\rangle _{\Gamma _1\cup \Gamma _2} + \langle (\nabla \times \textbf{u})^t, (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\times \textbf{n}\rangle _{\Gamma _3\cup \Gamma _4} \\ =&\langle (\nabla \times \textbf{u})^t, (\textbf{u}-\textbf{u}_h^{\textrm{QP}}) \times \textbf{n}\rangle _{\Gamma _1}-|e ^{i \alpha L}| \langle (\nabla \times \textbf{u})^t, (\textbf{u}-\textbf{u}_h^{\textrm{QP}}) \times \textbf{n}\rangle _{\Gamma _1}\\ {}&+ \langle (\nabla \times \textbf{u})^t, (\textbf{u}-\textbf{u}_h^{\textrm{QP}}) \times \textbf{n}\rangle _{\Gamma _3}-| e ^{i \beta L}| \langle (\nabla \times \textbf{u})^t, (\textbf{u}-\textbf{u}_h^{\textrm{QP}}) \times \textbf{n}\rangle _{\Gamma _3}=0. \end{aligned}$$

In addition, if we add \(0=\langle \widehat{\textbf{v}}_h^t, \textbf{v}_s \times \textbf{n} \rangle _{\partial \mathcal {T}_h}\) in the second term, it is obtained that

$$\begin{aligned} \langle (\textbf{v}-\nabla \times \textbf{u}_h)^t, (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\times \textbf{n}\rangle _{\partial \mathcal {T}_h} = -\langle \widehat{\textbf{v}}_h^t, (\Pi _{\textbf{V}}^0 \textbf{v}_s -\textbf{v}_s) \times \textbf{n} \rangle _{\partial \mathcal {T}_h} \\ - \kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \Pi _{\textbf{V}}^0 \textbf{v}_s)_{\mathcal {T}_h} +\langle p-\widehat{p}_h, \epsilon \Pi _{\textbf{V}}^0 \textbf{v}_s\cdot \textbf{n} \rangle _{\partial \mathcal {T}_h} -\langle (\nabla \times \textbf{u}_h)^t, (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\times \textbf{n}\rangle _{\partial \mathcal {T}_h}. \end{aligned}$$

Then, after replacing the above expression in (29), add \(0=\langle p-\widehat{p}_h, \epsilon \textbf{v}_s\cdot \textbf{n}\rangle _{\partial \mathcal {T}_h}\) and by adding and subtracting \(\kappa ^2 \epsilon \textbf{u}_h\) and \(\overline{\epsilon } \nabla p_h\) in the first term, we can form the residual associated to (2b), as follows

$$\begin{aligned} (\nabla \times (\textbf{u}-\textbf{u}_h), \nabla \times \textbf{v}_s)_{\mathcal {T}_h}= & {} (\textbf{f}-\overline{\epsilon } \nabla p_h + \kappa ^2 \epsilon \textbf{u}_h-\nabla \times \nabla \times \textbf{u}_h, \textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)_{\mathcal {T}_h}\\{} & {} -\kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \textbf{v}_s)_{\mathcal {T}_h} \\{} & {} -\langle \widehat{\textbf{v}}_h^t-(\nabla \times \textbf{u}_h)^t,(\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\times \textbf{n}\rangle _{\partial \mathcal {T}_h}\\{} & {} +\langle p-\widehat{p}_h, \epsilon (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\cdot \textbf{n}\rangle _{\partial \mathcal {T}_h}\\{} & {} -(\nabla (p-p_h),\epsilon (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)) _{\mathcal {T}_h}, \end{aligned}$$

using Green’s identity and recalling that \(\epsilon (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\) is divergence free on each element, it is obtained that

$$\begin{aligned} (\nabla \times ({\textbf {u}}-{\textbf {u}}_h), \nabla \times {\textbf {v}}_s)_{\mathcal {T}_h}{} & {} = ({\textbf {f}}-\overline{\epsilon } \nabla p_h + \kappa ^2 \epsilon {\textbf {u}}_h +\nabla \times \nabla \times {\textbf {u}}_h, {\textbf {v}}_s-\Pi _{{\textbf {V}}}^0 {\textbf {v}}_s)_{\mathcal {T}_h}\\ {}{} & {} \quad - \kappa ^2 (\epsilon ({\textbf {u}}-{\textbf {u}}_h),{\textbf {v}}_s)_{\mathcal {T}_h} \\ {}{} & {} \quad -\langle \widehat{{\textbf {v}}}_h^t-(\nabla \times {\textbf {u}}_h)^t,({\textbf {v}}_s-\Pi _{{\textbf {V}}}^0 {\textbf {v}}_s)\times {\textbf {n}}\rangle _{\partial \mathcal {T}_h}\\{} & {} \quad +\langle p_h-\widehat{p}_h, \epsilon ({\textbf {v}}_s-\Pi _{{\textbf {V}}}^0 {\textbf {v}}_s)\cdot {\textbf {n}}\rangle _{\partial \mathcal {T}_h} \end{aligned}$$

Now, if we use (26) to rewrite \(\textbf{v}_s\) in the second term, adding and subtracting \(\textbf{v}_h^t\) in the third term and taking account the numerical flux (4h), it holds

$$\begin{aligned} (\nabla \times (\textbf{u}-\textbf{u}_h), \nabla \times \textbf{v}_s)_{\mathcal {T}_h}&= (\textbf{f}-\overline{\epsilon } \nabla p_h + \kappa ^2 \epsilon \textbf{u}_h-\nabla \times \nabla \times \textbf{u}_h, \textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)_{\mathcal {T}_h} \\&\quad -\kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \textbf{u}-\textbf{u}_h^{\textrm{QP}})_{\mathcal {T}_h} \\&\quad + \kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \nabla \varphi )_{\mathcal {T}_h} +\langle p_h-\widehat{p}_h, \epsilon (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\cdot \textbf{n}\rangle _{\partial \mathcal {T}_h} \\&\quad +\langle \tau (\widehat{\textbf{u}}_h^t-\textbf{u}_h^t) ,\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s\rangle _{\partial \mathcal {T}_h} \\&\quad +\langle \textbf{v}_h^t-(\nabla \times \textbf{u}_h)^t,(\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\times \textbf{n}\rangle _{\partial \mathcal {T}_h} . \end{aligned}$$

Since \(- \kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \textbf{u}-\textbf{u}_h^{\textrm{QP}})_{\mathcal {T}_h} = - \kappa ^2 \Vert \epsilon ^{1/2} (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h}^2 - \kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \textbf{u}_h-\textbf{u}_h^{\textrm{QP}})_{\mathcal {T}_h}\), from the above equality we obtain that

$$\begin{aligned} \begin{aligned}&\kappa ^2 \Vert \epsilon ^{1/2} (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h}^2+(\nabla \times (\textbf{u}-\textbf{u}_h), \nabla \times \textbf{v}_s)_{\mathcal {T}_h} \\&\quad = (\textbf{f}-\overline{\epsilon } \nabla p_h + \kappa ^2 \epsilon \textbf{u}_h-\nabla \times \nabla \times \textbf{u}_h, \textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)_{\mathcal {T}_h}\\&\qquad -\kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \textbf{u}_h-\textbf{u}_h^{\textrm{QP}})_{\mathcal {T}_h} \\&\qquad + \kappa ^2 (\epsilon (\textbf{u}-\textbf{u}_h), \nabla \varphi )_{\mathcal {T}_h} +\langle p_h-\widehat{p}_h,\epsilon (\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\cdot \textbf{n} \rangle _{\partial \mathcal {T}_h}\\&\qquad +\langle \tau (\widehat{\textbf{u}}_h^t-\textbf{u}_h^t) ,\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s\rangle _{\partial \mathcal {T}_h} +\langle \textbf{v}_h^t-(\nabla \times \textbf{u}_h)^t,(\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\times \textbf{n}\rangle _{\partial \mathcal {T}_h}. \end{aligned} \end{aligned}$$
(31)

In what follows, we bound each term on the right hand side of (31), by applying the Cauchy-Schwarz inequality, the definitions of the error indicators (6a), (6e), the relation (4g), the approximation properties of \(\Pi _{\textbf{V}}^0\) and the inverse inequality, we have

\(\star \)::
$$\begin{aligned} (\textbf{f}-\overline{\epsilon } \nabla p_h + \kappa ^2 \epsilon \textbf{u}_h -\nabla \times \nabla \times \textbf{u}_h, \textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)_{\mathcal {T}_h}&\le \sum _{K\in \mathcal {T}_h}h_K^{-1}\eta _{K,1} \Vert \textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s\Vert _K\\&\lesssim \sum _{K \in \mathcal {T}_h} h_K^{-1}\ \eta _{K,1}\ h_K^{\ell }\Vert \textbf{v}_s\Vert _{\ell ,K}\\&\le h^{\ell -1}\Vert \textbf{v}_s\Vert _{\ell ,\Omega } \sum _{K \in \mathcal {T}_h}\ \eta _{K,1}, \end{aligned}$$
\(\star \)::
$$\begin{aligned} \langle \tau (\widehat{\textbf{u}}_h^t-\textbf{u}_h^t) ,\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s\rangle _{\partial \mathcal {T}_h} \lesssim h^{\ell }\Vert \textbf{v}_s\Vert _{\ell ,\Omega }\ \Vert {h^{-1/2}}\tau (\widehat{\textbf{u}}_h^t-\textbf{u}_h^t)\Vert _{\partial \mathcal {T}_h} \end{aligned}$$
\(\star \)::
$$\begin{aligned} \langle \textbf{v}_h^t-(\nabla \times \textbf{u}_h)^t,(\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s)\times \textbf{n}\rangle _{\partial \mathcal {T}_h}&=\langle \textbf{n}\times (\textbf{v}_h-\nabla \times \textbf{u}_h),\textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s\rangle _{\partial \mathcal {T}_h} \\&\le \sum _{K\in \mathcal {T}_h}\Vert \textbf{n}\times (\textbf{v}_h-\nabla \times \textbf{u}_h)\Vert _{\partial K} \Vert \textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s\Vert _{\partial K}\\&\le \sum _{K\in \mathcal {T}_h}\Vert \textbf{n}\times (\textbf{v}_h-\nabla \times \textbf{u}_h)\Vert _{\partial K}\ h_K^{-1/2} \Vert \textbf{v}_s-\Pi _{\textbf{V}}^0 \textbf{v}_s\Vert _{K}\\&\lesssim \sum _{K\in \mathcal {T}_h}\left( \ h_K^{\ell -1/2} \Vert \textbf{v}_s\Vert _{\ell ,K}\ \sum _{F\in \partial K}\Vert \textbf{n}\times (\textbf{v}_h-\nabla \times \textbf{u}_h)\Vert _{F} \right) \\&\le \sum _{K\in \mathcal {T}_h}\left( \ h_K^{\ell -1/2} \Vert \textbf{v}_s\Vert _{\ell ,K}\ \sum _{F\in \partial K} h_F^{-1/2}\eta _{F,3} \right) \\&\lesssim h^{\ell -1}\Vert \textbf{v}_s\Vert _{\ell ,\Omega }\ \sum _{K\in \mathcal {T}_h}\sum _{F\in \partial K}\eta _{F,3} \end{aligned}$$
\(\star \)::
$$\begin{aligned} (\epsilon (\textbf{u}-\textbf{u}_h), \textbf{u}_h-\textbf{u}_h^{\textrm{QP}})_{\mathcal {T}_h}&\le \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h} \Vert \textbf{u}_h-\textbf{u}_h^{\textrm{QP}}\Vert _{\mathcal {T}_h}\\&\lesssim h^{1/2} \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h} \Vert (\textbf{u}_h- \widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h}, \end{aligned}$$
\(\star \)::
$$\begin{aligned} \langle \epsilon (\Pi _{\textbf{V}}^0 \textbf{v}_s \cdot \textbf{n} -\textbf{v}_s \cdot \textbf{n}),p_h - \widehat{p}_h \rangle _{\partial \mathcal {T}_h} \lesssim h^{\ell -1/2}\Vert \textbf{v}_s\Vert _{\ell ,\Omega }\ \Vert p_h-\widehat{p}_h\Vert _{\partial \mathcal {T}_h}. \end{aligned}$$
\(\star \)::
$$\begin{aligned} (\epsilon (\textbf{u}-\textbf{u}_h), \nabla \varphi )_{\mathcal {T}_h}&\le \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h} \Vert \nabla \varphi \Vert _{\mathcal {T}_h}\\&\lesssim \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h} \left( h^{1/2} \Vert \tau _n (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h} +\Vert h^{1/2} (\textbf{u}_h- \widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h}\right) , \end{aligned}$$

Where in the last inequality, we have used (23) for \(\psi \) in place of \(\varphi \). Using Young’s inequality in the above equations and replacing in (31), we get

$$\begin{aligned} \kappa ^2 \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h}^2&+(\nabla \times (\textbf{u}-\textbf{u}_h),\nabla \times \textbf{v}_s)_{\mathcal {T}_h} \lesssim \ \delta ^2\Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h}^2 +\left( h^{\ell -1} \sum _{K \in \mathcal {T}_h}\ \eta _{K,1}\right) ^2\\&\quad +\left( h^{\ell }\Vert {h^{-1/2}}\tau (\widehat{\textbf{u}}_h^t-\textbf{u}_h^t)\Vert _{\partial \mathcal {T}_h}\right) ^2 +\left( h^{\ell -1} \sum _{K\in \mathcal {T}_h}\sum _{F\in \partial K}\eta _{F,3}\right) ^2\\&\quad +\left( h^{1/2} \Vert \tau _n (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h}\right) ^2\\&\quad +\left( \Vert h^{1/2} (\textbf{u}_h- \widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h}\right) ^2 +\left( h^{\ell -1/2}\Vert p_h-\widehat{p}_h\Vert _{\partial \mathcal {T}_h}\right) ^2 +\Vert \textbf{v}_s\Vert _{\ell ,\Omega }^2 . \end{aligned}$$

According with the continuous embedding, we rewrite \(\textbf{v}_s\) by using (26) and (23), we have

$$\begin{aligned} \Vert \textbf{v}_s\Vert ^2_{\ell ,\Omega }&\lesssim \Vert \textbf{v}_s\Vert ^2_{\Omega } +\Vert \nabla \times \textbf{v}_s\Vert ^2_{\Omega } =\Vert \textbf{u}-\textbf{u}_h^{\textrm{QP}}-\nabla \varphi \Vert ^2_{\mathcal {T}_h} +\Vert \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert ^2_{\mathcal {T}_h}\\&\lesssim \Vert \nabla \varphi \Vert ^2_{\Omega } +\Vert \textbf{u}-\textbf{u}_h^{\textrm{QP}}\Vert ^2_{\mathcal {T}_h} +\Vert \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert ^2_{\mathcal {T}_h} \\&\lesssim \left( h^{1/2} \Vert \tau _n (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h} \right) ^2 +\left( \Vert h^{1/2} (\textbf{u}_h- \widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h}\right) ^2\\&\quad +\Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert ^2_{\mathcal {T}_h} +\Vert \epsilon (\textbf{u}_h-\textbf{u}_h^{\textrm{QP}})\Vert ^2_{\mathcal {T}_h} +\Vert \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert ^2_{\mathcal {T}_h}\\&\lesssim \left( h^{1/2} \Vert \tau _n (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h} \right) ^2 +\left( \Vert h^{1/2} (\textbf{u}_h- \widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h}\right) ^2 +\Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert ^2_{\mathcal {T}_h}\\&\quad +\Vert \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert ^2_{\mathcal {T}_h} \end{aligned}$$

thus

$$\begin{aligned} \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h}^2&+(\nabla \times (\textbf{u}-\textbf{u}_h),\nabla \times \textbf{v}_s)_{\mathcal {T}_h} \lesssim \ \hat{\delta }^2\Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h}^2\\&\quad +\left( h^{\ell -1} \sum _{K \in \mathcal {T}_h}\ \eta _{K,1}\right) ^2+\left( h^{\ell }\Vert {h^{-1/2}}\tau (\widehat{\textbf{u}}_h^t-\textbf{u}_h^t)\Vert _{\partial \mathcal {T}_h}\right) ^2\\&\quad +\left( h^{\ell -1} \sum _{K\in \mathcal {T}_h}\sum _{F\in \partial K}\eta _{F,3}\right) ^2+\left( h^{1/2} \Vert \tau _n (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h}\right) ^2\\&\quad +\left( \Vert h^{1/2} (\textbf{u}_h- \widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h}\right) ^2\\&\quad +\left( h^{\ell -1/2}\Vert p_h-\widehat{p}_h\Vert _{\partial \mathcal {T}_h}\right) ^2+\Vert \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert ^2_{\mathcal {T}_h}. \end{aligned}$$

Finally, replacing in (28), we conclude

$$\begin{aligned} \Vert \nabla \times (\textbf{u}-\textbf{u}_h^{\textrm{QP}})\Vert ^2_{\mathcal {T}_h} \lesssim&\ \Vert h^{-1/2} (\textbf{u}_h- \widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h}^2 +\left( h^{\ell -1} \sum _{K \in \mathcal {T}_h}\ \eta _{K,1}\right) ^2\\&\quad +\left( h^{\ell }\Vert {h^{-1/2}}\tau (\widehat{\textbf{u}}_h^t-\textbf{u}_h^t)\Vert _{\partial \mathcal {T}_h}\right) ^2\\&\quad +\left( h^{\ell -1} \sum _{K\in \mathcal {T}_h}\sum _{F\in \partial K}\eta _{F,3}\right) ^2 +\left( h^{1/2} \Vert \tau _n (p_h-\widehat{p}_h)\Vert _{\partial \mathcal {T}_h}\right) ^2\\&\quad +\left( \Vert h^{1/2} (\textbf{u}_h- \widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h}\right) ^2 +\left( h^{\ell -1/2}\Vert p_h-\widehat{p}_h\Vert _{\partial \mathcal {T}_h}\right) ^2\\&\quad +\hat{\delta }^2\Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\mathcal {T}_h}^2. \end{aligned}$$

Then, choosing \(\hat{\delta }\) small enough and using the fact that \(0<h<1\), (24) is deduced from the last inequality. \(\square \)

Lemma 7

Let \(\left( \textbf{v}, \textbf{u}, p\right) \in \textrm{H}(\textbf{curl};\Omega ) \times \textbf{X}_{\textrm{QP}}^{\textbf{g}} \times \textrm{H}_0^1(\Omega )\) and \((\textbf{v}_h, \textbf{u}_h, p_h, \widehat{\textbf{u}}_h^t, \widehat{p}_h) \in \textbf{V}_h \times \textbf{V}_h \times \textrm{Q}_h \times \mathrm {\textbf{M}}_{\textrm{QP}}^{\textbf{g}} \times \textrm{M}_h\) be the solutions of (2) and (4), respectively. There holds

$$\begin{aligned} \Vert \nabla \times \textbf{u}_h -\textbf{v}_h\Vert _{\mathcal {T}_h}&\lesssim h^{-1/2} \Vert (\textbf{u}_h^t-\widehat{\textbf{u}}_h^t) \times \textbf{n}\Vert _{\partial \mathcal {T}_h}. \end{aligned}$$
(32)

Proof

By testing (2a) with \(\textbf{w}\), apply the Green’s identity and subtracting (4a), we obtain the next error equation

$$\begin{aligned} (\textbf{v}-\textbf{v}_h, \textbf{w})-(\textbf{u}-\textbf{u}_h, \nabla \times \textbf{w})_{\mathcal {T}_h}-\langle \textbf{u}^ t- \widehat{\textbf{u}}_h^t, \textbf{w} \times \textbf{n}\rangle _{\partial \mathcal {T}_h}&= 0{} & {} \forall \textbf{w}\in \textbf{V}_h \end{aligned}$$

apply the Green’s identity to the second term and using again (2a), it follows

$$\begin{aligned} (\textbf{v}-\textbf{v}_h, \textbf{w})_{\mathcal {T}_h}-(\nabla \times (\textbf{u}-\textbf{u}_h), \textbf{w})_{\mathcal {T}_h} + \langle (\textbf{u} -\textbf{u}_h)^t, \textbf{w} \times \textbf{n} \rangle _{\partial \mathcal {T}_h} -\langle \textbf{u}^t- \widehat{\textbf{u}}_h^t, \textbf{w} \times \textbf{n}\rangle _{\partial \mathcal {T}_h}=0&\\ (\nabla \times \textbf{u}_h-\textbf{v}_h, \textbf{w})_{\mathcal {T}_h} -\langle (\textbf{u}_h^t-\widehat{\textbf{u}}_h^t) \times \textbf{n}, \textbf{w}\rangle _{\partial \mathcal {T}_h}=0&. \end{aligned}$$

Afterwards, by defining \(\textbf{w}:= \nabla \times \textbf{u}_h -\textbf{v}_h\), applying the Cauchy-Schwarz inequality and the inverse inequality ( [18], Lemma 1.46), we obtain (32). \(\square \)

Finally, gathering together all the previous results, we deduce the following upper bound for the error in terms of the error estimator and the index \(\ell \) appearing in the continuous embedding (25).

Corollary 2

Let \(\left( \textbf{v}, \textbf{u}, p\right) \in \textrm{H}(\textbf{curl};\Omega ) \times \textbf{X}_{\textrm{QP}}^{\textbf{g}} \times \textrm{H}_0^1(\Omega )\) and \((\textbf{v}_h, \textbf{u}_h, p_h, \widehat{\textbf{u}}_h^t, \widehat{p}_h) \in \textbf{V}_h \times \textbf{V}_h \times \textrm{Q}_h \times \mathrm {\textbf{M}}_{\textrm{QP}}^{\textbf{g}} \times \textrm{M}_h\) be the solutions of 2 and 4, respectively. If the stabilization parameters satisfy \(|\tau |\) and \(|\tau _n|\) to be proportional to one, then

$$\begin{aligned} E_h\lesssim h^{\ell -1}\eta _1 +\eta _2 + {h^{\ell }\eta _1^\partial }+\eta _2^\partial + h^{\ell -1}\eta _3^\partial +\eta _4^\partial , \end{aligned}$$

where the terms on the right hand side have the following form \(\eta _1:= \sum _{K \in \mathcal {T}_h} \eta _{K,1}\), \(\eta _2:= \sum _{K \in \mathcal {T}_h} \eta _{K,2}\), \(\eta _1^\partial := \sum _{K \in \mathcal {T}_h}\sum _{F \in \partial K} \eta _{F,1}\), \(\eta _2^\partial := \sum _{K \in \mathcal {T}_h}\sum _{F \in \partial K} \eta _{F,2}\), \(\eta _3^\partial := \sum _{K \in \mathcal {T}_h}\sum _{F \in \partial K} \eta _{F,3}\) and \(\eta _4^\partial := \sum _{F \in \mathcal {E}_I {\setminus } \Gamma } \eta _{F,4}\).

The above estimates imply that error estimator is reliable, i.e., \(E_h\lesssim \eta \) when \(\ell =1\). This happens, for instance, when \(\Gamma =\Gamma _0\) (see for instance Section 3.4 [22]). In our setting \(\Gamma \) is the union of two disjoint sets \(\Gamma _{QP}\) and \(\Gamma _0\), therefore it is not possible to guarantee \(\ell =1\) in (25). However, the numerical experiments in Sect. 5 suggest that the estimator is still reliable even in this case.

4.2 Local Efficiency

In this section we want to study whether or not our a posteriori error estimator shows local efficiency, based on the techniques devised by Verfürth, applying some properties of the bubble functions. Given an element K, a bubble function is defined as \(B_K:= (d+1)^{d+1}\prod _{i=1}^{d+1} \lambda _i\), where \(\lambda _i\) is a linear nodal function in the i vertex of K. Hence, \(\text{ supp }(B_K) \subset K\), \(B_K=0\) on \(\partial K\) and \(B_K \in [0,1]\). If the function is built on a face F, then \(B_{F}:= d^d\prod _{i=1}^{d} \lambda _i\), for i vertex of F. In this case, \(\text{ supp }(B_{F}) \subset \{K \in \mathcal {T}_h: F \subset \partial K\}\), \(B_{F}=0\) on \(\partial K {\setminus } F\) and \(B_{F} \in [0,1]\). Now, let us introduce the properties of the bubble functions, which were proved in [2], Theorems 2.2 and 2.4.

Lemma 8

For given \(K \in \mathcal {T}_h\), \(F \subset \partial K\), \(\phi \in \mathbb {P}(K)\) and \(\psi \in \mathbb {P}(F)\), it holds

$$\begin{aligned} C^{-1} \Vert \phi \Vert _K^2&\le \Vert B_K^{1/2} \phi \Vert _K^2 \le C \Vert \phi \Vert _K^2,\\ C^{-1} \Vert \psi \Vert _F^2&\le \Vert B_F^{1/2} \psi \Vert _F^2 \le C \Vert \psi \Vert _F^2,\\ C \Vert \psi \Vert _F^2&\le \Vert B_F^{1/2} \mathcal {L}(\psi )\Vert _K^2 \le C \Vert \psi \Vert _F^2, \end{aligned}$$

where \(\mathcal {L}: \mathcal {C}(F) \rightarrow \mathcal {C}(K)\), \(\mathcal {L}(\varphi ) \in \mathbb {P}(K)\) and \(\mathcal {L}(\varphi )\vert _{F}=\varphi \), for all \(\varphi \in \mathbb {P}(F)\).

In the following Lemma we will employ the properties stated in Lemma 8, in order to study the efficiency of our estimator.

Lemma 9

For all \(K \in \mathcal {T}_h\), it holds

$$\begin{aligned} \eta _{K,1}&\lesssim \textrm{osc}(\textbf{f}, K)+\Vert p-p_h\Vert _K+\kappa ^2 h_K\Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _K+\Vert \nabla \times (\textbf{u}-\textbf{u}_h)\Vert _K, \end{aligned}$$
(33a)
$$\begin{aligned} \eta _{K,2}&\lesssim \textrm{osc}(\nabla \cdot \textbf{f}, K) + \Vert \nabla (p-p_h)\Vert _K+\kappa ^2 \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _K. \end{aligned}$$
(33b)

Proof

If we define \(R_h:= \textbf{f}-\overline{\epsilon } \nabla p_h + \kappa ^2 \epsilon \textbf{u}_h-\nabla \times \nabla \times \textbf{u}_h\), the proof follows the same steps as the proof of Lemma 6.4 in [13]. \(\square \)

Lemma 10

For all \(K \in \mathcal {T}_h\) and \(F \in \partial K\), there holds

$$\begin{aligned} \eta _{F,3} \lesssim \Vert \textbf{v}_h-\nabla \times \textbf{u}_h\Vert _K. \end{aligned}$$

Proof

The bound is deduced by the definition of \(\eta _{F,3}\) and the discrete trace inequality. \(\square \)

Lemma 11

For all \(F \in \mathcal {E}_I\), there holds

$$\begin{aligned}{} & {} \eta _{F,4} \lesssim \textrm{osc}(\nabla \cdot \textbf{f},\omega _F) +\textrm{osc}(\textbf{f}, \omega _F)\\{} & {} \qquad \qquad \qquad +\kappa ^2 \Vert \epsilon (\textbf{u}-\textbf{u}_h)\Vert _{\omega _F} +\kappa ^2 h_{\omega _F} \Vert \tau _n (p_h-\widehat{p}_h)\Vert _{\partial \omega _F} +\Vert \nabla (p-p_h)\Vert _{\omega _F} \end{aligned}$$

where \(\omega _F:=\cup \{K\in \mathcal {T}_h: \overline{K} \cap \overline{F} \ne \emptyset \}\).

Proof

Let \(F \in \mathcal {E}_I\), for a given \(w\in \textrm{H}_0^1 (\omega _F)\), we consider the product between and w. Then, after applying integration by parts and using the divergence of (2b), we obtain that

from which, using the Lemma 8, the properties of the extension operator \(\mathcal {L}\), choosing , applying Cauchy-Schwarz inequality and inverse inequality it follows that

where, by using the Lemma 8 again, we get

Thus, from (22)

Hence, we conclude the proof from definitions of \(\eta _{F,4}\), \(\eta _{K,2}\) and from (33b). \(\square \)

Proof of Theorem 1

It follows from Corollary 2, Lemmas 9 and 11.

5 Numerical Results

The numerical experiments were carry out by adapting the routines that we used for the implementation of the proposed HDG method in [10].

The stabilization parameters are set to be \(\tau =-i\), \(\tau _n=i\) in all the experiments and therefore, a rate of convergence of order \(h^{k+1}\) in the \(\textrm{L}^2\) norm is expected for smooth solutions.

For an unknown \(w\in \{\varvec{v},\varvec{u},p\}\) the experimental order of convergence is defined as

$$\begin{aligned} r(w)=-3\dfrac{\Vert w-w_{h_1}\Vert _{\Omega }/\Vert w-w_{h_2}\Vert _{\Omega }}{N_1/N_2}, \end{aligned}$$
(34)

where \(N_1\) and \(N_2\) are the number of elements of two consecutive meshes of sizes \(h_1\) and \(h_2\) (\(h_1>h_2)\), respectively. In the same way we define the experimental order of convergence \(r(E_h)\) for the global error \(E_h\) [cf. (5)]. In addition, we recall the global contribution of each of the local error indicators specified in (6), as follows

$$\begin{aligned} \eta _1&:= \left( \sum _{K \in \mathcal {T}_h} \eta _{K,1}^2\right) ^{1/2},&\eta _2&:= \left( \sum _{K \in \mathcal {T}_h} \eta _{K,2}^2\right) ^{1/2},&\eta _1^\partial&:= \left( \sum _{K \in \mathcal {T}_h}\sum _{F \in \partial K} \eta _{F,1}^2 \right) ^{1/2},&\\ \eta _2^\partial&:= \left( \sum _{K \in \mathcal {T}_h}\sum _{F \in \partial K} \eta _{F,2}^2 \right) ^{1/2},\quad&\eta _3^\partial&:= \left( \sum _{K \in \mathcal {T}_h}\sum _{F \in \partial K}\eta _{F,3}^2 \right) ^{1/2}, \quad&\eta _4^\partial&:= \left( \sum _{F \in \mathcal {E}_I} \eta _{F,4}^2\right) ^{1/2}.&\end{aligned}$$

Their respective experimental order of convergence are defined as in (34), where now the error estimator takes the place of the error.

5.1 Uniform Refinement

Example 1

We consider a unit cube \(\Omega := [ 0,1]^3\) divided in two regions \(\Omega _d:=[0,1]\times [0,1]\times [1/2,1]\) and \(\Omega _m:=[0,1]\times [0,1]\times [0,1/2]\), which are discretized by a sequence of quasi-uniform tetrahedral meshes. Each element of the meshes satisfies that its interior belongs to either \(\Omega _d\) or \(\Omega _m\). Based on [19], we choose the wavelength \(\lambda _0:= 4\text{. }5\) (450 nm) and recall that \(\kappa :=2\pi /\lambda _0\), that is, \(\kappa = 1\text{. }3963\). Moreover, we use the following values for the relative electric permittivities, \(\epsilon _d:= 2\text{. }7124\) and \(\epsilon _m:= -5\text{. }8828 + \, i \, 0.6650\), which corresponds to the silicon oxynitride and evaporated silver, respectively. We consider the exact solution \(\textbf{u}(x,y,z):= (0, u_2(x,y,z), 0)^T\), where

$$\begin{aligned} u_2(x,y,z):= {\left\{ \begin{array}{ll} \exp \left( -i \kappa \sqrt{\epsilon _d}\left( z-0\text{. }5\right) \right) +\exp \left( i \kappa \sqrt{\epsilon _d}\left( z-0\text{. }5\right) \right) , \, \text {if} \ z \ge 0\text{. }5,\\ \exp \left( -i \kappa \sqrt{\epsilon _m}\left( z-0\text{. }5\right) \right) +\exp \left( i \kappa \sqrt{\epsilon _m}\left( z-0\text{. }5\right) \right) , \, \text {if} \ z < 0\text{. }5, \end{array}\right. } \end{aligned}$$

assume that \(p(x,y,z):= 0\) and calculate the values of \({\textbf {f}}\) and \({\textbf {g}}\), taking into account the exact solution. We impose quasi-periodic boundary conditions on the vertical walls.

Table 1 Rate of convergence and errors of Example 1 with \(\tau =-i\) and \(\tau _n= i\)
Table 2 Rate of convergence and errors of the boundary terms of the error estimator of Example 1 with \(\tau =-i\) and \(\tau _n= i\)
Table 3 Rate of convergence and errors of the volumetric terms of the error estimator of Example 1 with \(\tau =-i\) and \(\tau _n= i\)

Example 2

In this example we also consider a unit cube \(\Omega := [ 0,1]^3\) but take as exact solution the quasi-periodic function

$$\begin{aligned} u_2(x,y,z):= \exp \left( -i \left[ \kappa _x x+\kappa _y y -\kappa _z (z-1)\right] \right) , \end{aligned}$$

with \(\kappa _x:=\kappa \sin \theta \cos \phi \), \(\kappa _y:= \kappa \sin \theta \sin \phi \), \(\kappa _z:= (\kappa ^2-\kappa _x^2-\kappa _y^2)^{1/2}\), \(\theta := \pi /3\) and \(\phi := \pi \). The boundary conditions on the vertical walls are of quasi-periodic type.

Table 4 Rate of convergence and errors of Example 2 with \(\tau =-i\) and \(\tau _n= i\)
Table 5 Rate of convergence and errors of the boundary terms, that appear in the error estimator of Example 2, with \(\tau =-i\) and \(\tau _n= i\)
Table 6 Rate of convergence and errors of the volumetric terms of the error estimator of Example 2 with \(\tau =-i\) and \(\tau _n= i\). Effectivity index of the error estimator

In the history of convergence displayed in Tables 1 and 4, it is observed a rate of convergence of \(k+1\) for the both unknowns, \(\textbf{u}\) and \(\textbf{v}\), which is better than the predicted results in the Corollary 1. Moreover, we include the error of the a posteriori error estimator and its associated rate of convergence, which tends to the expected order k.

The error indicators and their rates of convergence appear in Tables 2, 3, 5 and 6. As we pointed out before, in this case the continuous embedding (25) holds true for \(\ell \in (0,1)\), therefore Corollary 2 cannot guarantee reliability of the estimator. However, the effectivity index, \(\textrm{eff}:=\eta /E_h\) reported included in Tables 3 and 6 remains bounded for each polynomial degree.

5.2 Adaptive Refinement

The adaptive refinement can be carried out following the next steps:

  • Solve the variational problem in a coarse mesh.

  • Estimate \(\eta _K\), for each \(K \in \mathcal {T}_h\).

  • Mark each \(\widetilde{K} \in \mathcal {T}_h\) such that \(\eta _{\widetilde{K}} > \theta \max _{K \in \mathcal {T}_h} \eta _K\), for \(\theta \in [0,1]\).

  • Refine the coarse mesh and repeat the algorithm until the established stopping criterion allows it. In this step, we use the free library TetGen integrated with MATLAB, see https://wias-berlin.de/software/tetgen/.

In the adaptive procedure, the a posteriori error indicators help to identify the elements of a mesh where the errors are bigger than others. Once those parts are found, the algorithm refine them to generate a new refined mesh, as we will illustrate in the following example.

Example 3

(L-shaped domain) With the aim to illustrate the adaptive performance of our HDG scheme, we include an experiment in a L-shaped domain \(\Omega := [-1,1]\times [-1,1]\times [0,1]{\setminus } ([0,1]\times [-1,0]\times [0,1])\) occupied by a material with relative permittivity \(\epsilon := 1\). As in Section 5 of [14], let us consider the exact solution \(p(x,y,z):=0\) and \(\textbf{u}(x,y,z):= \displaystyle \bigg (\frac{\partial S}{\partial x}, \frac{\partial S}{\partial y}, 0\bigg )^T\), where \(\displaystyle S(r,\theta ):= r^{\frac{2n}{3}}\sin \bigg (\frac{2n \theta }{3}\bigg )\) is given in terms of cylindrical coordinates \((r,\theta )\) and n is a given number. Moreover, as in the above examples, the source term and boundary data were derived from the exact solution. This manufactured solution belongs to \([\textrm{H}^{t-\delta }(\Omega )]^{3}\) for all \(\delta >0\). The stabilization parameters satisfies \(|\tau |=|\tau _n|=1\) and we choose n such that \(\frac{2n}{3}=t\).

The adaptive refinement of our domain was carried out for \(k=1\) and we began with a coarse mesh of 18 elements, in which were marked the tetrahedra \(\widetilde{K}\) that satisfy the adaptive criterion \(\eta _{\widetilde{K}} > \theta \max _{K \in \mathcal {T}_h} \eta _K\), for \(\theta =0.1\), in order to refine them.

Figure 2 depicts the obtained errors versus the number of the elements when \(t=1.35\), the meshes are uniformly refined (blue) and by using adaptive criterion (red).

Fig. 2
figure 2

Total error \(E_h\) versus number of elements N (logarithmic scale) of the approximation of Example 3. Uniform and adaptive refinements

Fig. 3
figure 3

Approximation of the electric field intensity \(|\varvec{u}_h|\) and corresponding adaptive refined mesh of Example 3 with \(k=1\) and \(N=41226\)

6 Concluding Remarks

In this contribution, we extend our a priori error analysis of the HDG method for Maxwell’s equations in heterogeneous media with Dirichlet boundary condition, to a problem with quasi-periodic boundary conditions on the vertical boundaries of the physical domain. Although, for the real problem it is still necessary to considered transmission conditions on the top and bottom of the cell, the obtained theoretical and numerical results allow us to classify our method as suitable for carrying out the numerical approximation of the solution for this type of boundary value problems (Fig. 3).

With the aim to strengthen our stability estimates, we develop an a posteriori error analysis for the HDG scheme. Based on the confiability and efficiency proofs of the proposed a posteriori error estimator, we decide to corroborate the theoretical results by means of some numerical experiments. In them, we use uniformly refined meshes and depict the history of convergence in some tables.

The performance of the adaptive case was showed for the HDG method proposed for the problem with Dirichlet boundary condition [10]. The behavior of the error can be observed in a graph (Fig. 2), in which it is compared with the obtained error in the case of uniform refinement.