Gpu-based parallel tetrahedral mesh optimization method, system, device, and medium

By employing a GPU parallel tetrahedral mesh optimization method, and utilizing multi-threaded parallel processing and optimization strategies, the problem of low-quality meshes caused by complex geometries was solved, improving mesh optimization speed and computational efficiency, and enhancing mesh quality.

CN120635366BActive Publication Date: 2025-10-21TAIHANG LABORATORY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511093534.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-10-21
Estimated Expiration
2045-08-06

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively handle low-quality mesh cells caused by complex geometries during mesh generation and optimization, and their computational efficiency is low, affecting the reliability and accuracy of numerical simulations.

Method used

A GPU-based parallel tetrahedral mesh optimization method is adopted, which performs operations such as point smoothing, edge deletion, face deletion, edge shrinking and edge segmentation in parallel through multiple GPU threads. Combined with a priority-based parallel coloring strategy and a contiguous array storage method, the mesh quality is optimized.

Benefits of technology

It improves mesh optimization speed, reduces the computational load on individual GPU threads, avoids control divergence issues, and enhances computational efficiency and mesh quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635366B_ABST
    Figure CN120635366B_ABST
Patent Text Reader

Abstract

The application provides a GPU-based parallel tetrahedral mesh optimization method, system, device and medium, and relates to the technical field of numerical simulation. The method comprises the following steps: generating a triangular mesh covering a surface of a three-dimensional geometric model; generating an initial tetrahedral mesh based on the triangular mesh; performing a round of point smoothing operation on each tetrahedron by using multiple GPU threads; performing an iteration cycle of combined optimization operation, simultaneously performing a round of point smoothing, edge deletion and multi-face deletion operation on multiple starting tetrahedrons by using multiple GPU threads; and when the edge deletion and multi-face deletion operation cannot further improve the mesh quality, simultaneously performing a round of edge contraction and edge segmentation operation on multiple starting tetrahedrons by using multiple GPU threads. The application can quickly generate a large-scale mesh with reliable quality based on a low-quality input mesh, improve the rate of mesh optimization, and meet the demand of large-scale unstructured mesh optimization in a three-dimensional space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of numerical simulation technology, and in particular to a GPU-based parallel tetrahedron mesh optimization method, system, device and medium. Background Art

[0002] After the steps of boundary point insertion, boundary recovery, internal point generation and insertion, a preliminary tetrahedral mesh representing the original geometric model is obtained. However, due to the complexity of the geometric shape, a large number of poorly shaped units may exist in the generated mesh. In order to meet the computational requirements, it is usually necessary to perform a series of point smoothing and topological transformation operations on the mesh to improve the mesh quality. This process is called mesh optimization. Mesh optimization is an indispensable key step after mesh generation and before numerical simulation, and is of great significance for ensuring the reliability and accuracy of numerical simulation.

[0003] A GPU (graphics processing unit) is a specialized electronic circuit designed to render display graphics to an output device. Unlike CPUs, which have a limited number of cores, GPUs are capable of running thousands, or even tens of thousands, of processing cores simultaneously. Although these cores operate slower than CPU cores, they excel at the mathematical calculations required for graphics rendering. This high degree of parallelism makes GPUs suitable for general-purpose computing. In recent years, with the increasing computing power, decreasing costs, and widespread availability of GPUs, using GPUs for mesh optimization has become a viable option. Summary of the Invention

[0004] In view of this, the embodiments of the present application provide a GPU-based parallel tetrahedron mesh optimization method, system, device and medium, which quickly generate large-scale meshes with reliable quality based on low-quality input meshes, improve the rate of mesh optimization, and meet the needs of large-scale unstructured mesh optimization in three-dimensional space.

[0005] The embodiment of the present application provides the following technical solution: a GPU-based parallel tetrahedron mesh optimization method, comprising the following steps:

[0006] Step 1: Generate a surface triangular mesh for the three-dimensional geometric model, and generate an initial tetrahedral mesh based on the triangular mesh;

[0007] Step 2: Based on the parallel coloring strategy determined by priority, a round of point smoothing operation is performed in parallel on all tetrahedrons in the initial tetrahedron mesh using multiple GPU threads to obtain a first updated tetrahedron mesh;

[0008] Step 3: Selecting a tetrahedron with a minimum dihedral angle below a preset threshold in the first updated tetrahedron mesh as a first starting tetrahedron, performing a round of combined optimization operations of point smoothing, edge deletion, and multi-face deletion in parallel on a set operation area centered on the first starting tetrahedron through multiple GPU threads, and iterating the combined optimization operations in a loop to obtain a second updated tetrahedron mesh; wherein the boundaries of adjacent set operation areas do not overlap;

[0009] Step 4: selecting a tetrahedron whose minimum dihedral angle in the second updated tetrahedral mesh is lower than a preset threshold as a second starting tetrahedron, and performing a round of edge contraction and edge splitting operations in parallel on a set operation area centered on the second starting tetrahedron using multiple GPU threads; wherein the boundaries of adjacent set operation areas do not overlap;

[0010] Step 5: Repeat steps 2 to 4 until the total number of cycles reaches the preset upper limit.

[0011] According to an embodiment of the present application, a continuous array storage method is used to record part of the array or all of the arrays set in the tetrahedral mesh information.

[0012] According to one embodiment of the present application, the array recording the tetrahedron mesh information includes the number of vertices, the number of tetrahedrons, the vertex array, the tetrahedron array, the neighbor tetrahedron array and the operation area index array; wherein the vertex array records the coordinates and size of the vertices, and the operation area index array is used to represent the index of the topological transformation operation area corresponding to the tetrahedron.

[0013] According to an embodiment of the present application, in a point smoothing operation, the process of constructing an adjacency relationship between a vertex and a tetrahedron includes:

[0014] Traverse all tetrahedrons and count the number of adjacent tetrahedrons of each vertex;

[0015] Create a global adjacency array, calculate the storage range of each vertex in the global adjacency array through a parallel reduction algorithm, traverse all tetrahedrons twice, and store the index information of each tetrahedron in sequence at the position of the corresponding vertex in the global adjacency array.

[0016] According to an embodiment of the present application, a parallel coloring strategy based on priority determination includes:

[0017] Color the vertices in the vertex array according to priority: in each round of operation, select the vertices with serial numbers less than the serial numbers of all uncolored neighboring points for coloring. When all vertices are colored, add each vertex to the independent point set corresponding to the vertex according to its color to form multiple independent point sets; perform point smoothing operations on each independent point set in turn: perform Laplace point smoothing operations on the vertices in the current independent point set in parallel, record the vertices that failed to be optimized, and perform point smoothing operations based on numerical optimization on the vertices that failed to be optimized.

[0018] According to one embodiment of the present application, the point smoothing operation based on numerical optimization includes:

[0019] In the initial gradient calculation phase, a GPU thread is responsible for calculating the gradient direction and initial gradient magnitude of a vertex;

[0020] In the candidate gradient evaluation phase, the search step size multiplier is pre-set, and a GPU thread is responsible for evaluating the worst cell quality of a vertex corresponding to the new coordinates under the preset step size;

[0021] In the optimal coordinate selection stage, the optimal step size corresponding to each vertex is selected according to the results of the candidate gradient evaluation, and the position of the vertex is moved to optimize the unit quality.

[0022] According to an embodiment of the present application, in the edge deletion operation, a three-dimensional template array is used to implement fine-grained parallel operations, including: constructing a 5×42×15 three-dimensional template array, and mapping each triangulated template of each shell to a GPU thread for quality evaluation through the three-dimensional template array; wherein the first dimension of the three-dimensional template array represents the number of edges of the skirt polygon, the second dimension represents the number of the triangulated template of the skirt polygon, and the third dimension represents the vertex index of the triangulated skirt polygon.

[0023] The present application also provides a GPU-based parallel tetrahedron mesh optimization system, comprising: a graphics processing unit, wherein the graphics processing unit performs the following steps:

[0024] Step 1: Generate a surface triangular mesh for the three-dimensional geometric model, and generate an initial tetrahedral mesh based on the triangular mesh;

[0025] Step 2: Based on the parallel coloring strategy determined by priority, a round of point smoothing operation is performed in parallel on all tetrahedrons in the initial tetrahedron mesh using multiple GPU threads to obtain a first updated tetrahedron mesh;

[0026] Step 3: Selecting a tetrahedron with a minimum dihedral angle below a preset threshold in the first updated tetrahedron mesh as a first starting tetrahedron, performing a round of combined optimization operations of point smoothing, edge deletion, and multi-face deletion in parallel on a set operation area centered on the first starting tetrahedron through multiple GPU threads, and iterating the combined optimization operations in a loop to obtain a second updated tetrahedron mesh; wherein the boundaries of adjacent set operation areas do not overlap;

[0027] Step 4: selecting a tetrahedron whose minimum dihedral angle in the second updated tetrahedral mesh is lower than a preset threshold as a second starting tetrahedron, and performing a round of edge contraction and edge splitting operations in parallel on a set operation area centered on the second starting tetrahedron using multiple GPU threads; wherein the boundaries of adjacent set operation areas do not overlap;

[0028] Step 5: Repeat steps 2 to 4 until the total number of cycles reaches the preset upper limit.

[0029] The present application also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned GPU-based parallel tetrahedron mesh optimization method when executing the computer program.

[0030] The present application also provides a computer-readable storage medium storing a computer program for executing the above-mentioned GPU-based parallel tetrahedron mesh optimization method.

[0031] Compared to existing technologies, the at least one technical solution employed in the embodiments of this specification can achieve at least the following beneficial effects: The embodiments of the present invention rapidly generate high-quality, large-scale meshes based on low-quality input meshes, thereby increasing the rate of mesh optimization. Furthermore, the embodiments of the present invention can effectively reduce the computational load of a single GPU thread and avoid control divergence issues, thereby improving GPU computational efficiency, operational efficiency, and mesh quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0033] Figure 1 1 is a flow chart of a GPU-based parallel tetrahedron mesh optimization method according to an embodiment of the present invention;

[0034] FIG2 is a two-dimensional schematic diagram of the parallel vertex coloring method according to an embodiment of the present invention; FIG2(a) is the initial state; FIG2(b) is the first iteration; FIG2(c) is the second iteration; FIG2(d) is the third iteration; FIG2(e) is the fourth iteration; and FIG2(f) is the fifth iteration.

[0035] Figure 3 is a two-dimensional schematic diagram of parallel edge flipping in an embodiment of the present invention;

[0036] FIG4 is a schematic diagram of various situations of multi-face deletion in an embodiment of the present invention; FIG4(a) is a normal situation; FIG4(b) is a situation where triangles form a closed loop; and FIG4(c) is a situation where multiple connected components are present.

[0037] FIG5 is a two-dimensional schematic diagram of parallel edge contraction / splitting according to an embodiment of the present invention; FIG5(a) is edge contraction; FIG5(b) is edge splitting;

[0038] Figure 6 It is an experimental model for grid optimization in an embodiment of the present invention;

[0039] Figure 7 1 is a schematic diagram of the structure of a GPU-based parallel tetrahedron mesh optimization system according to an embodiment of the present invention;

[0040] Figure 8 It is a structural schematic diagram of the computer device of the present invention. DETAILED DESCRIPTION

[0041] The embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0042] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, in the absence of conflict, the features in the following embodiments and embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative work are within the scope of protection of this application.

[0043] like Figure 1 As shown, an embodiment of the present invention provides a GPU-based parallel tetrahedron mesh optimization method, comprising the following steps:

[0044] Step 1: Generate a surface triangular mesh for the three-dimensional geometric model, and generate an initial tetrahedral mesh based on the triangular mesh;

[0045] Step 2: Based on the parallel coloring strategy determined by priority, a round of point smoothing operation is performed in parallel on all tetrahedrons in the initial tetrahedron mesh using multiple GPU threads to obtain a first updated tetrahedron mesh;

[0046] Step 3: Selecting a tetrahedron with a minimum dihedral angle below a preset threshold in the first updated tetrahedron mesh as a first starting tetrahedron, performing a round of combined optimization operations of point smoothing, edge deletion, and multi-face deletion in parallel on a set operation area centered on the first starting tetrahedron through multiple GPU threads, and iterating the combined optimization operations in a loop to obtain a second updated tetrahedron mesh; wherein the boundaries of adjacent set operation areas do not overlap;

[0047] Step 4: selecting a tetrahedron whose minimum dihedral angle in the second updated tetrahedral mesh is lower than a preset threshold as a second starting tetrahedron, and performing a round of edge contraction and edge splitting operations in parallel on a set operation area centered on the second starting tetrahedron using multiple GPU threads; wherein the boundaries of adjacent set operation areas do not overlap;

[0048] Step 5: Repeat steps 2 to 4 until the total number of cycles reaches the preset upper limit.

[0049] In some embodiments of the present invention, a contiguous array storage method is used to store some or all of the arrays specified in the tetrahedral mesh information. This design is primarily based on the following considerations: First, the number of mesh vertices and tetrahedrons changes minimally before and after optimization, and sufficient pre-allocation of space can avoid array expansion. Second, compared to block-based storage, contiguous array storage reduces memory access times, thereby improving program efficiency.

[0050] In specific implementation, first, the GPU tetrahedron mesh data structure based on the continuous array of this embodiment is designed as follows:

[0051] The GPU tetrahedron mesh data structure includes the number of vertices, the number of tetrahedrons, a vertex array, a tetrahedron array, a neighbor tetrahedron array, and an operation region index array. The vertex array records the coordinates and dimensions of the vertices. The operation region index array is used to indicate the index of the topological transformation operation region corresponding to the tetrahedron.

[0052] Part or all of the arrays recording tetrahedral mesh information are stored in a continuous array manner.

[0053] The number of mesh vertices and tetrahedrons changes minimally before and after optimizing the contiguous array storage structure, allowing for the avoidance of array expansion by preallocating sufficient space. Furthermore, compared to block-based storage, contiguous array storage reduces memory access times, thereby improving program efficiency.

[0054] In geometric processing operations such as point smoothing, the adjacency relationship between vertices and tetrahedrons is one of the core data structures. Since the number of adjacent tetrahedrons for each vertex is uncertain, an embodiment of the present invention adopts a range-based storage method to achieve efficient data management. This storage method stores adjacency information in a continuous array and uses a range array to quickly locate data, thereby maximizing data access performance while ensuring storage compactness. However, after each round of topological transformation, the adjacency tetrahedron relationship of the vertex may change significantly. In particular, the number of adjacent tetrahedrons of certain vertices may increase, resulting in the need to recalculate the adjacency relationship array and range array. Given that the computational cost of updating the adjacency relationship is basically the same as the cost of reconstruction, the embodiment of the present invention chooses not to persist the adjacency relationship after the topological transformation, but instead adopts an on-demand construction strategy to optimize storage resource utilization and improve the flexibility of the algorithm.

[0055] The process of constructing the adjacency relationship between vertices and tetrahedrons is as follows: First, traverse all tetrahedrons and count the number of adjacent tetrahedrons for each vertex. Then, create a global array to store the adjacency relationship between vertices and tetrahedrons. The capacity of this array is the sum of the number of adjacent tetrahedrons for all vertices. Next, use a parallel reduction algorithm to calculate the storage range of each vertex in the global array (i.e., the starting index and the ending index). Finally, perform a second traversal to sequentially store the index information of each tetrahedron in the specified position of the corresponding vertex in the adjacency relationship array. Thanks to the powerful parallel computing capabilities of the GPU, the two traversals and reduction operations can efficiently construct the adjacency relationship between vertices and tetrahedrons.

[0056] In step 2, the parallel coloring strategy based on priority determination includes: coloring the vertices in the vertex array according to priority: in each round of operation, vertices with serial numbers smaller than the serial numbers of all uncolored neighboring points are selected for coloring. When all vertices are colored, each vertex is added to the independent point set corresponding to the vertex according to the color to form multiple independent point sets; point smoothing operations are performed on each independent point set in turn: Laplace point smoothing operations are performed on the vertices in the current independent point set in parallel, the vertices that failed to be optimized are recorded, and point smoothing operations based on numerical optimization are performed on the vertices that failed to be optimized. In point smoothing, this embodiment adopts a parallel coloring strategy based on priority determination. One round of coloring in the serial algorithm is expanded to multiple rounds of coloring, and each round selects a group of vertices with a priority higher than all neighbors for coloring. We stipulate that the vertices with smaller serial numbers on each edge must be colored first. Therefore, when selecting independent point sets, only those vertices that are not colored and whose serial numbers are smaller than all uncolored adjacent points need to be selected.

[0057] In the specific implementation, a parallel coloring strategy based on priority determination is used to perform parallel point smoothing operations, as follows:

[0058] Figure 2 shows a two-dimensional schematic diagram of the parallel vertex coloring method. Figure 2(a) shows the initial state, showing all vertices to be colored. Figure 2(b) shows the result of the first round of coloring. Vertices 0, 1, and 3 are colored because their sequence numbers are lower than those of all their neighboring vertices. Figure 2(c) shows the result of the second round of coloring. Since vertices 0, 1, and 3 have already been colored, points 2 and 4, whose sequence numbers are lower than those of all their neighboring vertices, can also be colored. The same applies to Figures 2(d) and 2(e). Figure 2(f) shows the final coloring result. A total of four colors are used to complete the vertex coloring: the vertices corresponding to independent point set 0 are {0, 1, 3}, the vertices corresponding to independent point set 1 are {2, 4, 8}, the vertices corresponding to independent point set 2 are {5, 6, 9}, and the vertices corresponding to independent point set 3 are {7}.

[0059] First, initialize the number of used colors to 0. Next, enter the loop until all vertices are colored. At the beginning of each loop, set the loop stop flag to true. Then, process the vertices in the vertex array in parallel. If the current vertex has been colored, exit the execution of the current vertex. If the current vertex has not been colored, enter the subsequent branch. Set the loop stop flag to false. Traverse the neighbor vertices of the current vertex. If the neighbor vertex has been colored, mark the color corresponding to the neighbor vertex as used; if the neighbor vertex has not been colored and the sequence number of the neighbor point is smaller than the current vertex, it means that the current vertex cannot be colored in this round, and exit the execution of the current vertex. Then traverse all colors and set the color of the current vertex to the unused color with the smallest sequence number. Finally, update the number of used colors. When all vertices are colored, add each vertex to its corresponding independent point set according to its color.

[0060] After vertex coloring is complete, point smoothing can be performed sequentially on these differently colored point sets. All independent point sets are traversed sequentially. When processing each independent point set, the array of vertices that failed optimization is first initialized to empty. Then, a parallel Laplace point smoothing operation is performed on the vertices in the current independent point set. If the optimization fails, that is, the worst unit quality of the 1-neighborhood tetrahedron of the current vertex after optimization is lower than a preset threshold, the vertex is added to the array of vertices that failed optimization. Finally, a parallel numerical optimization-based point smoothing operation is performed on the vertices in the array of vertices that failed optimization.

[0061] For Laplace point smoothing, each vertex only needs to calculate the average coordinates of its 1-neighboring vertices and verify whether the new coordinates improve the quality of the worst mesh cell. Due to the small amount of computation and relatively balanced load, the calculation of each vertex can be directly assigned to a single GPU thread.

[0062] For point smoothing operations based on numerical optimization, the embodiment of the present invention uses the gradient descent method for solution. For each vertex, the gradient direction and initial gradient magnitude must be calculated first, and then the gradient is continuously updated and verified to see if the new coordinates can improve the quality of the worst unit. If a single GPU thread is directly responsible for a vertex, there will be two problems: first, the computational load of a single GPU thread is too large; second, the number of iterations for each vertex is different, which may cause control divergence among GPU threads within the same thread bundle, thereby reducing execution efficiency.

[0063] In order to solve the above problems, the embodiment of the present invention decomposes the task into three steps. First, n rounds of optimization are performed on the vertices in the vertex array that failed to be optimized. First, in the initial gradient calculation stage, a GPU thread is responsible for calculating the gradient direction and initial gradient size of a vertex. Then, in the candidate gradient evaluation stage, the search step size multiplier is pre-set, and then a GPU thread is responsible for evaluating the worst unit quality of a vertex corresponding to the new coordinates under a certain preset step size. Finally, in the optimal coordinate selection stage, based on the results of the candidate gradient evaluation, the optimal step size corresponding to each vertex is selected, and the position of the vertex is moved to optimize the unit quality. This step-by-step processing method can effectively reduce the computational load of a single GPU thread and avoid the control divergence problem, thereby improving the computing efficiency of the GPU.

[0064] In step three, during the edge deletion operation, a three-dimensional template array is used to implement fine-grained parallel operations. This includes constructing a 5×42×15 three-dimensional template array, and mapping each triangulated template for each shell to a GPU thread for quality assessment through the three-dimensional template array. The first dimension of the three-dimensional template array represents the number of edges of the skirt polygon, the second dimension represents the number of the skirt polygon triangulated template, and the third dimension represents the vertex index of the skirt polygon triangulation. This embodiment proposes a fine-grained parallel strategy based on template arrays. The core of this strategy is a 5×42×15 three-dimensional template array, which lists all the skirt polygon triangulated templates for shells corresponding to each number of skirt edges. Through the template array, each triangulated template for each shell can be mapped to a GPU thread for quality assessment, achieving fine-grained parallel computing.

[0065] In specific implementation, GPU parallel shell transformation is performed based on the GPU parallel version of edge deletion and multi-face deletion, as follows:

[0066] For the parallel Bowyer-Watson insertion operation, as long as the cavities involved in the two vertices do not overlap, the two vertices can be inserted simultaneously. For topological transformation operations such as edge deletion and multi-face deletion, as long as the operation areas involved do not overlap, they can also be executed in parallel, such as Figure 3 As shown (the 2D edge flip operation corresponds to the 3D edge deletion and multi-face deletion operations). Based on the above principles, the embodiment of the present invention implements GPU parallel versions of edge deletion and multi-face deletion. To facilitate the update of neighbor relationships after shell transformation, the boundaries of the operation area must also not overlap. The details are as follows:

[0067] First, all low-quality tetrahedra (minimum dihedral angle less than 30°) are collected. For each tetrahedron, all reconnection templates of all its shells are enumerated, and the shell with the best mesh quality after topology change is selected.

[0068] Afterwards, each tetrahedron colors its shell and filters out shells that are independent of each other.

[0069] Finally, the operation area is reconnected and the topology and neighbor information of the grid are updated.

[0070] The key to edge deletion is finding the optimal triangulation for the skirt polygon. Since the number of edges N of a skirt polygon is typically small, the optimal triangulation can be determined by enumeration. This embodiment of the present invention proposes a fine-grained parallel strategy based on a template array. The core of this strategy is a 5×42×15 three-dimensional template array that supports shells with skirt numbers of 3≤N≤7. This array is stored in the GPU's shared memory. The first dimension of the array represents the number of skirts. Since there is no case where the number of skirts is 0≤N≤2, this embodiment maps the case where the number of skirts is 3 to 0, and the same applies to cases with larger skirt numbers. The second dimension of the array represents the number of the skirt polygon triangulation template. For the case where the number of skirts is 7, there are 6 templates, and each template corresponds to 7 rotations. Therefore, a maximum of 42 possible skirt polygon triangulation templates need to be stored. The third dimension of the array represents the vertex index of the skirt polygon triangulation. For the case where the number of skirts is 7, there are 5 triangles, so a maximum of 15 vertex indices need to be stored. The template array lists all the skirt polygon triangulation templates of the shell corresponding to each number of skirt edges. Through the template array, each triangulation template of each shell can be mapped to a GPU thread for quality assessment to achieve fine-grained parallel computing.

[0071] For multi-face deletion, each vertex must first find the set of triangles (i.e., multi-faces) shared by its corresponding vertex. This process relies on the neighbor relationships between vertices and tetrahedrons. A GPU thread is assigned to each vertex of each tetrahedron. This thread traverses the neighbor tetrahedrons of the current vertex and the neighbor tetrahedrons of its corresponding vertex to find the shared triangle set. There are three different scenarios for the triangle set, as shown in Figure 4.

[0072] Figure 4(a) shows the normal situation: the vertices p1, p2, p3, p4, and p5 of the triangle set form a ring, and all triangle faces can be removed by the multi-face deletion operation.

[0073] Figure 4(b) shows a closed loop of triangles. All triangular faces can be removed using the multifaceted deletion operation, but this would invalidate the center vertex of the loop and is not permitted. While it is possible to eliminate the closed loop by deleting some of the triangles, the process of determining which triangles to delete is complex and involves multiple branches, significantly impacting runtime efficiency. Therefore, if a closed loop of triangles is detected, the vertex and its corresponding multifaceted face are assumed to be non-existent, and subsequent processing is skipped to improve runtime efficiency.

[0074] FIG4 (c) shows the case of multiple connected components: Since the multi-face deletion operation can only remove the triangle set within a connected component, for this case, this embodiment selects the connected component with the largest number of triangles as the multi-face formed by the vertex and its corresponding vertex.

[0075] In step 4, smoothing operations are combined with edge shrinkage and edge segmentation to ensure improved mesh quality. Based on the GPU parallel versions of edge shrinkage and edge segmentation, GPU parallel shell transformation is performed as follows:

[0076] For topological transformation operations such as edge contraction and edge splitting, their parallelism is similar to that of edge deletion and multi-face deletion: as long as the operation areas involved do not overlap, these operations can also be executed in parallel, as shown in Figures 5(a) and 5(b). In addition, to facilitate the update of neighbor relationships after the shell transformation, this embodiment also requires that the boundaries of the operation areas must not overlap.

[0077] Simply shrinking or splitting edges does not directly improve mesh quality; it must be combined with smoothing. The algorithm's workflow is as follows: First, all short / long edges connected to low-quality tetrahedrons are collected. For each short / long edge, an initial shrinkage / split point (the midpoint between two vertices) is calculated and point smoothing is performed on it. Next, a determination is made as to whether the quality of the local area has improved after point smoothing. If not, the affected area is discarded. Next, the affected areas are colored in parallel, and independent affected areas are selected. Finally, the affected areas are reconnected and the mesh's topology and neighborhood information are updated.

[0078] During an edge contraction operation, vertex array updates can be achieved by first creating a temporary array for the contracted vertices, storing the contracted vertices at the index of the original contracted vertex after the edge contraction operation, and then compacting the array. When updating the tetrahedron array and tetrahedron neighbor array, it is important to deduplicate tetrahedrons shared by two contracted vertices.

[0079] During an edge split, the newly generated split point is stored at the end of the vertex array. For updates to the tetrahedron array, since each tetrahedron is split in half, the update is accomplished by simply establishing a mapping between the newly generated split tetrahedron and the original tetrahedron. Half of the split tetrahedron is stored at the end of the tetrahedron array. Since the tetrahedrons within the original shell are stored sequentially, the split tetrahedrons can also be stored sequentially. Therefore, for each split tetrahedron, only its pre-order position, post-order position, and the corresponding half tetrahedron are needed to quickly update the neighbor relationship.

[0080] Repeat the above steps until the total number of cycles reaches the preset number.

[0081] In this embodiment, the F6 model is selected for experimental analysis. Figure 6 Table 1 shows the initial mesh size and mesh quality data of the selected mesh model. and denote the minimum and maximum dihedral angles, respectively, It represents the percentage of the difference dihedral angle, that is, the angle in or At the same time, Used to evaluate the distribution of difference dihedral angles, indicating that the dihedral angles are or For example, Indicates the dihedral angle in or The ratio within the range of degrees.

[0082] Table 1 Initial mesh size and mesh quality data of the mesh model

[0083]

[0084] The present application also provides a GPU-based parallel tetrahedron mesh optimization system, comprising: a graphics processing unit, wherein the graphics processing unit performs the following steps:

[0085] Step 1: Generate a surface triangular mesh for the three-dimensional geometric model, and generate an initial tetrahedral mesh based on the triangular mesh;

[0086] Step 2: Based on the parallel coloring strategy determined by priority, a round of point smoothing operation is performed in parallel on all tetrahedrons in the initial tetrahedron mesh using multiple GPU threads to obtain a first updated tetrahedron mesh;

[0087] Step 3: Selecting a tetrahedron with a minimum dihedral angle below a preset threshold in the first updated tetrahedron mesh as a first starting tetrahedron, performing a round of combined optimization operations of point smoothing, edge deletion, and multi-face deletion in parallel on a set operation area centered on the first starting tetrahedron through multiple GPU threads, and iterating the combined optimization operations in a loop to obtain a second updated tetrahedron mesh; wherein the boundaries of adjacent operation areas do not overlap;

[0088] Step 4: selecting a tetrahedron whose minimum dihedral angle in the second updated tetrahedral mesh is lower than a preset threshold as a second starting tetrahedron, and performing a round of edge contraction and edge splitting operations in parallel on a set operation area centered on the second starting tetrahedron using multiple GPU threads; wherein the boundaries of adjacent operation areas do not overlap;

[0089] Step 5: Repeat steps 2 to 4 until the total number of cycles reaches the preset upper limit.

[0090] In specific implementation, the GPU-based parallel tetrahedron mesh optimization system of this embodiment is used to execute the aforementioned GPU-based parallel tetrahedron mesh optimization method. Figure 7 As shown, the parallel tetrahedron mesh optimization system includes a storage module and a graphics processing unit. The graphics processing unit is equipped with a unit quality inspection module, a point smoothing module, a shell transformation module and an edge contraction / splitting module. The storage module is used to store tetrahedral mesh data; the unit quality inspection module is used to parallelly calculate the minimum dihedral angle of each tetrahedron and filter out tetrahedrons that do not meet the quality requirements. The point smoothing module is used to perform Laplace point smoothing operations on the vertices in multiple independent point sets in parallel. The shell transformation module is used to select the shell with the best mesh quality after topological transformation. The edge contraction / splitting module is used to further process all short edges / long edges connected to low-quality tetrahedrons.

[0091] In one embodiment, a computer device is provided, such as Figure 8 As shown, it includes a memory 101, a processor 102, and a computer program stored in the memory 101 and executable on the processor 102. When the processor 102 executes the computer program, the above-mentioned GPU-based parallel tetrahedron mesh optimization method is implemented.

[0092] Specifically, the computer device may be a computer terminal, a server or a similar computing device.

[0093] In this embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program for executing the above-mentioned GPU-based parallel tetrahedron mesh optimization method.

[0094] Specifically, computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable storage media does not include transitory media such as modulated data signals and carrier waves.

[0095] Obviously, those skilled in the art should understand that the various modules or steps of the above-mentioned embodiments of the present invention can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices. Alternatively, they can be implemented using program code executable by the computing device, so that they can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than herein, or they can be made into separate integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module for implementation. Thus, the embodiments of the present invention are not limited to any specific combination of hardware and software.

[0096] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A GPU-based parallel tetrahedron mesh optimization method, characterized in that: The following steps are involved: Step 1: Generate a surface triangular mesh for the three-dimensional geometric model, and generate an initial tetrahedral mesh based on the triangular mesh; Step 2: Based on the parallel coloring strategy determined by priority, a round of point smoothing operation is performed in parallel on all tetrahedrons in the initial tetrahedron mesh using multiple GPU threads to obtain a first updated tetrahedron mesh; Step 3: Selecting a tetrahedron with a minimum dihedral angle below a preset threshold in the first updated tetrahedron mesh as a first starting tetrahedron, performing a round of combined optimization operations of point smoothing, edge deletion, and multi-face deletion in parallel on a set operation area centered on the first starting tetrahedron through multiple GPU threads, and iterating the combined optimization operations in a loop to obtain a second updated tetrahedron mesh; wherein the boundaries of adjacent set operation areas do not overlap; Step 4: selecting a tetrahedron whose minimum dihedral angle in the second updated tetrahedral mesh is lower than a preset threshold as a second starting tetrahedron, and performing a round of edge contraction and edge splitting operations in parallel on a set operation area centered on the second starting tetrahedron using multiple GPU threads; wherein the boundaries of adjacent set operation areas do not overlap; Step 5: Repeat steps 2 to 4 until the total number of cycles reaches the preset upper limit.

2. The GPU-based parallel tetrahedron mesh optimization method according to claim 1, characterized in that: A continuous array storage method is used to record part of or all of the arrays set in the tetrahedral mesh information.

3. The GPU-based parallel tetrahedron mesh optimization method according to claim 2, characterized in that: The array recording the tetrahedron mesh information includes the number of vertices, the number of tetrahedrons, the vertex array, the tetrahedron array, the neighbor tetrahedron array and the operation area index array; wherein the vertex array records the coordinates and size of the vertices, and the operation area index array is used to represent the index of the topological transformation operation area corresponding to the tetrahedron.

4. The GPU-based parallel tetrahedron mesh optimization method according to claim 1, characterized in that: In the point smoothing operation, the process of building the adjacency relationship between vertices and tetrahedrons includes: Traverse all tetrahedrons and count the number of adjacent tetrahedrons of each vertex; Create a global adjacency array, calculate the storage range of each vertex in the global adjacency array through a parallel reduction algorithm, traverse all tetrahedrons twice, and store the index information of each tetrahedron in sequence at the position of the corresponding vertex in the global adjacency array.

5. The GPU-based parallel tetrahedron mesh optimization method according to claim 3, characterized in that: Priority-based parallel coloring strategy, including: Color the vertices in the vertex array according to priority: in each round of operation, select the vertices with serial numbers less than the serial numbers of all uncolored neighboring points for coloring. When all vertices are colored, add each vertex to the independent point set corresponding to the vertex according to its color to form multiple independent point sets; perform point smoothing operations on each independent point set in turn: perform Laplace point smoothing operations on the vertices in the current independent point set in parallel, record the vertices that failed to be optimized, and perform point smoothing operations based on numerical optimization on the vertices that failed to be optimized.

6. The GPU-based parallel tetrahedron mesh optimization method according to claim 5, characterized in that: Point smoothing operations based on numerical optimization include: In the initial gradient calculation phase, a GPU thread is responsible for calculating the gradient direction and initial gradient magnitude of a vertex; In the candidate gradient evaluation phase, the search step size multiplier is pre-set, and a GPU thread is responsible for evaluating the worst cell quality of a vertex corresponding to the new coordinates under the preset step size; In the optimal coordinate selection stage, the optimal step size corresponding to each vertex is selected according to the results of the candidate gradient evaluation, and the position of the vertex is moved to optimize the unit quality.

7. The GPU-based parallel tetrahedron mesh optimization method according to claim 1, characterized in that: In the edge deletion operation, a three-dimensional template array is used to implement fine-grained parallel operations, including: constructing a 5×42×15 three-dimensional template array, and mapping each triangulated template of each shell to a GPU thread for quality assessment through the three-dimensional template array; wherein the first dimension of the three-dimensional template array represents the number of edges of the skirt polygon, the second dimension represents the number of the triangulated template of the skirt polygon, and the third dimension represents the vertex index of the triangulated skirt polygon.

8. A GPU-based parallel tetrahedron mesh optimization system, characterized in that: The method comprises: a graphics processing unit, wherein the graphics processing unit performs the following steps: Step 1: Generate a surface triangular mesh for the three-dimensional geometric model, and generate an initial tetrahedral mesh based on the triangular mesh; Step 2: Based on the parallel coloring strategy determined by priority, a round of point smoothing operation is performed in parallel on all tetrahedrons in the initial tetrahedron mesh using multiple GPU threads to obtain a first updated tetrahedron mesh; Step 3: Selecting a tetrahedron with a minimum dihedral angle below a preset threshold in the first updated tetrahedron mesh as a first starting tetrahedron, performing a round of combined optimization operations of point smoothing, edge deletion, and multi-face deletion in parallel on a set operation area centered on the first starting tetrahedron through multiple GPU threads, and iterating the combined optimization operations in a loop to obtain a second updated tetrahedron mesh; wherein the boundaries of adjacent set operation areas do not overlap; Step 4: selecting a tetrahedron whose minimum dihedral angle in the second updated tetrahedral mesh is lower than a preset threshold as a second starting tetrahedron, and performing a round of edge contraction and edge splitting operations in parallel on a set operation area centered on the second starting tetrahedron using multiple GPU threads; wherein the boundaries of adjacent set operation areas do not overlap; Step 5: Repeat steps 2 to 4 until the total number of cycles reaches the preset upper limit.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the GPU-based parallel tetrahedron mesh optimization method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program for executing the GPU-based parallel tetrahedron mesh optimization method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • GPU-based parallel tetrahedral mesh generation method and aircraft profile design method

    CN120124181A

  • Image processing method and apparatus, and computer-readable storage medium

    US20190294928A1