## 2 Materials and Methods
### Variational Formulation
#### 2.2.3 Domain Discretization
\begin{array}{cc}x_{1}-x_{3}&x_{2}-x_{3}\\ y_{1}-y_{3}&y_{2}-y_{3}\end{array} \right).\]  
Knowing that \(\varphi_{\widehat{i}}(\bar{\xi},\eta)=\varphi_{\widehat{i}}(x(\bar{\xi},\eta),y(\bar{\xi},\eta))\), the derivatives of the functions global values in terms of local derivatives are given by:  
\[\frac{\partial\varphi_{\widehat{i}}}{\partial\bar{\xi}}=\frac{\partial\varphi _{i}}{\partial x}\frac{\partial x}{\partial\bar{\xi}}+\frac{\partial\varphi _{i}}{\partial y}\frac{\partial y}{\partial\bar{\xi}}=\frac{\partial\varphi _{i}}{\partial x}(x_{1}-x_{3})+\frac{\partial\varphi_{i}}{\partial y}(y_{1}-y_ {3})\text{ and }\]  
\[\frac{\partial\varphi_{\widehat{i}}}{\partial\eta}=\frac{\partial\varphi_{i}} {\partial x}\frac{\partial x}{\partial\eta}+\frac{\partial\varphi_{i}}{ \partial y}\frac{\partial y}{\partial\eta}=\frac{\partial\varphi_{i}}{\partial x }(x_{2}-x_{3})+\frac{\partial\varphi_{i}}{\partial y}(y_{2}-y_{3}).\]  
Matrix-wise, we have \[\left( \begin{array}{c}\frac{\partial\varphi_{\widehat{l}}}{\partial\xi}\\ \frac{\partial\varphi_{\widehat{l}}}{\partial\eta}\end{array} \right)=\left( \begin{array}{cc}x_{1}-x_{3}&y_{1}-y_{3}\\ x_{2}-x_{3}&y_{2}-y_{3}\end{array} \right)\left( \begin{array}{c}\frac{ \partial\varphi_{\widehat{l}}}{\partial x}\\ \frac{\partial\varphi_{\widehat{l}}}{\partial y}\end{array} \right)=\left(JT_{e }\right)^{T}\left( \begin{array}{c}\frac{\partial\varphi_{\widehat{l}}}{ \partial x}\\ \frac{\partial\varphi_{\widehat{l}}}{\partial y}\end{array} \right).\]  
Calling \(T=\left((JT_{e})^{T}\right)^{-1}\), we have  
\[\left( \begin{array}{c}\frac{\partial\varphi_{\widehat{l}}}{\partial x}\\ \frac{\partial\varphi_{\widehat{l}}}{\partial y}\end{array} \right)=T\left( \begin{array}{c}\frac{\partial\varphi_{\widehat{l}}}{\partial\xi}\\ \frac{\partial\varphi_{\widehat{l}}}{\partial\eta}\end{array} \right).\]  
Using this relationship, it is possible to write  
\[\frac{\partial\varphi_{\widehat{l}}}{\partial x}=\left(T_{11}\quad T_{12} \right)\left( \begin{array}{c}\frac{\partial\varphi_{\widehat{l}}}{\partial \xi}\\ \frac{\partial\varphi_{\widehat{l}}}{\partial\eta}\end{array} \right)=T(1,:) \left( \begin{array}{c}\frac{\partial\varphi_{\widehat{l}}}{\partial\xi}\\ \frac{\partial\varphi_{\widehat{l}}}{\partial\eta}\end{array} \right)\]  
\[\frac{\partial\varphi_{\widehat{l}}}{\partial y}=\left(T_{21}\quad T_{22} \right)\left( \begin{array}{c}\frac{\partial\varphi_{\widehat{l}}}{\partial \xi}\\ \frac{\partial\varphi_{\widehat{l}}}{\partial\eta}\end{array} \right)=T(2,:) \left( \begin{array}{c}\frac{\partial\varphi_{\widehat{l}}}{\partial\xi}\\ \frac{\partial\varphi_{\widehat{l}}}{\partial\eta}\end{array} \right)\]  
with \(T(1,:)\) and \(T(2,:)\) being the first and second lines of \(T\), respectively. With the derivatives of the global basis functions written as a linear combination of the local basis functions, it is possible to write the integrals over the global elements as a function of the integrals over the reference element. Calculations are divided into cases. First case:  
\[\left(\varphi_{\widehat{l}},\varphi_{\widehat{l}}\right)_{k_{e}}=\iint_{k_{e }}\varphi_{\widehat{l}}\varphi_{\widehat{l}}idylx=\iint_{k}\varphi_{\widehat{l}} \varphi_{\widehat{l}}\left|\det JT_{e}\right|\int_{\widehat{k}}\varphi_{ \widehat{l}}\varphi_{\widehat{l}}d\eta d\xi=|\det JT_{e}|\iint_{\widehat{k}} \varphi_{\widehat{l}}\varphi_{\widehat{l}}d\eta d\xi=|\det JT_{e}|(\varphi_{ \widehat{l}},\varphi_{\widehat{l}})_{\widehat{k}}.\]  
Second case:  
\[\left(\frac{\partial\varphi_{\widehat{l}}}{\partial x},\frac{ \partial\varphi_{\widehat{l}}}{\partial x}\right)_{k_{e}} = \iint_{k}\frac{\partial\varphi_{\widehat{l}}}{\partial x}\frac{ \partial\varphi_{\widehat{l}}}{\partial x}dydx\] \[= \iint_{\widehat{k}}\left[\left(T_{11}\quad T_{12}\right)\left( \begin{array}{c}\frac{\partial\varphi_{\widehat{l}}}{\partial\xi}\\ \frac{\partial\varphi_{\widehat{l}}}{\partial\eta}\end{array} \right)\right] \left[\left(T_{11}\quad T_{12}\right)\left(