# Three-Dimensional Hyperbolic Mesh Generation Method Based on the Neural Network
## 2 Methodology
As shown in the second image, the red points \(P_{i}\) on the initial surface are used for data driving of the neural network, it needs to cover the entire initial surface. The yellow points \(P_{n}\) on the outer surface are used for variance constraints, it also needs to cover the entire surface. The blue points \(P_{m}\) and green points \(P_{j}\) on the two sets of constraint surfaces are used to constrain the boundaries along the advancing direction. The range of points on these constraint surfaces can be determined based on the scope of the grid to be generated. Additionally, gray points \(P_{k}\) need to be placed within the spatial range of the region that needs to be meshed because it constrains the governing equations. A neural network with three inputs and three outputs is selected to fit the governing equations defined on three-dimensional solids, denoted as:  
\[u^{\prime}(x^{\prime},y^{\prime},z^{\prime},\theta^{\prime}). \tag{10}\]  
Therefore, the points on the initial surface need to be assigned values for all three computational domain coordinates. For \(\xi\) and \(\eta\), we assign values ranging from 0.1 to 0.9, with the strategy of increasing along the positive \(x\)-axis and positive \(y\)-axis directions,respectively. For \(\zeta\), all values are set to 0.1. Denote the assigned values as \(T^{\prime}\), the loss on the initial surface could be written as:  
\[\sum(u^{\prime}-T^{\prime})_{P_{\rm{i}}}^{2}. \tag{11}\]  
According to the value assign strategy of the initial surface, the two surfaces sampled by blue points will be constrained with parameter \(\xi\) and the network should output 0.1 on the left surface and 0.9 on the right surface. In the same way, the two surfaces sampled by green points will be constrained with parameter \(\eta\). The network should output 0.1 on the front surface and 0.9 on the back surface. Denote the target value of \(\xi\) as \(T^{\prime}_{\xi}\) and the target value of \(\eta\) as \(T^{\prime}_{\eta}\), and the loss on the constraint surface could be written as:  
\[\overline{\sum}(u^{\prime}_{\xi}-T^{\prime}_{\xi})_{P_{\rm{m}}}^{2}+\overline{ \sum}(u^{\prime}_{\eta}-T^{\prime}_{\eta})_{P_{\rm{j}}}^{2}. \tag{12}\]  
Similar to the three-dimensional surface, the gray points inside the spatial region are used to calculate the loss of the governing equations. Based on Equation (3), the loss of the governing equation can be expressed as:  
\[\sum(\
abla u^{\prime}_{\xi}\times\
abla u^{\prime}_{\xi})_{P_{\rm{k}}}^{2}+ \overline{\sum}(\
abla u^{\prime}_{\eta}\times\
abla u^{\prime}_{\xi})_{P_{ \rm{k}}}^{2}+\overline{\sum}(\
abla u^{\prime}_{\xi}\cdot(\
abla u^{\prime}_{ \xi}\times\
abla u^{\prime}_{\eta})-J^{\prime}_{\rm{r}})_{P_{\rm{k}}}^{2}. \tag{13}\]  
Finally, the loss value on the outer surface needs to be calculated; it is also only necessary when the region that needs to be meshed is close to the outer boundary. The loss function is:  
\[\overline{\sum}(\mathrm{var}(u^{\prime}_{\xi}))_{P_{\rm{m}}}. \tag{14}\]  
As a result, the total loss of the three-dimensional solid model is:  
\[ \begin{array}{l}Loss^{\prime}=\overline{\sum}(u^{\prime}-T^{\prime})_{P_{ \rm{i}}}^{2}+\overline{\sum}(u^{\prime}_{\xi}-T^{\prime}_{\xi})_{P_{\rm{m}}}^ {2}+\overline{\sum}(u^{\prime}_{\eta}-T^{\prime}_{\eta})_{P_{\rm{j}}}^{2}+ \left\langle\overline{\sum}(\mathrm{var}(u^{\prime}_{\xi}))_{P_{\rm{j}}} \right\rangle+\\ \overline{\sum}(\
abla u^{\prime}_{\xi}\times\
abla u^{\prime}_{\xi})_{P_{\rm {k}}}^{2}+\overline{\sum}(\
abla u^{\prime}_{\eta}\times\
abla u^{\prime}_{ \xi})_{P_{\rm{k}}}^{2}+\overline{\sum}(\
abla u^{\prime}_{\zeta}\cdot(\
abla u ^{\prime}_{\xi}\times\
abla u^{\prime}_{\eta})-J^{\prime}_{\rm{r}})_{P_{\rm{k }}}^{2}\end{array} . \tag{15}\]  
Based on the constructed total loss function concerning three-dimensional surfaces and solids, the neural network could be trained.