# Implementation of PMDL and DRM in OpenSees for Soil-Structure Interaction Analysis
## 2 Perfectly Matched Discrete Layers
### Implementation
A key feature of the PMDL elements is the use of midpoint integration to eliminate discretization errors. As shown in Figure 4, the model that includes PMDL elements utilizes four types of integration rules: 2 \(\times\) 2 integration for finite elements within the interior domain, 1 \(\times\) 2 integration for PMDL elements in the X direction, 2 \(\times\) 1 integration for PMDL elements in the Z direction, and 1 \(\times\) 1 integration for corner PMDL elements. Table 1 illustrates the abscissas and weights of the numerical integration methodologies. [PERSON] and [PERSON] [26] presented the equation of motion for the entire domain, inclusive of the PMLDs, as illustrated in the following Equations (21) and (22):  
\[M=\int_{-1}^{1}\int_{-1}^{1}\bigg{(}abpN^{T}N\bigg{)}drds \tag{5}\]0 \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Integration Type**} & \multicolumn{4}{c}{**Abscissa**} & \multicolumn{4}{c}{**Weights**} & \multicolumn{2}{c}{**Weights**} \\  & & & **(Local r Direction)** & & **(Local s Direction)** \\ \cline{2-9}  & **r\({}_{1}\)** & **r\({}_{2}\)** & **r\({}_{3}\)** & **r\({}_{4}\)** & **\(W_{1}\)** & **W\({}_{2}\)** & **\(W_{1}\)** & **\(W_{2}\)** \\ \hline
1 \(\times\) 2 integration & \(-0.0\) & \(0.0\) & \(-0.577\) & \(0.577\) & \(2.0\) & \(-\) & \(1.0\) & \(1.0\) \\
2 \(\times\) 1 integration & \(-0.577\) & \(0.577\) & \(0.0\) & \(0.0\) & \(1.0\) & \(1.0\) & \(2.0\) & - \\
1 \(\times\) 1 integration & \(0.0\) & \(0.0\) & \(0.0\) & \(0.0\) & \(2.0\) & - & \(2.0\) & - \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Abscissas and weights of the numerical integration methodologies. Figure 4: Finite elements and PMDL elements. \[\tilde{u}(t)=\int u(t)dt \tag{22}\]  
Here, \(F_{ext}(t)\) denotes the external force vector. Numerical integration methods such as Central Difference, Hilber-Hughes-Taylor and Generalized Alpha are the numerical integration methods used to solve the equation of motion in OpenSees. The classical Newmark-\(\beta\) method is one of these methods which, however, is insufficient to integrate (21). As a result, the Extended Newmark-\(\beta\) method is used to solve (21). To address (23), it is necessary to calculate and update the stiffness matrix and force vector at each step, since their relations are defined incrementally in (24)-(25). \[K_{eff}\Delta u=F_{R} \tag{23}\]  
\[K_{eff}=K+\left(\frac{1}{\beta\Delta t^{2}}\right)M+\left(\frac{\tilde{\gamma }}{\beta\Delta t}\right)C+\left(\frac{\bar{\kappa}\Delta t}{\bar{\beta}} \right)R \tag{24}\]  
\[ \begin{split} F_{R}=F_{ext}^{t+\Delta t}-Ku^{t+\Delta t}-\Big{[} \Big{(}\frac{1}{\bar{\beta}\Delta t^{2}}\Big{)}M+\Big{(}\frac{\bar{\gamma}}{ \beta\Delta t}\Big{)}C+\left(\frac{\bar{\kappa}\Delta t}{\bar{\beta}}\right) R\Big{]}\Delta u+\Big{[}\Big{(}\frac{1}{\bar{\beta}\Delta t}\Big{)}M-\Big{(}1- \frac{\bar{\gamma}}{\beta}\Big{)}C+\Delta t^{2}\Big{(}\frac{\bar{\beta}-2 \bar{\kappa}}{2\bar{\beta}}\Big{)}R\Big{]}\dot{u}^{t}\\ +\bigg{[}\Big{(}\frac{1}{2\bar{\beta}}-1\Big{)}M-\Delta t\Big{(} 1-\frac{\bar{\gamma}}{2\bar{\beta}}\Big{)}C-\Delta t^{3}\Big{(}\frac{\bar{ \beta}-3\bar{\kappa}}{6\bar{\kappa}\bar{\beta}}\Big{)}R\Big{]}\ddot{u}^{t}- \big{(}\tilde{u}^{t}+\Delta tu^{t}\big{)}R\end{split}  \tag{25}\]  
where, \(F_{R},\ K_{eff},\ \Delta u,\ \Delta t\) denote the residual force vector, effective stiffness matrix, incremental displacement vector, and time-step, respectively. The time increment values \((\bar{\alpha},\bar{\beta},\bar{\gamma})\) for the Extended Newmark-\(\beta\) method are provided in Table 2 with the expressions for acceleration \((\bar{u})\), velocity \((\dot{u})\), and the time integration of displacements \((\overline{u})\) presented through (26), (27), and (28), respectively.