# Implementation of PMDL and DRM in OpenSees for Soil-Structure Interaction Analysis
## 2 Perfectly Matched Discrete Layers
### Implementation  
The half-space problem illustrated in Figure 2a, can be represented through a combination of a domain of interest and an absorbing region like PMDLs (see Figure 2b). According to theoretical principles, PMDLs comprise layers with both real and imaginary lengths. Consequently, four distinct types of PMDL elements are identified as shown in Figure 2c. The first type is the regular PMDL element, characterized by real lengths in both the x and z directions. The second type, the PMDLXX element, has imaginary length in the x direction, and real length in the z direction. The third type, the PMDLZZ element, features real dimensions in the x direction and imaginary dimensions in the z direction. Lastly, the PMDLXZ element possesses imaginary length in both the x and z directions. The PMDLs are modeled using these four types of elements. The top surface of the domain of interest (Figure 2b) can be modeled with complex topography, while all other surfaces related to the PMDLs should be represented as flat surfaces. Additionally, the domain of interest is modeled using conventional four-node quadrilateral elements. The real and imaginary lengths of PMDLs in the x and z directions can be calculated using (1)-(2). \[ \begin{array}{c}L_{xj}^{R}=\frac{4H}{2j-1}\ (j=1,2,3\ldots,m)\\ L_{xk}^{I}=-\frac{2V_{x}}{\omega\cos\theta_{xk}}\ (k=1,2,3\ldots,n)\\ \theta_{xk}=\frac{\pi(k-1)}{2n}\end{array}  \tag{1}\]  
\[ \begin{array}{c}L_{zj}^{R}=\frac{4H}{2j-1}\left[\frac{2(1-v)}{1-2v}\right]^{ -\frac{1}{2}}\ (j=1,2,3\ldots,m)\\ L_{zk}^{I}=-\frac{2V_{z}}{\omega\cos\theta_{xk}}\ (k=1,2,3\ldots,n)\\ \theta_{zk}=\frac{\pi(k-1)}{2n}\end{array}  \tag{2}\]  
In Equations (1) and (2), \(L_{xj}^{R}\) and \(L_{zj}^{R}\) refer to the lengths of the j-th real layer in the x- and z-directions, respectively. Similarly, \(L_{xk}^{I}\) and \(L_{zk}^{I}\) represent the lengths of the k-th imaginary layer in the x- and z-directions. The variables \(V_{x}\) and \(V_{z}\) indicate the reference velocities in the x- and z-directions. The parameters \(m\) and \(n\) correspond to the number of real and imaginary layers, respectively. \(H\) stands for the height of the interior domain, while \(\omega\) and \(v\) represent the excitation frequency and Poisson's ratio, respectively. Figure 3a,b illustrates the global and local coordinates for the PMDLs. Additionally, the dynamic stiffness matrix of the element is calculated using (3), as outlined by [44,45]. \[S=K+i\omega C-\omega^{2}M \tag{3}\]The stiffness and mass matrices of the PMDL element shown in Figure 3, can be written as follows:  
\[K=\int_{-1}^{1}\int_{-1}^{1}\bigg{(}\frac{b}{a}B_{rr}^{T}D_{rr}B_{rr}+\frac{a}{b} B_{ss}^{T}D_{ss}B_{ss}+B_{rs}^{T}D_{rs}B_{rs}+B_{sr}^{T}D_{sr}B_{sr}\bigg{)}drds \tag{4}\]  
\[M=\int_{-1}^{1}\int_{-1}^{1}\bigg{(}abpN^{T}N\bigg{)}drds \tag{5}\]  
The strain-displacement matrices (\(B_{rr},B_{rs},B_{sr},B_{ss}\)), elasticity matrices (\(D_{rr},D_{ss},D_{ss}\)), shape functions (\(N_{i}\)), and the shape function matrix (\(N\)) used herein are provided in Appendix A. In this research, the soil is considered to be elastic, and Rayleigh damping is utilized with a 2% damping ratio to represent a typical soil medium, as defined in [46] and described in (6). \[C=\alpha M+\beta K \tag{6}\]  
Figure 3: PMDL element: (**a**) global coordinates; (**b**) local coordinates. Figure 2: (**a**) Half-space problem; (**b**) Interior domain with PMDLs; (**c**) Four types of PMDL elements. Here, \(\alpha\) and \(\beta\) are the Rayleigh damping parameters that are proportional to mass and stiffness, respectively. In the case of transient waves, the dimensions of the PMDL elements are real. Consequently, the dynamic stiffness matrix \(S\) in (3) is formulated using standard finite elements but with the midpoint integration rule. In contrast, for the propagation of waves, the dimensions of the PMDL elements are imaginary. In order to employ the PMDL elements in the time-domain, it is necessary to eliminate the imaginary lengths.