Method and device for generating three-dimensional tetrahedral meshes in parallel based on graphics processor
A method of generating three-dimensional tetrahedral meshes through parallelization of graphics processors, utilizing mapping relationships and three-dimensional local Delaunay lemma, solves the problem of balancing generation quality and efficiency in existing technologies, and achieves efficient and accurate mesh generation.
Patent Information
- Application Number
- CN202411601950.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-11-11
AI Technical Summary
The existing three-dimensional tetrahedral mesh generation method is difficult to strike a balance between generation quality and efficiency, and consumes a lot of computing resources.
A parallel method based on graphics processor is adopted. Through mapping relation and 3D local Delaunay lemma, threads and thread blocks are used to parallelly calculate the target-neighborhood of discrete point sets to generate 3D tetrahedral mesh.
The efficiency and quality of three-dimensional tetrahedral mesh generation are improved, computing resource consumption is reduced, and the accuracy of generated results is ensured.
Smart Images

Figure CN119379951B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical fields of computer-aided engineering and finite element methods, and more particularly, to a method and apparatus for generating three-dimensional tetrahedral meshes in parallel based on a graphics processor. Background Art
[0002] In technical fields such as computer-aided engineering and finite element method, a three-dimensional tetrahedral mesh can be generated based on a discrete point set, and the three-dimensional tetrahedral mesh can be used to represent the discrete point set in three-dimensional space.
[0003] In implementing the concepts of the present disclosure, the inventors discovered that a serial method on a CPU can be used to generate a three-dimensional tetrahedral mesh. This method produces high-quality meshes, but the mesh generation efficiency is low. A parallel method on a GPU can also be used to generate a three-dimensional tetrahedral mesh. This method produces high-efficiency meshes, but the mesh generation quality is low. Therefore, the inventors discovered at least the following problems: Three-dimensional tetrahedral mesh generation methods struggle to balance mesh generation quality and efficiency, and generating a three-dimensional tetrahedral mesh consumes a significant amount of computing resources. Summary of the Invention
[0004] In view of this, the present disclosure provides a method, apparatus, device, medium, and program product for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor.
[0005] One aspect of the present disclosure provides a method for generating a three-dimensional tetrahedral mesh based on parallelization of a graphics processor, comprising: processing an obtained discrete point set based on a preset unit grid to obtain a mapping relationship between the discrete point set and the preset unit grid; based on the mapping relationship and the three-dimensional local Delaunay lemma, using threads constructed by a graphics processor to parallelly calculate the target-neighborhood of each target point in the discrete point set, wherein the target-neighborhood represents a set of three-dimensional tetrahedrons with the target point as a vertex, and the computing task of the thread is subject to a preset computing limit; for each second target point whose computing demand exceeds the computing limit, based on the mapping relationship and the three-dimensional local Delaunay lemma, using thread blocks constructed by the graphics processor to parallelly calculate the target-neighborhood of each second target point to obtain a target-neighborhood set corresponding to the discrete point set; and generating a three-dimensional tetrahedral mesh corresponding to the discrete point set according to the target-neighborhood set corresponding to the discrete point set.
[0006] Another aspect of the present disclosure provides a device for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor, including: a mapping module, which is used to process the obtained discrete point set based on a preset unit grid to obtain a mapping relationship between the discrete point set and the preset unit grid; a first processing module, which is used to calculate the target-neighborhood of each target point in the discrete point set in parallel based on the mapping relationship and the three-dimensional local Delaunay lemma using threads constructed by the graphics processor, wherein the target-neighborhood represents a three-dimensional tetrahedron set with the target point as a vertex, and the computing task of the thread is subject to a preset computing limit; a second processing module, which is used to calculate the target-neighborhood of each second target point in parallel based on the mapping relationship and the three-dimensional local Delaunay lemma for each second target point whose computing demand exceeds the computing limit, to obtain a target-neighborhood set corresponding to the discrete point set; and a generation module, which is used to generate a three-dimensional tetrahedral mesh corresponding to the discrete point set based on the target-neighborhood set corresponding to the discrete point set.
[0007] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described above.
[0008] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method described above when executed.
[0009] Another aspect of the present disclosure provides a computer program product comprising computer executable instructions, which are used to implement the method described above when the instructions are executed.
[0010] According to embodiments of the present disclosure, by constructing a Delaunay tetrahedral mesh based on the three-dimensional local Delaunay lemma, the mesh update range corresponding to each point in a discrete point set can be determined, thereby ensuring accurate results. Furthermore, the range defined by the three-dimensional local Delaunay lemma is smaller than the safety radius, resulting in fewer tetrahedral mesh updates and higher efficiency. Furthermore, by utilizing a GPU to execute computational subtasks for each target point in parallel, the efficiency of tetrahedral mesh generation can be effectively improved. By setting computational limits, computational subtasks with smaller computational loads can be processed in parallel first using a single thread, followed by targeted processing of computational subtasks with larger computational loads using thread blocks. This can accelerate the parallel processing efficiency of the GPU, improve the GPU's parallel processing performance, further improve the efficiency of tetrahedral mesh generation, and help reduce computing resource consumption. Therefore, the method for generating three-dimensional tetrahedral meshes in parallel based on a graphics processor provided by embodiments of the present disclosure can at least partially overcome the technical problems in related arts of balancing mesh generation quality and efficiency, and consuming a large amount of computing resources to generate three-dimensional tetrahedral meshes. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0012] Figure 1 Schematically illustrates a discrete point set and a Delaunay tetrahedron mesh according to an embodiment of the present disclosure;
[0013] Figure 2 A diagram schematically illustrates an application scenario of a method, apparatus, device, medium, and program product for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor according to an embodiment of the present disclosure;
[0014] Figure 3 Schematically shows a flow chart of a method for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor according to an embodiment of the present disclosure;
[0015] Figure 4A Schematically shows a target neighborhood diagram according to an embodiment of the present disclosure;
[0016] Figure 4B A schematic diagram of a three-dimensional local Delaunay lemma according to an embodiment of the present disclosure is schematically shown;
[0017] Figure 4C Schematically shows a schematic diagram of a grid update range according to an embodiment of the present disclosure;
[0018] Figure 4DSchematically illustrates a schematic diagram of half-space intersection processing according to an embodiment of the present disclosure;
[0019] Figure 5A Schematically shows a flow chart of executing a first processing task according to an embodiment of the present disclosure;
[0020] Figure 5B Schematically shows a flow chart of performing half-space intersection processing according to an embodiment of the present disclosure;
[0021] Figure 6 A block diagram schematically illustrates an apparatus for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor according to an embodiment of the present disclosure; and
[0022] Figure 7 A block diagram suitable for implementing the above-described method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0023] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0024] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0025] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0026] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0027] In the embodiments of this disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of all data involved (including, but not limited to, user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information and maintain the security of user personal information and network security.
[0028] In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0029] In technical fields such as computer-aided engineering and finite element methods, a 3D tetrahedral mesh can be generated from a discrete point set. This 3D tetrahedral mesh can be used to represent the discrete point set in 3D space. For example, the discrete point set can include a laser point cloud and the sampling points within it, or a geometric model surface and the feature points within it.
[0030] In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the related technology: the related three-dimensional tetrahedral mesh generation method is difficult to take into account both the mesh generation quality and generation efficiency, and the generation of three-dimensional tetrahedral mesh consumes a lot of computing resources.
[0031] Figure 1 A discrete point set and a Delaunay tetrahedron mesh according to an embodiment of the present disclosure are schematically shown.
[0032] According to one embodiment of the present disclosure, Figure 1 As shown, the Delaunay triangulation method can be used to generate a Delaunay tetrahedral mesh based on a discrete point set. The Delaunay triangulation method has the properties of a hollow circle and maximizes the minimum angle, minimizing the generation of narrow, elongated tetrahedrons. A Delaunay tetrahedral mesh satisfies the hollow sphere property, meaning that the interior of any tetrahedron's circumsphere contains no points from the discrete point set, resulting in high mesh quality.
[0033] In implementing the concepts of the present disclosure, the inventors discovered that related methods for generating Delaunay tetrahedral meshes include a serial method on a CPU, which initially generates a tetrahedron and then continuously inserts new target points from a discrete point set to update the current Delaunay tetrahedral mesh, ultimately obtaining a Delaunay tetrahedral mesh corresponding to the discrete point set. Furthermore, related methods for generating Delaunay tetrahedral meshes also include a parallel method on a GPU, which first calculates k neighboring points for each target point in the discrete point set and then uses a half-space intersection process on these neighboring points to update the Delaunay neighborhood mesh of the current target point (a local Delaunay tetrahedral mesh with the current target point as a vertex) until a safe radius is reached. The inventors discovered that the first method can produce an accurate Delaunay tetrahedral mesh, but the speed of updating the Delaunay tetrahedral mesh is slow when the number of points reaches a certain scale. The second method cannot produce an accurate Delaunay tetrahedral mesh because it is possible that the safe radius has not been reached after calculating all k neighboring points. Furthermore, near the boundary of the point set, the safe radius is infinite, thus not guaranteeing accurate results.
[0034] In order to at least partially solve the technical problems existing in the related art, the present disclosure provides a method, apparatus, device, medium and program product for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor. The method for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor includes: processing the obtained discrete point set based on a preset unit grid to obtain a mapping relationship between the discrete point set and the preset unit grid; based on the mapping relationship and the three-dimensional local Delaunay lemma, using threads constructed by the graphics processor to parallelly calculate the target-neighborhood of each target point in the discrete point set, wherein the target-neighborhood represents a set of three-dimensional tetrahedra with the target point as a vertex, and the computing task of the thread is limited by a preset computing limit; for each second target point whose computing demand exceeds the computing limit, based on the mapping relationship and the three-dimensional local Delaunay lemma, using thread blocks constructed by the graphics processor to parallelly calculate the target-neighborhood of each second target point to obtain a target-neighborhood set corresponding to the discrete point set; and generating a three-dimensional tetrahedral mesh corresponding to the discrete point set according to the target-neighborhood set corresponding to the discrete point set.
[0035] Figure 2 The application scenario diagram of the method, apparatus, device, medium and program product for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor according to an embodiment of the present disclosure is schematically shown.
[0036] like Figure 2As shown, the application scenario 200 according to this embodiment may include a first terminal device 201, a second terminal device 202, a third terminal device 203, a network 204, and a server 205. The network 204 is used as a medium for providing a communication link between the first terminal device 201, the second terminal device 202, the third terminal device 203, and the server 205. The network 204 may include various connection types, such as wired or wireless communication links or optical fiber cables, etc.
[0037] A user may use a first terminal device 201, a second terminal device 202, or a third terminal device 203 to interact with a server 205 via a network 204 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 201, the second terminal device 202, or the third terminal device 203, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (for example only).
[0038] The first terminal device 201 , the second terminal device 202 , and the third terminal device 203 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0039] Server 205 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using first terminal device 201, second terminal device 202, and third terminal device 203. The background management server may analyze and process received data such as user requests, and feed back processing results (e.g., web pages, information, or data obtained or generated based on user requests) to the terminal devices.
[0040] It should be noted that the method for generating a three-dimensional tetrahedral mesh based on parallelization of a graphics processor provided in the embodiment of the present disclosure can generally be executed by the server 205. Accordingly, the apparatus for generating a three-dimensional tetrahedral mesh based on parallelization of a graphics processor provided in the embodiment of the present disclosure can generally be set in the server 205. The method for generating a three-dimensional tetrahedral mesh based on parallelization of a graphics processor provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 205 and can communicate with the first terminal device 201, the second terminal device 202, the third terminal device 203 and / or the server 205. Accordingly, the apparatus for generating a three-dimensional tetrahedral mesh based on parallelization of a graphics processor provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 205 and can communicate with the first terminal device 201, the second terminal device 202, the third terminal device 203 and / or the server 205. Alternatively, the method for generating a three-dimensional tetrahedral mesh based on parallelization of a graphics processor provided in the embodiment of the present disclosure may also be executed by the first terminal device 201, the second terminal device 202, or the third terminal device 203, or may also be executed by another terminal device different from the first terminal device 201, the second terminal device 202, or the third terminal device 203. Accordingly, the apparatus for generating a three-dimensional tetrahedral mesh based on parallelization of a graphics processor provided in the embodiment of the present disclosure may also be provided in the first terminal device 201, the second terminal device 202, or the third terminal device 203, or may be provided in another terminal device different from the first terminal device 201, the second terminal device 202, or the third terminal device 203.
[0041] It should be understood that Figure 2 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0042] Figure 3 The flowchart of the method for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor according to an embodiment of the present disclosure is schematically shown.
[0043] like Figure 3 As shown, the method 300 includes operations S310 to S340.
[0044] In operation S310 , the obtained discrete point set is processed based on the preset unit grid to obtain a mapping relationship between the discrete point set and the preset unit grid.
[0045] In operation S320, based on the mapping relationship and the three-dimensional local Delaunay lemma, threads constructed by the graphics processor are used to parallely calculate the target-neighborhood of each target point in the discrete point set, where the target-neighborhood represents a set of three-dimensional tetrahedrons with the target point as a vertex, and the computing task of the thread is subject to a preset computing limit.
[0046] In operation S330, for each second target point whose computing requirement exceeds the computing limit, based on the mapping relationship and the three-dimensional local Delaunay lemma, the target-neighborhood of each second target point is calculated in parallel using the thread block constructed by the graphics processor to obtain a target-neighborhood set corresponding to the discrete point set.
[0047] In operation S340 , a three-dimensional tetrahedral mesh corresponding to the discrete point set is generated according to the target-neighborhood set corresponding to the discrete point set.
[0048] According to embodiments of the present disclosure, by processing the obtained discrete point set based on a preset unit grid, a mapping relationship between the discrete point set and the preset unit grid can be obtained. When updating the tetrahedral mesh, this mapping relationship between the discrete point set and the preset unit grid can be used to efficiently and quickly locate points within the update range, facilitating subsequent computational tasks.
[0049] According to an embodiment of the present disclosure, a target-neighborhood represents a set of three-dimensional tetrahedrons with the target point as a vertex. The target-neighborhood of the target point can be a Delaunay-neighborhood of the target point, which can be understood as a local Delaunay tetrahedral mesh with the target point as a vertex. In the Delaunay-neighborhood, each tetrahedron satisfies the property of Delaunay triangulation, that is, the interior of the circumscribed sphere of each tetrahedron does not contain the target point in the point set.
[0050] According to an embodiment of the present disclosure, the Delaunay one-ring neighborhood of a target point can be stored in the form of a Delaunay one-ring neighborhood list. The Delaunay one-ring neighborhood list can be understood as a set of all triangles in the Delaunay one-ring neighborhood of the target point that are opposite to the target point.
[0051] Figure 4A A schematic diagram of a target neighborhood according to an embodiment of the present disclosure is schematically shown.
[0052] Figure 4A The Delaunay neighborhood of the target point and its dual area are shown. Figure 4A The closed triangle mesh with blue edges is shown in the figure, and the dual region is shown in Figure 4AIt is shown as a convex polyhedron with pink edges. Point a is the target point, and with point a as the vertex, it can form a tetrahedron with any triangle in the closed triangular mesh. The tetrahedron set defined by point a and the closed triangular mesh (tetrahedron abcd, tetrahedron abgf, tetrahedron abfc, tetrahedron abdg, tetrahedron aedc, tetrahedron aefg, tetrahedron aecf, tetrahedron aegd) is the Delaunay neighborhood of point a. Each tetrahedron in the tetrahedron set contains point a as its vertex. It should be noted that in Figure 4A Only the triangles without point a corresponding to each tetrahedron in the Delaunay neighborhood are shown.
[0053] According to an embodiment of the present disclosure, referring to Figure 4A , we can obtain the circumscribed spheres of each tetrahedron in the Delaunay neighborhood from the circumscribed spheres of the tetrahedrons corresponding to the Delaunay neighborhood. Specifically, the circumscribed spheres of the tetrahedrons corresponding to the Delaunay neighborhood are the union of the circumscribed spheres of each tetrahedron formed by the triangles in the Delaunay neighborhood and the target point a.
[0054] According to an embodiment of the present disclosure, regarding the three-dimensional local Delaunay lemma (also known as the three-dimensional local Delaunay lemma), let X be a set of points in a three-dimensional Euclidean space, then the following properties hold:
[0055] If a closed triangle mesh (V, T) satisfies that all its vertices are inside X and the triangle mesh forms a simple polygon containing the target point a, then all Delaunay neighborhood vertices of point a lie inside the union of the tetrahedron circumscribed spheres defined by the triangle mesh and point a. The aforementioned union of tetrahedron circumscribed spheres is the union of the circumscribed spheres of each tetrahedron formed by the triangles in the triangle mesh and point a.
[0056] Figure 4B A schematic diagram of a three-dimensional local Delaunay lemma according to an embodiment of the present disclosure is schematically shown.
[0057] like Figure 4B As shown, the closed triangular mesh (by Figure 4B The gray and green edges in the triangle mesh contain the target point a. The dual region of the triangle mesh is composed of Figure 4B The pink edges in the triangle mesh are convex polyhedrons. For example, the triangles in the triangle mesh Forming a tetrahedron with point a (Depend on Figure 4B In the discrete point set, there is a point b that is outside the circumscribed spheres of all tetrahedrons that contain a as a vertex. That is, point b is outside the union of the circumscribed spheres of the tetrahedrons defined by the triangle mesh and point a.
[0058] like Figure 4B As shown, in the dual representation, each vertex of the convex polyhedron (for example, c) is closer to a and farther from b. Therefore, each vertex of the convex polyhedron is located in the left half-space defined by points a and b, and each vertex of the convex polyhedron does not intersect with the half-plane P. Assuming that point b is a vertex in the Delaunay first-neighborhood of point a, then the half-plane P must intersect with the dual region (that is, the convex polyhedron mentioned above). This contradicts the previous statement that "each vertex of the convex polyhedron does not intersect with the half-plane P". Therefore, it can be determined that point b is not a vertex in the Delaunay first-neighborhood of point a. From this, it can be understood that the point used to update the Delaunay first-neighborhood of point a must be in the union of the tetrahedrons corresponding to the Delaunay first-neighborhood of point a. Therefore, it is only necessary to find the next target point in the union of the tetrahedrons' outer spheres to update the current Delaunay tetrahedron mesh.
[0059] Figure 4C The figure schematically shows a grid update range diagram according to an embodiment of the present disclosure.
[0060] Figure 4C The left side shows the mesh update range for constructing a Delaunay tetrahedral mesh based on the safety radius; Figure 4C The middle shows the mesh update range for constructing a Delaunay tetrahedral mesh based on the three-dimensional local Delaunay lemma; Figure 4C The right side of shows the mesh update range for constructing a Delaunay tetrahedral mesh based on the three-dimensional local Delaunay lemma near the boundary of the discrete point set.
[0061] refer to Figure 4C It's easy to understand that, compared to precalculating k neighboring points for each target point and updating the tetrahedral mesh based on a safety radius, constructing a Delaunay tetrahedral mesh based on the 3D local Delaunay lemma ensures that the mesh update range for each point in the discrete point set is fixed (even for points near the boundary of the discrete point set), thus ensuring accurate results. Furthermore, the range defined by the 3D local Delaunay lemma is smaller than the safety radius, resulting in fewer tetrahedral mesh updates and higher efficiency.
[0062] According to embodiments of the present disclosure, a graphics processing unit (GPU) is a microprocessor that can be used to process graphics and visual computing tasks. Compared to traditional central processing units (CPUs), GPUs have more cores and can handle a large number of parallel computing tasks simultaneously. This enables GPUs to break down large-scale computing tasks into many smaller, parallelizable subtasks when executing parallel computing-intensive applications. The ability to process multiple subtasks in parallel significantly improves computing efficiency.
[0063] According to an embodiment of the present disclosure, a thread can be understood as the smallest unit that an operating system can schedule operations in. For example, a thread can be assigned to each subtask, and these threads can be executed in parallel.
[0064] According to embodiments of the present disclosure, a thread block can be understood as a collection of multiple threads. A thread block typically includes a preset number of threads (e.g., 32 or 128 threads), which are organized together during execution. For example, multiple threads in a thread block can perform synchronous operations.
[0065] According to embodiments of the present disclosure, a thread's computational tasks are subject to a preset computational quota, which can be understood as the upper limit of the computational tasks a thread can handle. If the computational requirements of a subtask executed by a thread exceed the computational quota, the subtask will fail. Failed subtasks can be further executed based on thread blocks containing multiple threads to ensure successful subtask execution.
[0066] According to an embodiment of the present disclosure, based on a mapping relationship and the three-dimensional local Delaunay lemma, a thread constructed by a graphics processor can be used to parallely calculate the target-neighborhood of each target point in a discrete point set, wherein the computational task of the thread is subject to a preset computational limit. Furthermore, for each second target point whose computational requirement exceeds the computational limit, based on the mapping relationship and the three-dimensional local Delaunay lemma, a thread block constructed by a graphics processor can be used to parallely calculate the target-neighborhood of each second target point, thereby obtaining a target-neighborhood set corresponding to the discrete point set. Specifically, the target-neighborhood set corresponding to the discrete point set includes the target-neighborhood of each target point in the discrete point set.
[0067] According to an embodiment of the present disclosure, a set of three-dimensional tetrahedrons with each target point in the discrete point set as a vertex can be generated based on the target-neighborhood of each target point in the discrete point set, thereby obtaining a three-dimensional tetrahedron mesh corresponding to the discrete point set. Each three-dimensional tetrahedron in the three-dimensional tetrahedron mesh has a target point in the discrete point set as a vertex.
[0068] It's understandable that by utilizing the GPU to execute the computational subtasks for each target point in parallel, the efficiency of tetrahedral mesh generation can be effectively improved. By setting computational limits, smaller computational subtasks can be processed in parallel on a single thread, followed by targeted processing of larger computational subtasks using thread blocks. This accelerates the GPU's parallel processing efficiency and improves its parallel processing performance, further improving the efficiency of tetrahedral mesh generation and reducing computing resource consumption.
[0069] According to embodiments of the present disclosure, by constructing a Delaunay tetrahedral mesh based on the three-dimensional local Delaunay lemma, the mesh update range corresponding to each point in a discrete point set can be determined, thereby ensuring accurate results. Furthermore, the range defined by the three-dimensional local Delaunay lemma is smaller than the safety radius, resulting in fewer tetrahedral mesh updates and higher efficiency. Furthermore, by utilizing a GPU to execute computational subtasks for each target point in parallel, the efficiency of tetrahedral mesh generation can be effectively improved. By setting computational limits, computational subtasks with smaller computational loads can be processed in parallel first using a single thread, followed by targeted processing of computational subtasks with larger computational loads using thread blocks. This can accelerate the parallel processing efficiency of the GPU, improve the GPU's parallel processing performance, further improve the efficiency of tetrahedral mesh generation, and help reduce computing resource consumption. Therefore, the method for generating three-dimensional tetrahedral meshes in parallel based on a graphics processor provided by embodiments of the present disclosure can at least partially overcome the technical problems in related arts of balancing mesh generation quality and efficiency, and consuming a large amount of computing resources to generate three-dimensional tetrahedral meshes.
[0070] According to an embodiment of the present disclosure, the preset unit grid is a unit cube including M cells, the discrete point set includes N target points, M<N, and M and N are positive integers, and the obtained discrete point set is processed based on the preset unit grid to obtain a mapping relationship between the discrete point set and the preset unit grid, including:
[0071] Match the discrete point set with the preset cell grid to determine the cell number corresponding to each target point;
[0072] According to the cell number corresponding to each target point, the N target points in the discrete point set are sorted to obtain the mapping relationship between the N target points and the M cells.
[0073] According to an embodiment of the present disclosure, by matching a preset unit grid with a bounding box of a discrete point set, the bounding box of the discrete point set can be divided into units of uniform size, thereby obtaining a mapping relationship between the discrete point set and the preset unit grid.
[0074] According to one embodiment of the present disclosure, the discrete point set can be first matched to the interior of the unit cube by translation and scaling, and then the unit cube can be divided into a uniform 3D grid. For example, assuming that the discrete point set includes N target points, the number of cells can be set to M=N / 4, where M and N are positive integers. Furthermore, the number of empty cells can be calculated, and the number of cells can be adjusted according to the ratio between the number of non-empty cells and the total number of cells. On this basis, the cell number of each target point can be determined, and then the N target points in the discrete point set can be sorted in the order of the corresponding cell numbers.
[0075] According to an embodiment of the present disclosure, the sorted point set range corresponding to each cell can be counted to obtain a mapping relationship between N target points and M cells, so that all target points in a cell with a given number can be quickly found based on the mapping relationship.
[0076] According to an embodiment of the present disclosure, a three-dimensional tetrahedron in a target neighborhood includes a target point and a triangle corresponding to the target point. Based on a mapping relationship and a three-dimensional local Delaunay lemma, threads constructed by a graphics processor are used to calculate in parallel the target neighborhood of each target point in a discrete point set, including: based on a mapping relationship and a three-dimensional local Delaunay lemma, threads are used to execute in parallel the first processing task of each target point to obtain the execution result of the first processing task of each target point. The computing task of the thread is subject to a preset computing limit, and each first processing task corresponds to a single thread; for each first target point characterized by a successful execution result, the first target neighborhood of each first target point is determined.
[0077] According to the embodiments of the present disclosure, Figure 4B As shown, the three-dimensional tetrahedron Including the target point a and the triangle opposite to the target point a (Depend on Figure 4B The green edge and point a in the figure).
[0078] According to an embodiment of the present disclosure, based on the mapping relationship and the three-dimensional local Delaunay lemma, threads can be used to execute the first processing task of each target point in parallel to obtain the execution result of the first processing task of each target point. Each target point corresponds to a single thread, and the computing task of the thread is subject to a preset computing limit. For example, if the computing requirement of the first processing task of the target point does not exceed the computing limit, the first processing task is successfully executed. For example, if the computing requirement of the first processing task of the target point exceeds the computing limit, the first processing task will fail to execute. The target point where the first processing task is successfully executed can be determined as the first target point, and the target point where the first processing task fails to execute can be determined as the second target point.
[0079] According to an embodiment of the present disclosure, for each first target point characterized by a successful execution result, a first target neighborhood of each first target point can be determined according to a calculation result of the first processing task.
[0080] According to an embodiment of the present disclosure, for each second target point whose computing demand exceeds the computing limit, based on the mapping relationship and the three-dimensional local Delaunay lemma, the thread block constructed by the graphics processor is used to parallely calculate the target-neighborhood of each second target point, so as to obtain the target-neighborhood set corresponding to the discrete point set, including: for each second target point whose execution result characterizes a failure, based on the mapping relationship and the three-dimensional local Delaunay lemma, the thread block is used to parallely execute the second processing task of each second target point, so as to obtain the second target-neighborhood of each second target point, and the thread block includes multiple threads; according to the first target-neighborhood of each first target point and the second target-neighborhood of each second target point, the target-neighborhood set corresponding to the discrete point set is obtained.
[0081] According to an embodiment of the present disclosure, a thread block includes multiple threads, for example, 128 threads. For each second target point whose execution result indicates a failure, based on the mapping relationship and the three-dimensional local Delaunay lemma, the thread block can be used to execute the second processing task for each second target point in parallel. Based on the calculation results of the second processing task, the second target-neighborhood of each second target point can be determined.
[0082] According to an embodiment of the present disclosure, a target-neighborhood set corresponding to a discrete point set can be obtained based on the first target-neighborhood of each first target point and the second target-neighborhood of each second target point. Specifically, each first target-neighborhood and each second target-neighborhood can together constitute the target-neighborhood set of the discrete point set.
[0083] According to the embodiments of the present disclosure, by utilizing the GPU to execute the first processing task for each target point in parallel, the efficiency of tetrahedral mesh generation can be effectively improved. By setting a computational limit, the first processing task with a smaller computational load can be processed in parallel based on a single thread, and then the second processing task with a larger computational load can be processed in a targeted manner based on thread blocks. This can accelerate the parallel processing efficiency of the GPU and improve the GPU's parallel processing performance, further improving the efficiency of tetrahedral mesh generation and helping to reduce the consumption of computing resources.
[0084] According to an embodiment of the present disclosure, for each target point, based on the mapping relationship and the three-dimensional local Delaunay lemma, threads are used to execute the first processing task of each target point in parallel, including: determining a cell set corresponding to the target point based on an initial neighborhood determined based on a preset cell grid, the cell set including a central cell containing the target point and multiple adjacent cells adjacent to the central cell; based on the target point, performing half-space intersection processing on each other target point located in the cell set to obtain an intermediate neighborhood corresponding to the target point; based on the circumscribed sphere corresponding to the specified triangle in the intermediate neighborhood, searching for other target points existing in the circumscribed sphere based on the computational limit of the thread, the computational limit being determined based on the number of iterations, the number of cell searches, and the cell search method; in the case where other target points exist in the circumscribed sphere, iteratively performing the following operations: determining the other target points existing in the circumscribed sphere as target points to be added; based on the target point, performing half-space intersection processing on the target point to be added to update the intermediate neighborhood; in the case where no other target points exist in the circumscribed sphere, determining the latest intermediate neighborhood as the first target neighborhood.
[0085] According to one embodiment of the present disclosure, a closed triangulation can be constructed based on four virtual points located infinitely outside a preset unit grid (i.e., a unit cube), yielding an initial neighborhood. For each target point, the grid structure of the preset unit grid can be used to locate the central cell containing the target point and the six adjacent cells immediately adjacent to the central cell, yielding a set of cells corresponding to the target point. These six adjacent cells are located in front of, behind, to the left, to the right, above, and below the central cell, respectively.
[0086] According to an embodiment of the present disclosure, based on the target point, a half-space intersection algorithm may be performed on each other target point within the cell set to obtain a relatively compact triangulation, that is, a middle neighborhood corresponding to the target point.
[0087] According to one embodiment of the present disclosure, for each triangle in the first intermediate neighborhood, the x-axis coordinates of the three vertices of the triangle are compared with the x-axis coordinates of the target point. If the x-axis coordinate of the target point is not the largest or smallest, the triangle is determined to be a designated triangle; otherwise, no processing is performed. Given that each tetrahedron in the first intermediate neighborhood has the target point as a vertex, specifying the triangles used to update the first intermediate neighborhood according to a preset rule can avoid unnecessary repeated calculations, thereby improving computational efficiency.
[0088] According to an embodiment of the present disclosure, a tetrahedron circumscribed sphere corresponding to a specified triangle can be used to search for other target points within the circumscribed sphere based on the thread's computational limit. The computational limit is determined based on the number of iterations, the number of cells to be searched, and the cell search method. For example, the number of iterations can be capped at 40, the number of cells to be searched within each circumscribed sphere in each iteration can be capped at 200, and only fast floating-point checking can be used.
[0089] According to one embodiment of the present disclosure, when searching for a point within a sphere circumscribing a specified triangle, the cell range corresponding to the sphere is first determined. For example, when the center of the sphere is within the unit cube, the cell range can be determined by the coordinate range. For example, when the center of the sphere is outside the unit cube, the cell range of the intersection of the unit cube and the sphere can be used.
[0090] According to one embodiment of the present disclosure, for each circumscribed sphere, the search begins at the cell containing the center of the sphere and proceeds from the cell closest to the cell containing the center of the sphere to the cell farthest from the center of the sphere. If the center of the circumscribed sphere is outside the unit cube, the search begins at the cell containing the target point.
[0091] According to one embodiment of the present disclosure, to determine whether a point e is within the circumscribed sphere formed by points a, b, c, and d, the following formula may be used:
[0092] (1)
[0093] In formula (1), 、 、 are the x-axis, y-axis, and z-axis coordinates of point a, respectively. 、 、 are the x-axis, y-axis, and z-axis coordinates of point b, 、 、 are the x-axis, y-axis, and z-axis coordinates of point c, respectively. 、 、 are the x-axis, y-axis, and z-axis coordinates of point d, 、 、 are the x-axis, y-axis, and z-axis coordinates of point e respectively. is the distance between point b and point a, is the distance between point c and point a, is the distance between point d and point a, is the distance between point e and point a.
[0094] The sign of the determinant can indicate whether the point e is inside / on / outside the circumsphere. For example, Shewchuk's predicates robust determination algorithm can be used to determine the sign of the determinant in floating-point numbers. The algorithm involves two steps: a fast floating-point check and an accurate check using floating-point extensions.
[0095] According to an embodiment of the present disclosure, during the first processing task, only fast floating-point checks are used to mark the circumscribed spheres that require precise checks, and the labels are updated in an iterative process. After the algorithm completes, if any circumscribed spheres are still marked, they are further processed in the subsequent second processing task.
[0096] According to embodiments of the present disclosure, when another target point is found within any circumscribed sphere, that point is identified as a target point to be added, denoted as point v. Based on the target point, a half-space intersection process can be performed on the target point to be added, updating the current intermediate first-neighborhood. If no point is found within any of the circumscribed spheres to be processed, the latest intermediate first-neighborhood is determined as the first target first-neighborhood.
[0097] According to an embodiment of the present disclosure, based on the target point, half-space intersection processing is performed on the target point to be added, and updating the middle neighborhood includes: traversing the triangles in the current middle neighborhood, searching for the triangle to be reconstructed in the corresponding circumscribed sphere that contains the target point to be added, and obtaining a set of triangles to be reconstructed corresponding to the target point to be added; reconstructing the triangles to be reconstructed in the set of triangles to be reconstructed, and determining the boundary of the set of triangles to be reconstructed; and updating the middle neighborhood according to the boundary of the target point to be added and the set of triangles to be reconstructed.
[0098] According to embodiments of the present disclosure, a thread can traverse all triangles in the current Delaunay neighborhood to determine whether point v is within the circumscribed sphere of the triangle's corresponding tetrahedron. If so, the current triangle is determined to be a triangle to be reconstructed, obtaining a set of triangles to be reconstructed R. The set of triangles to be reconstructed R is then removed from the current Delaunay neighborhood list.
[0099] According to an embodiment of the present disclosure, the boundary of the triangle set R to be reconstructed can be first initialized to any triangle in the triangle set R to be reconstructed, and then the triangle can be attempted to be merged with other triangles in the triangle set R to be reconstructed, and the merged boundary can be recorded. Finally, when all triangles are merged, the boundary of the triangle set R to be reconstructed is obtained.
[0100] According to an embodiment of the present disclosure, each boundary edge of the triangle set R to be reconstructed and the point v may be connected to form a new triangle, and the new triangle may be added to the Delaunay neighborhood list to update the middle neighborhood.
[0101] Figure 4D The figure schematically shows a half-space intersection process according to an embodiment of the present disclosure.
[0102] Figure 4D The figure shows the changes to the current Delaunay neighborhood of a target point a and its dual, where point a is the target point and point v is the update point. Specifically, R (triangle cde and triangle edf) is first found and removed. Then, the boundary of R (polygon cdfe) is found. Finally, each edge in the boundary of R is connected to point v to form a new triangle. The half-space intersection algorithm gets its name from its use of the half-space to clip convex polyhedra from a dual perspective.
[0103] According to an embodiment of the present disclosure, based on the mapping relationship and the three-dimensional local Delaunay lemma, the second processing task of each second target point is executed in parallel by using thread blocks to obtain the second target neighborhood of each second target point, including: according to the circumscribed sphere corresponding to the specified triangle in the middle neighborhood, other target points existing in the circumscribed sphere are searched in parallel based on the thread blocks; when there are other target points in the circumscribed sphere, the following operations are iteratively performed: the other target points existing in the circumscribed sphere are determined as target points to be added; based on the second target point, half-space intersection processing is performed on the target point to be added, and the middle neighborhood is updated; when there are no other target points in the circumscribed sphere, the latest middle neighborhood is determined as the second target neighborhood.
[0104] According to an embodiment of the present disclosure, for each triangle in the middle neighborhood, the x-axis coordinates of the three vertices of the triangle and the target point are compared. If the x-axis coordinate of the target point is not the largest or the smallest, the triangle is determined to be a specified triangle, otherwise no processing is performed. Furthermore, based on the circumscribed sphere of the tetrahedron corresponding to the specified triangle, other target points existing in the circumscribed sphere can be searched based on the thread block. Exemplarily, the thread block can include 128 threads, and the cells to be processed can be assigned to each thread in the thread block for parallel processing. For each point found by each thread, the point closest to the target point is selected as point v.
[0105] According to an embodiment of the present disclosure, whether a point is within the circumscribed sphere can be determined based on the above-described equation (1). It should be noted that when executing the second processing task, an exact check using floating-point extensions is used to determine the sign of the determinant in equation (1) using floating-point numbers. If the exact check returns zero, the SOS (Simulation of Simplicity) algorithm can be used to handle degenerate cases.
[0106] According to an embodiment of the present disclosure, when another target point is found within any circumscribed sphere, that point is identified as a target point to be added, denoted as point v. Based on the target point, a half-space intersection process can be performed on the target point to be added, updating the current intermediate first neighborhood. If no point is found within any of the circumscribed spheres to be processed, the latest intermediate first neighborhood is determined as the second target first neighborhood.
[0107] According to an embodiment of the present disclosure, based on the second target point, half-space intersection processing is performed on the target point to be added, and updating the middle neighborhood includes: traversing the triangles in the current middle neighborhood, and searching for the triangles to be reconstructed in the corresponding circumscribed sphere containing the target point to be added in parallel based on the thread block, and obtaining a set of triangles to be reconstructed corresponding to the target point to be added; reconstructing the triangles in the set of triangles to be reconstructed, and determining the boundary of the set of triangles to be reconstructed; and updating the middle neighborhood according to the boundary of the target point to be added and the set of triangles to be reconstructed.
[0108] According to an embodiment of the present disclosure, a thread block can be used to traverse all triangles in the current Delaunay neighborhood and determine whether point v is within the circumscribed sphere of the triangle's corresponding tetrahedron. For example, the thread block can include 128 threads, and all current triangles can be assigned to each thread, with each thread concurrently determining whether point v is within the circumscribed sphere. If so, the current triangle is determined to be a triangle to be reconstructed, resulting in a set of triangles to be reconstructed, R. This set of triangles to be reconstructed, R, is then removed from the current Delaunay neighborhood list.
[0109] According to an embodiment of the present disclosure, the boundary of the triangle set R to be reconstructed can be first initialized to any triangle in the triangle set R to be reconstructed, and then the triangle can be attempted to be merged with other triangles in the triangle set R to be reconstructed, and the merged boundary can be recorded. Finally, when all triangles are merged, the boundary of the triangle set R to be reconstructed is obtained.
[0110] According to an embodiment of the present disclosure, each boundary edge of the triangle set R to be reconstructed and the point v may be connected to form a new triangle, and the new triangle may be added to the Delaunay neighborhood list to update the middle neighborhood.
[0111] According to an embodiment of the present disclosure, generating a three-dimensional tetrahedral mesh corresponding to a discrete point set based on a target-neighborhood set corresponding to the discrete point set includes: determining the global index of each three-dimensional tetrahedron based on the target-neighborhood set corresponding to the discrete point set; and generating a three-dimensional tetrahedral mesh based on the global index of each three-dimensional tetrahedron.
[0112] According to one embodiment of the present disclosure, a tetrahedron with the target point as a vertex can be output based on the target neighborhood of each target point. For example, for each triangle in the target neighborhood, the x-axis coordinates of the three vertices of the triangle can be compared with the target point. If the x-axis coordinate of the target point is the second smallest, the tetrahedron formed by the current triangle and the target point is output. Given that each tetrahedron in the target neighborhood of the target point has the target point as a vertex, by specifying the output tetrahedron according to preset rules, unnecessary repeated output can be avoided, thereby helping to improve output efficiency.
[0113] According to an embodiment of the present disclosure, the number of tetrahedrons output by each target point can be counted and accumulated. For example, in the discrete point set {a, b, c, d}, point a outputs 1 tetrahedron, point b outputs 3 tetrahedrons, point c outputs 5 tetrahedrons, and point d outputs 4 tetrahedrons, then the accumulated result is {1, 4, 9, 13}. Through the accumulated results, the global index of each tetrahedron can be determined to ensure that the output order is correct when filling the tetrahedron list. Thus, a three-dimensional tetrahedron mesh can be generated based on the global index of each three-dimensional tetrahedron. Exemplarily, the tetrahedron list can be filled according to the global index of each three-dimensional tetrahedron, thereby generating a three-dimensional tetrahedron mesh corresponding to the discrete point set.
[0114] Figure 5A A flowchart for executing a first processing task according to an embodiment of the present disclosure is schematically shown.
[0115] like Figure 5A As shown, in operation S510, a cell set corresponding to the target point is determined according to an initial neighborhood determined based on a preset cell grid, and the cell set includes a central cell containing the target point and a plurality of adjacent cells adjacent to the central cell.
[0116] In operation S520 , based on the target point, a half-space intersection process is performed on each other target point located in the cell set to obtain an intermediate neighborhood corresponding to the target point.
[0117] In operation S530 , other target points existing in the circumscribed sphere corresponding to the designated triangle in the middle neighborhood are searched based on the computational quota of the thread, where the computational quota is determined based on the number of iterations, the number of cells searched, and the cell search method.
[0118] In operation S540 , if there are other target points in the circumscribed sphere, the following operations are iteratively performed: the other target points in the circumscribed sphere are determined as target points to be added; based on the target points, a half-space intersection process is performed on the target points to be added, and an intermediate neighborhood is updated.
[0119] In operation S550 , if no other target points exist within the circumscribed sphere, the latest middle-neighborhood is determined as the first target-neighborhood.
[0120] Figure 5B The flowchart of performing half-space intersection processing according to an embodiment of the present disclosure is schematically shown.
[0121] like Figure 5B As shown, in operation S541, the triangles in the current middle neighborhood are traversed to find the triangle to be reconstructed in the corresponding circumscribed sphere that contains the target point to be added, and a set of triangles to be reconstructed corresponding to the target point to be added is obtained.
[0122] In operation S542 , the triangles to be reconstructed in the set of triangles to be reconstructed are reconstructed, and the boundary of the set of triangles to be reconstructed is determined.
[0123] In operation S543 , the middle neighborhood is updated according to the target point to be added and the boundary of the triangle set to be reconstructed.
[0124] Figure 6 A block diagram schematically illustrates an apparatus for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor according to an embodiment of the present disclosure.
[0125] like Figure 6 As shown, the apparatus 600 for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor includes a mapping module 610 , a first processing module 620 , a second processing module 630 and a generating module 640 .
[0126] The mapping module 610 is configured to process the obtained discrete point set based on the preset unit grid to obtain a mapping relationship between the discrete point set and the preset unit grid.
[0127] The first processing module 620 is used to calculate the target-neighborhood of each target point in the discrete point set in parallel based on the mapping relationship using threads constructed by the graphics processor, wherein the target-neighborhood represents a set of three-dimensional tetrahedrons with the target point as a vertex, and the computing task of the thread is subject to a preset computing limit.
[0128] The second processing module 630 is used to use the thread block constructed by the graphics processor to parallelly calculate the target-neighborhood of each second target point for each second target point whose computing demand exceeds the computing limit, and obtain a target-neighborhood set corresponding to the discrete point set.
[0129] The generating module 640 is configured to generate a three-dimensional tetrahedral mesh corresponding to the discrete point set according to the target-neighborhood set corresponding to the discrete point set.
[0130] According to the embodiments of the present invention, any number of modules, sub-modules, units, and sub-units, or at least part of the functions of any number of them, can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, sub-modules, units, and sub-units can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, sub-modules, units, and sub-units can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, sub-modules, units, and sub-units can be at least partially implemented as a computer program module, which can perform the corresponding functions when the computer program module is executed.
[0131] For example, any number of the mapping module 610, the first processing module 620, the second processing module 630, and the generation module 640 may be combined into a single module / unit / sub-unit, or any one of these modules / units / sub-units may be split into multiple modules / units / sub-units. Alternatively, at least part of the functionality of one or more of these modules / units / sub-units may be combined with at least part of the functionality of other modules / units / sub-units and implemented in a single module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the mapping module 610, the first processing module 620, the second processing module 630, and the generation module 640 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or may be implemented in hardware or firmware by any other reasonable means of integrating or packaging circuits, or may be implemented in any one of software, hardware, and firmware, or in any appropriate combination of any of these. Alternatively, at least one of the mapping module 610 , the first processing module 620 , the second processing module 630 , and the generating module 640 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
[0132] It should be noted that the device part for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor in the embodiments of the present disclosure corresponds to the method part for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor in the embodiments of the present disclosure. The description of the device part for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor specifically refers to the method part for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor, which will not be repeated here.
[0133] Figure 7 A block diagram of an electronic device suitable for implementing the above-described method according to an embodiment of the present disclosure is schematically shown. Figure 7 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0134] like Figure 7 As shown, the electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 708 into a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0135] Various programs and data required for the operation of the electronic device 700 are stored in the RAM 703. The processor 701, ROM 702, and RAM 703 are connected to each other via a bus 704. The processor 701 executes the various operations of the method flow according to the embodiment of the present disclosure by executing the programs in the ROM 702 and / or RAM 703. It should be noted that the programs may also be stored in one or more memories other than the ROM 702 and RAM 703. The processor 701 may also execute the various operations of the method flow according to the embodiment of the present disclosure by executing the programs stored in the one or more memories.
[0136] According to an embodiment of the present disclosure, electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to bus 704. Electronic device 700 may also include one or more of the following components connected to I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section 708 including a hard disk; and a communication section 709 including a network interface card such as a LAN card or modem. Communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to I / O interface 705 as needed. Removable media 711, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in drive 710 as needed, so that computer programs read from the removable media can be installed into storage section 708 as needed.
[0137] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0138] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when executed, implements the method according to the embodiments of the present disclosure.
[0139] According to embodiments of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples include, but are not limited to, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0140] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 702 and / or the RAM 703 described above and / or one or more memories other than the ROM 702 and the RAM 703 .
[0141] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the method of generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor provided by the embodiment of the present disclosure.
[0142] When the computer program is executed by the processor 701, the above functions defined in the system / device of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0143] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 709, and / or installed from a removable medium 711. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0144] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).
[0145] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of the systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. For example, two boxes shown in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, as well as the combination of boxes in the block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified functions or operations, or can be implemented using a combination of dedicated hardware and computer instructions. It will be understood by those skilled in the art that the features described in the various embodiments of the present disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or coupled in various ways, and all of these combinations and / or couplings fall within the scope of the present disclosure.
[0146] The above describes the embodiments of the present disclosure. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A method for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor, comprising: Based on a preset unit grid, the obtained discrete point set is processed to obtain a mapping relationship between the discrete point set and the preset unit grid; Based on the mapping relationship and the three-dimensional local Delaunay lemma, threads constructed by a graphics processing unit are used to parallely calculate a target-neighborhood for each target point in the discrete point set, wherein the target-neighborhood represents a set of three-dimensional tetrahedrons with the target point as a vertex, and the computational tasks of the threads are subject to a preset computational limit; For each second target point whose computational requirement exceeds the computational limit, based on the mapping relationship and the three-dimensional local Delaunay lemma, using thread blocks constructed by a graphics processing unit, respectively, calculate the target-neighborhood of each second target point in parallel to obtain a target-neighborhood set corresponding to the discrete point set; A three-dimensional tetrahedral mesh corresponding to the discrete point set is generated according to a target-neighborhood set corresponding to the discrete point set.
2. The method according to claim 1, wherein The preset unit grid is a unit cube including M cells, the discrete point set includes N target points, M<N, and M and N are positive integers, and the obtained discrete point set is processed based on the preset unit grid to obtain a mapping relationship between the discrete point set and the preset unit grid, including: Matching the discrete point set with the preset unit grid to determine the cell number corresponding to each target point; According to the cell number corresponding to each of the target points, the N target points in the discrete point set are sorted to obtain a mapping relationship between the N target points and the M cells.
3. The method according to claim 2, wherein the three-dimensional tetrahedron in the target-neighborhood includes the target point and a triangle corresponding to the target point, and wherein the step of calculating the target-neighborhood of each target point in the discrete point set in parallel using threads constructed by a graphics processing unit based on the mapping relationship and the three-dimensional local Delaunay lemma comprises: Based on the mapping relationship and the three-dimensional local Delaunay lemma, the threads are used to execute the first processing task of each target point in parallel to obtain an execution result of the first processing task of each target point, wherein the computing task of the thread is limited by the computing limit, and each first processing task corresponds to a single thread; For each first target point whose execution result indicates success, a first target neighborhood of each first target point is determined.
4. The method according to claim 3, wherein: For each second target point whose computational requirement exceeds the computational limit, based on the mapping relationship and the three-dimensional local Delaunay lemma, the target-neighborhood set corresponding to each second target point is calculated in parallel using thread blocks constructed by a graphics processor to obtain the target-neighborhood set corresponding to the discrete point set. For each second target point whose execution result indicates a failure, based on the mapping relationship and the three-dimensional local Delaunay lemma, using the thread block to execute the second processing task of each second target point in parallel to obtain a second target neighborhood of each second target point, the thread block including multiple threads; A target-neighborhood set corresponding to the discrete point set is obtained according to the first target-neighborhood of each of the first target points and the second target-neighborhood of each of the second target points.
5. The method according to claim 4, wherein For each target point, based on the mapping relationship and the three-dimensional local Delaunay lemma, using the threads to execute the first processing task of each target point in parallel includes: Determine, according to an initial neighborhood determined based on the preset cell grid, a cell set corresponding to the target point, the cell set including a central cell containing the target point and a plurality of adjacent cells immediately adjacent to the central cell; Based on the target point, performing half-space intersection processing on each of the other target points located in the cell set to obtain an intermediate neighborhood corresponding to the target point; Searching for other target points within the circumscribed sphere corresponding to a designated triangle in the middle neighborhood based on a computational quota of the thread, wherein the computational quota is determined based on a number of iterations, a number of cells to be searched, and a cell search method; In the case that there are other target points in the circumscribed sphere, iteratively performing the following operations: determining the other target points in the circumscribed sphere as target points to be added; performing half-space intersection processing on the target points to be added based on the target points, and updating the middle neighborhood; When there is no other target point in the circumscribed sphere, the latest intermediate neighborhood is determined as the first target neighborhood.
6. The method according to claim 5, wherein: The performing half-space intersection processing on the target point to be added based on the target point, and updating the middle neighborhood includes: Traversing the triangles in the current middle neighborhood, searching for the triangle to be reconstructed that contains the target point to be added in the corresponding circumscribed sphere, and obtaining a set of triangles to be reconstructed that correspond to the target point to be added; Reconstructing the to-be-reconstructed triangles in the to-be-reconstructed triangle set, and determining a boundary of the to-be-reconstructed triangle set; The middle neighborhood is updated according to the target point to be added and the boundary of the triangle set to be reconstructed.
7. The method according to claim 5, wherein: Based on the mapping relationship and the three-dimensional local Delaunay lemma, the thread blocks are used to execute the second processing tasks of each second target point in parallel to obtain the second target neighborhood of each second target point. The second processing tasks of each second target point are executed in parallel using the thread blocks to obtain the second target neighborhood of each second target point. According to the circumscribed sphere corresponding to the designated triangle in the middle neighborhood, searching for other target points existing in the circumscribed sphere in parallel based on the thread blocks; If there are other target points in the circumscribed sphere, iteratively performing the following operations: determining the other target points in the circumscribed sphere as target points to be added; performing half-space intersection processing on the target points to be added based on the second target points, and updating the middle neighborhood; When there is no other target point in the circumscribed sphere, the latest intermediate neighborhood is determined as the second target neighborhood.
8. The method according to claim 7, wherein: The performing half-space intersection processing on the target point to be added based on the second target point, and updating the middle neighborhood includes: Traversing the triangles in the current middle neighborhood, searching for triangles to be reconstructed in the corresponding circumscribed sphere containing the target point to be added in parallel based on the thread blocks, and obtaining a set of triangles to be reconstructed corresponding to the target point to be added; Reconstructing triangles in the to-be-reconstructed triangle set to determine a boundary of the to-be-reconstructed triangle set; The middle neighborhood is updated according to the target point to be added and the boundary of the triangle set to be reconstructed.
9. The method according to any one of claims 1 to 8, wherein Generating a three-dimensional tetrahedral mesh corresponding to the discrete point set according to a target-neighborhood set corresponding to the discrete point set comprises: determining a global index of each of the three-dimensional tetrahedrons according to a target-neighborhood set corresponding to the discrete point set; The three-dimensional tetrahedron mesh is generated according to the global index of each three-dimensional tetrahedron.
10. A device for generating a three-dimensional tetrahedral mesh in parallel based on a graphics processor, comprising: A mapping module, configured to process the obtained discrete point set based on a preset unit grid to obtain a mapping relationship between the discrete point set and the preset unit grid; a first processing module configured to calculate, in parallel, a target-neighborhood for each target point in the discrete point set based on the mapping relationship and the three-dimensional local Delaunay lemma using threads constructed by a graphics processing unit, wherein the target-neighborhood represents a set of three-dimensional tetrahedrons with the target point as a vertex, and the computational tasks of the threads are subject to a preset computational limit; a second processing module configured to, for each second target point whose computational requirement exceeds the computational limit, calculate, in parallel, a target-neighborhood of each second target point using thread blocks constructed by a graphics processing unit based on the mapping relationship and the three-dimensional local Delaunay lemma, to obtain a target-neighborhood set corresponding to the discrete point set; A generating module is used to generate a three-dimensional tetrahedral mesh corresponding to the discrete point set according to a target-neighborhood set corresponding to the discrete point set.
Citation Information
Patent Citations
Scattered point cloud Delaunay triangulation curved surface reconstruction method based on mapping method
CN103985155A
Multi-thread parallel computing method and system for three-dimensional cut Voronoi diagram
CN111080509A