## 2 Methods
### Multistencil Fast Marching Method  
In order to improve the accuracy of the eikonal equation in the Cartesian domain, this paper introduces a Multistencil fast marching method (MSFM) based on FMM [41]. Figure 3 shows two templates used by the MSFM, where template 1 is used by the FMM, covering the neighboring points in the direction of the coordinate axis. Template 2 is generated by the coordinate transformation of the FMM template, covering the adjacent points in the diagonal direction. Let  
Figure 1: Schematic diagram of T0 difference method. Figure 2: Two-layer undulating interface model and T0 difference method results. \(\overrightarrow{r}_{1}=[r_{11},r_{12}]^{T}\) and \(\overrightarrow{r}_{2}=[r_{21},r_{22}]^{T}\) denote the unit vectors along \(\overrightarrow{p_{2}p_{1}}\) and \(\overrightarrow{q_{2}q_{1}}\) directions, respectively. \(U_{1}\) and \(U_{2}\) represent the travel time directional derivatives along \(\overrightarrow{r}_{1}\) and \(\overrightarrow{r}_{2}\), respectively. Then, \(U_{1}\) and \(U_{2}\) can be expressed as  
\[U_{1}=\overrightarrow{r}_{1}\cdot\
abla T(x,y)=r_{11}T_{x}+r_{12}T_{y} \tag{12}\]  
\[U_{2}=\overrightarrow{r}_{2}\cdot\
abla T(x,y)=r_{21}T_{x}+r_{22}T_{y} \tag{13}\]  
where \(T_{x}=\frac{\partial T}{\partial x}\) and \(T_{y}=\frac{\partial T}{\partial y}\) represent the partial derivatives of \(T\) to \(x\) and \(y\), respectively. Therefore, Formulas (12) and (13) can be written in the form of matrix multiplication:  
\[\left[ \begin{array}{c}U_{1}\\ U_{2}\end{array} \right]=\left[ \begin{array}{cc}r_{11}&r_{12}\\ r_{21}&r_{22}\end{array} \right]\left[ \begin{array}{c}T_{x}\\ T_{y}\end{array} \right] \tag{14}\]  
Assuming that \(\Delta x=\Delta y=h\), then the angle between \(\overrightarrow{r}_{1}\) and \(\overrightarrow{r}_{2}\) is \(90^{\circ}\), the following formula can thus be obtained:  
\[U_{1}^{2}+U_{2}^{2}=S^{2}(x,y) \tag{15}\]  
For Templates 1 and 2, when the first-order finite difference forms are selected, Formula (15) can be expressed as Formulas (16) and (17):  
\[\max\left(\frac{T_{i,j}-T_{1}}{h},0\right)^{2}+\max\left(\frac{T_{i,j}-T_{2}}{ h},0\right)^{2}=S_{i,j}^{2} \tag{16}\]  
\[\max\left(\frac{T_{i,j}-T_{1}}{\sqrt{2}h},0\right)^{2}+\max\left(\frac{T_{i,j} -T_{2}}{\sqrt{2}h},0\right)^{2}=S_{i,j}^{2} \tag{17}\]  
where \(T_{1}=\min\left(T_{i-1,j},T_{i+1,j}\right)\) and \(T_{2}=\min\left(T_{i,j-1},T_{i,j+1}\right)\). For Templates 1 and 2, when the second-order finite difference forms are selected, Formula (15) can be expressed as Formulas (18) and (19):  
\[\max\left(\frac{3}{2h}(T_{i,j}-T_{1}),0\right)^{2}+\max\left(\frac{3}{2h}(T_{i,j}-T_{2}),0\right)^{2}=S_{i,j}^{2} \tag{18}\]  
\[\max\left(\frac{3}{2\sqrt{2}h}(T_{i,j}-T_{1}),0\right)^{2}+\max\left(\frac{3} {2\sqrt{2}h}(T_{i,j}-T_{2}),0\right)^{2}=S_{i,j}^{2} \tag{19}\]  
where \(T_{1}=\min\left(\frac{4T_{i,j-1}-T_{i-2,j}}{3},\frac{4T_{i+1,j}-T_{i+2,j}}{3}\right)\) and \(T_{2}=\min\left(\frac{4T_{i,j-1}-T_{i,j-2}}{3},\frac{4T_{i,j+1}-T_{i,j+2}}{3}\right)\). Figure 3: Two templates used by the multi-stencil fast marching method (MSFM) algorithm. (**a**) Template 1; (**b**) Template 2. Numerical simulation comparison between MSFM and FMM  
The homogeneous model is shown in Figure 4. The number of grids is \(100\times 100\). The vertical and horizontal grid spacing is \(10\) m, and the source point position is (51). The theoretical value \(T_{a}\) of the travel time at each grid node is  
\[T_{a}=\sqrt{\left(x-x_{0}\right)^{2}+\left(y-y_{0}\right)^{2}} \tag{20}\]  
where \((x_{0},y_{0})\) is the coordinate of the source, and Figure 4b is the theoretical travel time contour of the homogeneous model. Figure 5 shows a comparison between the theoretical travel time and the calculated travel time of FMM and MSFM. The red line represents the theoretical travel time and the blue line represents the calculated travel time. Figure 5a,c shows the first-order and second-order computational and theoretical travel time contours of the FMM algorithm, respectively.