## 4 Derivation of Computational Schemes
### Finite Element Discretization in \(\Omega\)  
First, we derive the finite element scheme to solve the model problem (8) in whole \(\Omega\). The restriction of this FE solution to the inner \(\partial\Omega_{FDM}\) is the approximation for \(E|_{\partial}\Omega_{FDM}\)Next, we discretize \(\Omega_{FEM_{T}}=\Omega_{FEM}\times(0,T)\) in two steps: (i) the spatial discretization using a partition \(\mathcal{T}_{h}\) of \(\Omega_{FEM}\) into elements \(K\), where \(h=h(x)\) is a mesh function defined as \(h|_{K}=h_{K}\), representing the local diameter of elements. We also denote by \(\partial\mathcal{T}_{h}\) a partition of the boundary \(\partial\Omega_{FEM}\) into boundaries \(\partial K\) of the elements \(K\) such that in \(2D\), two of the vertices, and in \(3D\), three of the vertices of these elements belong to \(\partial\Omega_{FEM}\). As usual, we also assume a minimal angle condition on elements \(K\) in \(K_{h}\), see details in [45]. (ii) As for temporal discretization, we let \(J_{\tau}\) be a uniform partition of the time interval \((0,T)\) into \(N\) subintervals \(J=(t_{k-1},t_{k}]\) of length \(\tau=T/N.\) Our implementations are for fully discrete, space-time scheme. However, temporal discretization (ii), being well-studied in the literature, is not considered in the analysis here. To formulate the finite element method for (8) in \(\Omega\), we introduce the finite element space \(W_{h}^{E}(\Omega)\) for each component of the electric field \(E\) defined by  
\[W_{h}^{E}(\Omega):=\{w\in H^{1}(\Omega):w\big{|}_{K}\in P_{1}(K),\quad\forall K \in\mathcal{T}_{h}\},\]  
where \(P_{1}(K)\) denote the set of piecewise-linear functions on \(K.\) Setting \(\mathbf{W}_{h}^{E}(\Omega):=[W_{h}^{E}(\Omega)]^{3}\), and because of the homogeneous Dirichlet boundary data in (8) we need to choose the test function space as  
\[\mathbf{W}_{h,0}^{E}:=\{\mathbf{v}\in\mathbf{W}_{h}^{E}:\quad\mathbf{v}=0, \quad\text{on}\quad\partial\Omega\}. \tag{10}\]  
Then, recalling (5) and the Dirichlet boundary condition in (8) the spatial semi-discrete problem in \(\Omega\) reads:  
_Find \(E_{h}\in\mathbf{W}_{h,0}^{E}(\Omega)\) such that \(\forall\mathbf{v}\in\mathbf{W}_{h,0}^{E}(\Omega)\),_  
\[(\varepsilon\partial_{tt}E_{h},\mathbf{v})+(\
abla E_{h},\
abla \mathbf{v})+(\
abla\cdot(\varepsilon E_{h}),\
abla\cdot\mathbf{v})-(\
abla \cdot E_{h},\
abla\cdot\mathbf{v})\] \[\qquad\qquad-\langle\partial_{n}E_{h},\mathbf{v}\rangle_{ \partial\Omega}-\langle n\cdot(\
abla\cdot(\varepsilon-1)E_{h}),\mathbf{v} \rangle_{\partial\Omega}:=\sum_{j=1}^{6}T_{j}=0, \tag{11}\] \[E_{h}(\cdot,0)=f_{0,h}(\cdot)\quad\text{and}\quad\partial_{t}E_{ h}(\cdot,0)=f_{1,h}(\cdot)\quad\text{in}\ \Omega.\]  
where \(f_{0,h}\) and \(f_{1,h}\) are suitable approximations for the initial data, specified below. Further, we note that  
\[T_{3}=(\
abla\cdot(\varepsilon E_{h}),\
abla\cdot\mathbf{v})=(\
abla \epsilon\cdot E_{h},\
abla\cdot\mathbf{v})+(\varepsilon\
abla\cdot E_{h}, \
abla\cdot\mathbf{v}),\]  
implies  
\[T_{3}+T_{4} =(\
abla\cdot(\varepsilon E_{h}),\
abla\cdot\mathbf{v})-(\
abla \cdot E_{h},\
abla\cdot\mathbf{v})\] \[=(\
abla\epsilon\cdot E_{h},\
abla\cdot\mathbf{v})+\Big{(}( \varepsilon-1)\
abla\cdot E_{h},\
abla\cdot\mathbf{v}\Big{)}. \tag{12}\]  
Recalling (10), vanishing test functions at the boundary yields \(T_{5}=T_{6}\equiv 0\) ( \(\varepsilon=1\) on \(\partial\Omega\) yields \(T_{6}=0\)), and the final weak formulation for the semi-discrete problem in \(\Omega\) is:  
_Find \(E_{h}\in\mathbf{W}_{h,0}^{E}(\Omega)\) such that \(\forall\mathbf{v}\in\mathbf{W}_{h,0}^{E}(\Omega)\),_  
\[B_{\Omega}(E_{h},\mathbf{v}):=(\varepsilon\partial_{tt}E_{h},\mathbf{v})+( \
abla E_{h},\
abla\mathbf{v})+(\
abla\epsilon\cdot E_{h},\
abla\cdot\mathbf{v })+((\varepsilon-1)\
abla\cdot E_{h},\
abla\cdot\mathbf{v})=0. \tag{13}\]  
For the reflexive, inhomogeneous boundary condition, see the FE scheme for \(\Omega_{FEM}\). To get a fully discrete scheme for (8) we apply time discretization to (11).