# Planar Delaunay Mesh Smoothing Method Based on Angle and a Deep Q-Network
## 1 Introduction  
Numerical mesh generation is a preprocessing step in finite element analysis. Mesh generation is the basis of finite element calculations, and high-quality meshes are critical to the results of finite element calculations [1]. Delaunay triangulation is one of the most general automatic finite element mesh generation methods [2]. Due to the influence of internal node insertion, boundary constraints, element size transition, and other factors, the initial mesh formed using the Delaunay triangulation algorithm will have poor elements in local areas. These poor elements will affect the accuracy and efficiency of the finite element calculation [3]. For example, larger element angles lead to larger gradient errors, while smaller angles significantly increase the stiffness matrix condition [4; 5], which reduces the solution accuracy and convergence of the iterative solvers. Thus, mesh smoothing is required to improve mesh quality after finite element mesh generation [6]. The optimization methods of a finite element mesh can be divided into topology optimization [7] and geometric optimization according to whether the topology changes in the optimization process. Geometric optimization is also called smoothing; compared with topology optimization, geometric optimization does not change the mesh topology. Laplacian smoothing [8; 9; 10; 11; 12; 13] is the simplest method, so it is often used. However, using too many iterations of Laplacian smoothing will cause excessive smoothing and reduce the mesh quality. Researchers have proposed an angle-based smoothing method to overcome the shortcomings of Laplacian smoothing [14; 15]. This method neglects the selection of the optimal central node coordinates, resulting in an insufficient mesh quality distribution concentration. The optimization-based smoothing method uses some quality metrics todefine the cost function, and moving the mesh nodes minimizes or maximizes the cost function. Standard optimization methods include the steepest descent method [16; 17], conjugate gradient method [18; 19], Newton method [20; 21], and downhill simplex method [22]. Optimal Delaunay triangulation (ODT) [23] and centroid Voronoi tessellation (CVT) [24] are two widely used mesh smoothing algorithms based on optimization. This kind of method can achieve a higher-quality mesh optimization, but it has higher computational complexity. The computational cost of mesh smoothing based on optimization is much higher than that of Laplacian smoothing [13]. With the development of artificial intelligence, researchers have begun to explore the application of neural networks and reinforcement learning to mesh generation and smoothing. Ref. [25] proposed a smoothing method based on a neural network. Although this method can improve the average quality of a mesh, it will reduce the minimum mesh quality. Ref. [26] used a deep neural network to predict the optimal locations of nodes. This method can improve the mesh quality but requires tens of thousands of samples with labels, and the training costs are high. Ref. [27] proposed a mesh smoothing method based on a deep Q-network (unconstrained DQN). This method does not limit the active area of the central node. When the central node is close to the polygon boundary, it does not improve the element quality. Through the analysis in Sections 4.2 and 4.3, we found that the generalization performance of the DQN model trained using this method was low, and it did not have a good optimization effect on meshes that have not participated in the training. The generalization performance is an important characteristic of the DQN model, which determines whether the DQN model has universally applicable properties when dealing with problems in this field. This paper proposes a planar Delaunay mesh smoothing method based on angle and a deep Q-network.