# Three-Dimensional Hyperbolic Mesh Generation Method Based on the Neural Network
## 2 Methodology
Under these circumstances, they do not represent the size of the grid; otherwise, they denote the ratio of the area or volume between the computational domain and the physical domain. After determining the governing equations, the generation of hyperbolic grids mainly involves four steps: dataset preparation, loss function construction, neural network training, and mesh generation. The dataset preparation and loss function construction for three-dimensional surface and solid are shown in Figure 2, which are arranged in rows. Figure 2: The process of sample points on the model and construct the loss function: (**a**) three-dimensional surface; (**b**) three-dimensional solid. Considering the three-dimensional surface model in Figure 2. In the data preparation phase, we first need to divide the four boundaries into the initial boundary, the constraint boundaries along the advancing direction, and the outer boundary. The initial boundary and outer boundary correspond to the range of variation of parameter \(\eta\), which is also the direction of grid generation. The range of variation for parameter \(\xi\) lies between the constraint boundaries. Subsequently, we place numerous data points on these boundaries and the interior region of the surface to construct our dataset, as shown in the second image of the first row in Figure 2. Points on the initial boundary are marked in red, denoted as \(P_{i}\), points on the constraint boundaries are marked in green, denoted as \(P_{i}\), points on the outer boundary are marked in yellow, denoted as \(P_{n}\), and points on the interior region are marked in grey, denoted as \(P_{k}\). After some numerical tests, using Sigmoid as the activation function of the output layer of the neural network and modifying the range of all computational space to 0.1-0.9 can effectively achieve the solution of two-dimensional hyperbolic mesh generation in the physical domain. Therefore, for three-dimensional hyperbolic grid generation, we implemented the same pattern. Considering the variable number of the physical domain and the computational domain for a three-dimensional surface, we adopted a neural network with three inputs and two outputs, denoted as:  
\[u(x,y,z,\theta), \tag{4}\]  
\(\theta\) means all the weights and biases of the neural network, the structure of the neural network is shown in the third image of the first row in Figure 2. This network will be used to fit the solutions of equation set 2 that is defined on different surfaces. It is important to note that models with larger spatial ranges need to be generated sequentially through multiple solving processes, which means the equation set 2 will be defined and solved repeatedly on the different partial surfaces. Within each solving process, the computational space coordinates must be set to 0.1-0.9. After the neural network is defined, accurately constructing the loss function to ensure that the neural network converges to the correct solution is key to this method. Considering the range of the computational domain, we first assigned different \(\xi\) and \(\eta\) values to the points on the initial boundary in a clockwise direction. \(\xi\) was assigned increasingly with a range from 0.1 to 0.9, \(\eta\) was all assigned to 0.1. These points are the only ones in the entire process for which all corresponding values can be predetermined. Therefore, they serve as the data driver for the neural network. If \(u\) is the solution of equation set 2 on the surface, then the error of the output values of \(u\) at these points should approach 0. So, denote the assigned values as T, and the first part of the loss function could be written as:  
\[\overline{\sum}(u-T)_{P_{i}}^{2}, \tag{5}\]  
where the horizontal bar above the summation symbol represents the mean of the summed values.