A Fast Distributed Plane-to-Plane Matching Method Based on Dual Space Search Trees
By adopting the distributed face-to-face matching method of dual-space search trees in numerical simulation, the problems of large amount and low efficiency of face-to-face matching in the existing technology are solved, efficient parallel computing is achieved and space complexity is reduced, and the calculation efficiency of face-to-face matching is significantly improved.
Patent Information
- Application Number
- CN202510428178.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-04-08
AI Technical Summary
The prior art has a large amount of calculation and low calculation efficiency when matching face-to-face, and single-core serial computing results in low simulation computing efficiency when the grid is large.
A fast distributed face-to-face matching method based on dual-space search trees is adopted, and distributed and centralized storage is performed through the combination of face-to-face sets A and B, and a spatial search tree TreeA and TreeB are established to realize parallel traversal and matching, reducing spatial complexity and improving computing efficiency.
Through the filtering mechanism of parallel computing and spatial search tree, the spatial complexity of face-to-face matching is significantly reduced, from O(M * N) to O(logM * logN), improving the calculation efficiency of face-to-face matching.
Smart Images

Figure CN119961479B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of numerical simulation, and in particular to a fast distributed surface-to-surface matching method based on a dual spatial search tree. Background Art
[0002] In numerical simulation calculations, such as contact and collision problems in dynamics, multi-domain coupling, etc., they all involve the problem of mesh surface matching on both sides of the contact boundary, collision, or coupling interface.
[0003] The surface-to-surface matching method adopted by the prior art is to traverse each of the two sets of patch sets participating in the matching one by one, and calculate whether each surface in one set of patch sets matches each surface in the other set of patch sets. The space complexity level of this method is the product of the number of surfaces in one set of patch sets and the number of surfaces in the other set of patch sets. This method has a large amount of calculation and low calculation efficiency; and currently, most surface-to-surface matching methods are single-core serial calculations. When the mesh scale is large, the serial calculation will cause the surface-to-surface matching calculation to affect the solution efficiency of the entire simulation calculation. Summary of the Invention
[0004] In view of the above problems, the present invention provides a fast distributed surface-to-surface matching method based on a dual spatial search tree, which can solve the problems of large calculation amount and low calculation efficiency when the prior art uses the method of traversing each of the two sets of patch sets participating in the matching one by one for surface-to-surface matching; and realizes reducing the space complexity of surface-to-surface matching and performing parallel calculation on surface-to-surface matching to improve the calculation efficiency of surface-to-surface matching.
[0005] To achieve the above object, the technical solution adopted by the present invention is as follows:
[0006] A fast distributed surface-to-surface matching method based on a dual spatial search tree provided by the present invention includes the following steps:
[0007] S101: Store a set of patch set A distributively in each process, and store another set of patch set B centrally in each process; if both patch set A and patch set B are distributively stored, then collect patch set B across all processes and convert it into central storage; if both patch set A and patch set B are centrally stored, then split patch set A across processes and convert it into distributed storage;
[0008] S102: Build spatial search trees for patch set A and patch set B respectively. Name the spatial search tree built for patch set A as TreeA, and name the spatial search tree built for patch set B as TreeB;
[0009] S103: Each process storing the patch set A traverses each layer of the bounding boxes of its own process's TreeA. For each layer of the bounding boxes of its own process's TreeA, it traverses each layer of the bounding boxes of TreeB respectively, and calculates whether the bounding box of TreeA intersects with the bounding box of TreeB.
[0010] S104: If the bounding box of TreeA intersects with the bounding box of TreeB, then calculate whether the patches in the intersecting bounding boxes of TreeA and TreeB intersect precisely.
[0011] S105: If the patches in the intersecting bounding boxes of TreeA and TreeB intersect precisely, then form a matching pair with the two matched patches, and record the metadata information of the matching pair. The metadata information includes the patch number and the process number to which it belongs.
[0012] S106: Detect whether each layer of the bounding boxes of process's TreeA has traversed each layer of the bounding boxes of TreeB. If it has traversed, then all processes collect the metadata information of the matching pairs of each process, and end the face-face matching.
[0013] For the fast distributed face-face matching method based on a dual spatial search tree provided by the present invention, preferably, in the step S102, the spatial search tree is an AABB tree.
[0014] For the fast distributed face-face matching method based on a dual spatial search tree provided by the present invention, preferably, in the step S104, the metadata information further includes the distance between patches and the normal vector.
[0015] For the fast distributed face-face matching method based on a dual spatial search tree provided by the present invention, preferably, in the step S106, the method for collecting the metadata information of the matching pairs of each process is: collecting through global communication; or collecting by first writing the metadata information of the matching pairs into a file and then reading the file data.
[0016] The above technical solution has the following advantages or beneficial effects:
[0017] The fast distributed face-to-face matching method based on a dual-space search tree provided by the present invention preprocesses two sets of face patches in step S101. Among them, the set of face patches A is stored distributively, and the set of face patches B is stored centrally. Only partial information of the set of face patches is available on the process that stores the set of face patches A distributively, while the complete information of the set of face patches is available on the process that stores the set of face patches B centrally. Several processes that store the set of face patches A distributively can simultaneously perform face-to-face matching with several processes that store the set of face patches B centrally, thereby implementing face-to-face matching between the set of face patches A and the set of face patches B in parallel; in step S102, a space search tree TreeA and a space search tree TreeB are respectively established for the set of face patches A and the set of face patches B. The space search tree can generate an envelope box structure for the face patches. Under the large-grain envelope box space, invalid face patch matching pairs can be quickly filtered out, improving the face-to-face matching efficiency; in step S103, each process storing the set of face patches A traverses each layer of the envelope box of its own process TreeA simultaneously, and for each layer of the envelope box of its own process TreeA, traverses each layer of the envelope box of TreeB respectively, so as to enable the process that stores the set of face patches A distributively to access the process that stores the set of face patches B centrally in parallel, and calculate and determine whether the envelope box of TreeA intersects with the envelope box of TreeB. Through parallel computing, the face-to-face matching efficiency between the set of face patches A and the set of face patches B can be improved; further, if the maximum number of face patches in a single process of the distributed set of face patches A is defined as M, then the space complexity of the set of face patches A in a single process is O(M). If the total number of all face patches in the set of face patches B is defined as N, then the space complexity of the set of face patches B is O(N). The space complexity of face-to-face matching between the set of face patches A and the set of face patches B is O(M * N). Since the space search tree generates an envelope box structure for the face patches, by determining whether the envelope box of TreeA intersects with the envelope box of TreeB, if they do not intersect, the face patch matching pair is discarded without further calculating whether the face patches intersect precisely. Through the above method, invalid face patch matching pairs can be filtered out, reducing the scale of face-to-face matching calculation, and realizing the reduction of the space complexity of the matching calculation from O(M * N) to O(logM * logN), thereby further improving the face-to-face matching efficiency between the set of face patches A and the set of face patches B; in steps S104 to S105, if the envelope box of TreeA intersects with the envelope box of TreeB, further calculation can be performed to determine whether the face patches in the intersecting envelope box of TreeA and TreeB intersect precisely. If the face patches in the intersecting envelope box of TreeA and TreeB intersect precisely, the two matched face patches are formed into a matching pair, and the metadata information of the matching pair is recorded. Here, the metadata information only includes the face patch number and the process number to which it belongs;In step S106, it is detected whether each layer of the bounding box of process TreeA has traversed each layer of the bounding box of TreeB. If the traversal is complete, all processes collect the metadata information of the matching pairs of each process. Since the metadata information only includes the patch number and the process number to which it belongs, the small amount of metadata information reduces the global communication data volume of the matching pairs and significantly improves the parallel search efficiency of face-to-face matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] By reading the following detailed description of the non-limiting embodiments with reference to the accompanying drawings, the present invention and its features, shapes, and advantages will become more obvious. The same reference numerals indicate the same parts in all the drawings. The drawings are not deliberately drawn to scale, and the focus is on showing the gist of the present invention.
[0019] Figure 1 It is a flowchart block diagram of a fast distributed face-to-face matching method based on a dual spatial search tree provided in Embodiment 1 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but it is not limited to the present invention. Embodiment 1:
[0021] As Figure 1 shown, a fast distributed face-to-face matching method based on a dual spatial search tree provided in Embodiment 1 of the present invention includes the following steps:
[0022] S101: A set of patch sets A are distributedly stored in each process, and another set of patch sets B are centrally stored in each process; if both patch set A and patch set B are distributedly stored, then patch set B is collected across all processes and converted into centralized storage; if both patch set A and patch set B are centrally stored, then patch set A is split across processes and converted into distributed storage;
[0023] S102: Spatial search trees are respectively established for patch set A and patch set B. The spatial search tree established for patch set A is named TreeA, and the spatial search tree established for patch set B is named TreeB;
[0024] S103: Each process storing patch set A traverses each layer of the bounding box of its own process's TreeA. For each layer of the bounding box of its own process's TreeA, it traverses each layer of the bounding box of TreeB respectively, and calculates whether the bounding box of TreeA intersects with the bounding box of TreeB;
[0025] S104: If the bounding box of TreeA intersects with the bounding box of TreeB, then calculate whether the patches in the intersecting bounding boxes of TreeA and TreeB are exactly intersecting;
[0026] S105: If the patches in the intersection bounding box of TreeA and TreeB intersect precisely, form a matching pair with the two matched patches, and record the metadata information of the matching pair, where the metadata information includes the patch number and the process number to which it belongs;
[0027] S106: Detect whether the bounding box of each layer of TreeA in each process has traversed the bounding box of each layer of TreeB. If it has traversed, all processes collect the metadata information of the matching pairs of each process, and end the face-to-face matching.
[0028] The fast distributed face-to-face matching method based on a dual-space search tree provided in Embodiment 1 of the present invention, in step S101, preprocesses two sets of face patches. Among them, the face patch set A is stored distributively, and the face patch set B is stored centrally. Only partial face patch set information exists on the process that stores the face patch set A distributively, while the complete face patch set information exists on the process that stores the face patch set B centrally. Several processes that store the face patch set A distributively can simultaneously perform face-to-face matching with several processes that store the face patch set B centrally, thereby implementing face-to-face matching between the face patch set A and the face patch set B in parallel; in step S102, a space search tree TreeA and a space search tree TreeB are respectively established for the face patch set A and the face patch set B. Using the space search tree, the face patches can be generated into an envelope box structure, and invalid face patch matching pairs can be quickly filtered out in the large-grain envelope box space, improving the face-to-face matching efficiency; in step S103, by making each process storing the face patch set A traverse each layer of the envelope box of its own process TreeA simultaneously, and for each layer of the envelope box of its own process TreeA, traverse each layer of the envelope box of TreeB respectively, it is realized that the process that stores the face patch set A distributively accesses the process that stores the face patch set B centrally in parallel, and calculates and determines whether the envelope box of TreeA intersects with the envelope box of TreeB. Through parallel computing, the face-to-face matching efficiency between the face patch set A and the face patch set B can be improved; further, if the maximum number of face patches in a single process of the distributed face patch set A is defined as M, then the space complexity of the face patch set A in a single process is O(M). If the total number of all face patches in the face patch set B is defined as N, then the space complexity of the face patch set B is O(N). The space complexity of the face-to-face matching between the face patch set A and the face patch set B is O(M * N). Since the space search tree generates the envelope box structure for the face patches, by determining whether the envelope box of TreeA intersects with the envelope box of TreeB, if they do not intersect, the face patch matching pair is abandoned, and there is no need to further calculate whether the face patches intersect precisely. Through the above method, invalid face patch matching pairs can be filtered out, reducing the scale of the face-to-face matching calculation, and realizing the reduction of the space complexity of the matching calculation from O(M * N) to O(logM * logN), thereby further improving the face-to-face matching efficiency between the face patch set A and the face patch set B; in steps S104 to S105, if the envelope box of TreeA intersects with the envelope box of TreeB, then it is possible to further calculate whether the face patches in the intersecting envelope box of TreeA and TreeB intersect precisely. If the face patches in the intersecting envelope box of TreeA and TreeB intersect precisely, then the two matched face patches are formed into a matching pair, and the metadata information of the matching pair is recorded. Here, the metadata information only includes the face patch number and the process number to which it belongs;In step S106, it is detected whether each layer of the bounding box of process TreeA has traversed each layer of the bounding box of TreeB. If the traversal is complete, all processes collect the metadata information of the matching pairs of each process. Since the metadata information only includes the patch number and the process number to which it belongs, the small amount of metadata information reduces the global communication data volume of the matching pairs and significantly improves the parallel search efficiency of face-to-face matching.
[0029] For the fast distributed face-to-face matching method based on a dual spatial search tree provided in Embodiment 1 of the present invention, preferably, in step S102, the spatial search tree is an AABB tree. The AABB tree can generate a bounding box for each patch in the patch set, and a large number of irrelevant patches can be quickly excluded by determining whether the bounding boxes intersect. In addition, a spatial search tree such as a quadtree with a function similar to that of the AABB tree can be used.
[0030] For the fast distributed face-to-face matching method based on a dual spatial search tree provided in Embodiment 1 of the present invention, preferably, in step S104, the metadata information also carries required content such as the distance and normal vector between patches, which is used to implement functions such as collision detection.
[0031] For the fast distributed face-to-face matching method based on a dual spatial search tree provided in Embodiment 1 of the present invention, preferably, in step S106, the method for collecting the metadata information of the matching pairs of each process is as follows: collecting the metadata information of the matching pairs recorded on different processes through global communication between processes; or when recording the metadata information of the matching pairs in step S105, first writing the metadata information of the matching pairs into a file, and after the face-to-face matching is completed, then reading the file data to obtain the metadata information of the matching pairs.
[0032] In summary, the fast distributed face-to-face matching method based on a dual spatial search tree provided by the present invention can solve the problems of large computational amount and low computational efficiency when the prior art uses the method of traversing each of the two patch sets participating in the matching one by one for face-to-face matching; it can reduce the spatial complexity of face-to-face matching and perform parallel computing for face-to-face matching to improve the computational efficiency of face-to-face matching.
[0033] Those skilled in the art should understand that those skilled in the art can implement the above variation examples in combination with the prior art and the above embodiments, which will not be elaborated here. Such variation examples do not affect the essence of the present invention and will not be elaborated here.
[0034] The preferred embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the above specific embodiments, and the devices and structures not described in detail should be understood to be implemented in a common manner in the art; any person skilled in the art can make many possible changes and modifications without departing from the technical solution of the present invention, or modify it into an equivalent embodiment with equivalent changes, which does not affect the essence of the present invention. Therefore, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still fall within the scope of protection of the technical solution of the present invention.
Claims
1. A fast distributed face-to-face matching method based on a dual-space search tree, characterized in that: The following steps are involved: S101: Distribute and store a set of face sets A in each process, and centrally store another set of face sets B in each process; if both face sets A and B are distributedly stored, collect face set B in all processes and convert it into centralized storage; if both face sets A and B are centralizedly stored, divide face set A into processes and convert it into distributed storage; S102: establishing spatial search trees for the face set A and the face set B respectively, naming the spatial search tree established for the face set A as TreeA, and naming the spatial search tree established for the face set B as TreeB; S103: Each process storing the face set A traverses each layer of the envelope box of the current process TreeA, and for each layer of the envelope box of the current process TreeA, traverses each layer of the envelope box of TreeB, and calculates whether the envelope box of TreeA intersects with the envelope box of TreeB; S104: If the envelope box of TreeA intersects with the envelope box of TreeB, calculate whether the face pieces in the intersecting envelope boxes of TreeA and TreeB intersect exactly; S105: If the faces in the intersection envelope of TreeA and TreeB intersect exactly, the two matched faces are combined into a matching pair, and metadata information of the matching pair is recorded, where the metadata information includes the face number and the process number to which it belongs; S106: Detect whether each layer of envelope box of each process TreeA has traversed each layer of envelope box of TreeB. If traversed, all processes collect metadata information of matching pairs of each process, and end the face-to-face matching.
2. The fast distributed face-to-face matching method based on dual-space search tree according to claim 1, characterized in that: In step S102, the spatial search tree is an AABB tree.
3. The fast distributed face-to-face matching method based on dual-space search tree according to claim 1, characterized in that: In step S104, the metadata information also includes the distance between patches and the normal vector.
4. The fast distributed face-to-face matching method based on dual-space search tree according to claim 1, characterized in that: In step S106, the method for collecting metadata information of the matching pair of each process is: collecting through global communication; or by first writing the metadata information of the matching pair into a file and then reading the file data for collection.
Citation Information
Patent Citations
A parallel multi-layer fast multi-pole subtree structure composite storage method
CN109947563A
Local collision detection method and device based on digital twin platform
CN119358200A