Construction method and retrieval method of high-dimensional space alternating direction digital tree
Through recursive optimization, the node coverage of the alternating direction of the digital tree solves the problem of low retrieval efficiency in the large -scale overlapping grid assembly, reduces the retrospective operation, and improves the execution speed of the pairing algorithm.
Patent Information
- Application Number
- CN202411935688.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-01-24
AI Technical Summary
In the parallel assembly process of large-scale overlapping grids, the retrieval efficiency of alternating direction digital trees is low, resulting in a bonding effect between the covered areas of sibling nodes at the same level, increasing the backtracking operation frequency and increasing time consumption.
By recursively optimizing the node coverage of the alternating direction digital tree, the continuation bounding box parameters of nodes at all levels are corrected to avoid the bonding effect between nodes at the same level and reduce backtracking operations during the retrieval process.
It effectively improves the execution speed of the interpolation unit and contribution unit pairing algorithm, reduces the time cost of query operations, and meets the needs of rapid assembly of large-scale overlapping grids.
Smart Images

Figure CN119358466A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the cross-technical field of computational fluid dynamics and computational geometry, and in particular to a construction method and a retrieval method for a high-dimensional space alternating direction digital tree. Background Art
[0002] With the widespread application of overlapping grid assembly technology in the field of computational fluid dynamics, a large number of unsteady evolution problems of flow fields involving multi-body relative motion have been effectively simulated numerically, thus providing strong support for the development of aircraft aerodynamics and industrial aerodynamics. In the overlapping grid assembly process, the pairing between interpolation units and contribution units is one of the key steps in the cross-region exchange of physical field information, and its execution efficiency directly affects the time cost of unsteady simulation. At present, researchers generally use high-dimensional space alternating direction digital trees to search for contribution units of known interpolation units, which to a certain extent meets the simulation needs of conventional engineering problems. However, they only use a simple space cutting method to calculate the extended bounding box parameters of the nodes during the construction process, which causes the bonding effect between the coverage areas of sibling nodes of the same level. In the subsequent contribution unit retrieval process, the above bonding effect will lead to a large number of backtracking operations, making the positioning route of the target particularly tortuous, resulting in a lot of time consumption. In particular, under the condition of anisotropic grids, the retrieval efficiency of conventional alternating direction digital trees is difficult to meet the needs of large-scale overlapping grid rapid assembly. Therefore, deep optimization of the structure of the alternating direction digital tree can suppress the backtracking frequency during the retrieval process and has important engineering application value for the parallel implementation of implicit assembly of large-scale overlapping grids. Summary of the invention
[0003] In order to overcome the deficiencies of the prior art, the present invention provides a method for constructing and retrieving a digital tree in alternating directions in a high-dimensional space, and solves the problems of low retrieval efficiency and the like in the prior art.
[0004] The technical solution adopted by the present invention to solve the above problems is: A method for constructing a high-dimensional space alternating direction digital tree comprises the following steps: S1, initialize the basic geometric parameters of the alternating direction digital tree; S2, calculate the critical bounding box parameters of the background grid cell; S3, calculate the extended bounding box parameters of the global root node; S4, insert and link nodes at all levels of the alternating direction digital tree; S5, optimize the node coverage of the alternating direction digital tree.
[0005] As a preferred technical solution, in step S1, the method for initializing the basic geometric parameters of the alternating direction digital tree includes one or more of the following: ① If the physical space dimension of the background grid to be retrieved is , then declare a signed integer variable For the internal data members of the alternating direction digital tree, The value is set to ;in, Indicates a general The dimension of space; ②Declare a signed integer variable is the total number of storage nodes, and Become an internal data member of the alternating direction digital tree; ③Declare a double-precision floating-point variable To store geometric tolerance parameters and use Become an internal data member of the alternating direction digital tree; ④Declare the global root node pointer ,make Becomes an internal data member of the alternating direction digital tree, and its initialization value is an empty address ; ⑤Use the vector container of C++ Standard Template Library Declare the node sequence of the alternating direction digital tree , and will Initialize to an empty vector; ⑥ Vector container using C++ Standard Template Library Declare the target collector required for the alternating direction digital tree retrieval process , and will Initialized to an empty vector.
[0006] As a preferred technical solution, step S2 includes the following steps: S21, in the three-dimensional physical coordinate system During the traversal of the volume unit of the background grid, the number of the current volume unit is , the current volume unit contains The coordinates of the space grid points are ;in, , , Respectively represent the numbers 0, 1, -1 spatial grid points Axis coordinates, , , Respectively represent the numbers 0, 1, -1 spatial grid points Axis coordinates, , , Respectively represent the numbers 0, 1, -1 spatial grid points Axis coordinates; S22, along , , The directions of the three coordinate axes are calculated The minimum and maximum values of the coordinate components of the space grid points are recorded as , consisting of 6 spatial planes The critical bounding box cut out; at the same time, As six-dimensional Generalized coordinates in space, It forms a one-to-one mapping relationship with the critical bounding box; among them, express Space grid points The minimum value of the axis coordinate component, express Space grid points The minimum value of the axis coordinate component, express Space grid points The minimum value of the axis coordinate component, express Space grid points The maximum value of the axis coordinate component, express Space grid points The maximum value of the axis coordinate component, express Space grid points The maximum value of the axis coordinate component; S23, take vector The subscript is Elements , copy the generalized coordinate components corresponding to the critical bounding box of the current volume unit to Member variables of middle.
[0007] As a preferred technical solution, step S3 includes the following steps: S31, outer loop traverses the node vector Each element in , the inner loop follows Count the minimum value of the generalized coordinate components of all critical bounding boxes in all directions With the maximum value , and then respectively and The value of is copied to Member variables of and Among them, represents an array containing the minimum values of all generalized coordinate components, represents an array containing the maximum values of all generalized coordinate components, Represents a node vector The element number in , , , represents the infimum of the extended bounding box, Represents the supremum of the extended bounding box; S32, outer loop traverses node vector Each element in , the inner loop follows The minimum scale component of all critical bounding boxes is calculated in each direction , and Multiply by the downscaling factor As a tree of alternating directions ; S33, modifying the extended bounding box parameters of the root node so that all generalized points on the current processor become inner points of the modified extended bounding box, by changing the extended bounding box parameters of the root node to , ;in, express The number in is Elements of express The number in is elements.
[0008] As a preferred technical solution, step S4 includes the following steps: S41, setting temporary auxiliary variables for the node insertion process, specifically including: ①Declaration type is Pointer variable of type , and will Points to the global root node address ; ②Declare a signed integer variable , and set The initial value is 0; Indicates the cross direction number variable; ③ The length of the opening is Dynamic array of and ;in, represents the infimum temporary variable, Represents the supremum temporary variable; ④Declare Boolean variables , and set The initial value is ; S42, use The loop inserts the current node into the alternating direction digital tree: equal When the condition is met, execute Loop, where the loop body is based on the pointer variable The existence of the left child node and the right child node of the object being pointed to are judged respectively; S43, release dynamic array and storage space.
[0009] As a preferred technical solution, step S42 includes the following steps: S421, if the pointer variable The left child node of the object being pointed to If exists, then judge The extended bounding box of the node to be inserted Coverage relationship: When the coverage relationship is established, first The pointer is updated to the left child node , then according to the expression For alternating direction parameters Update and then continue to the next Loop; if the pointer variable The left child node of the object being pointed to If it does not exist, first follow the current The variable indicates the direction of the coordinate cutting. The extended bounding box of the pointed node is halved and the left parameter value is stored in the dynamic array and Then, if the dynamic array and The extended bounding box described covers the current node to be inserted , then: link the current node to be inserted to The left child position of the pointed object, the dynamic array and The value is copied to the node's extended bounding box parameter and In step S42, the cycle; Step S422: If the pointer variable The right child node of the object being pointed to If exists, then judge The extended bounding box of the node to be inserted Coverage relationship: When the coverage relationship is established, first The pointer is updated to the right child node , then according to the expression For alternating direction parameters Update and then continue to the next Loop; if the pointer variable The right child node of the object being pointed to If it does not exist, first follow the current The variable indicates the direction of the coordinate cutting. The extended bounding box of the pointed node is halved and the right parameter value is stored in the dynamic array and Then, if the dynamic array and The extended bounding box described covers the current node to be inserted , then: link the current node to be inserted to The right child position of the pointed object, the dynamic array and The value is copied to the node's extended bounding box parameter and In step S42, the cycle.
[0010] As a preferred technical solution, in step S5, the node class of the digital tree in the alternating direction In the scope of , add a recursive function without a return type As A member function of is the tolerance correction parameter of the node extension bounding box, and the global root node pointer Direct call , and the member variables of the alternating direction digital tree Value Assignment .
[0011] As a preferred technical solution, step S5 includes the following steps: S51, at the node In the scope of coordinate directions, combined with the generalized point coordinate array The upper and lower bounding parameters of the extended bounding box of the current node and To make corrections: , ;in, , express No. elements; S52, if the left child pointer of the current node If the address pointed to is a non-null address value, first let Referent execution , the input tolerance parameter is the same as the function of the previous level ; then extract Supremum parameter of the critical bounding box of the member With the infimum parameter , respectively, along the alternating direction digital tree defined The supremum parameters of the extended bounding box of the current node in the coordinate direction With the infimum parameter To make corrections: , ; in, express No. elements, express No. elements; Step S53, if the right child pointer of the current node Points to a non-null address value, so first let Referent execution , whose input tolerance parameter is still the same as the function of the previous level ; then extract Supremum parameter of the critical bounding box of the member With the infimum parameter , respectively, along the alternating direction digital tree defined The supremum parameter of the extended bounding box of the current node in the coordinate direction With the infimum parameter To make corrections: , ; in, express No. elements, express No. elements.
[0012] A retrieval method, including the method for constructing a high-dimensional space alternating direction digital tree, further comprising the following steps: S6, retrieve contributing cells that cover the known interpolation cell centers; S7, returning the pairing relationship between the interpolation unit and the contribution unit; S8, release the storage space of the alternating direction digital tree members.
[0013] As a preferred technical solution, step S6 includes the following steps: S61, globally reducing the geometric data of the spatial point to be retrieved; S62, non-recursive search of contribution units covering spatial points: on each processor, traverse the sequence of spatial points to be searched obtained by the reduction in step S61 , check in turn on the current background grid sub-block The existence of the contribution unit of each element in and its location, combined with the vector container in the C++ Standard Template Library ,Using node collectors in alternating direction digital tree structures Storage coverage The first address of the node where the critical bounding box of the point is located.
[0014] Compared with the prior art, the present invention has the following beneficial effects: In the parallel assembly process of large-scale overlapping grids, the present invention can deeply optimize the retrieval structure of the digital tree in alternating directions in high-dimensional space, eliminate the sticking effect between the extended bounding boxes of nodes at the same level, and thus avoid unnecessary backtracking operations in the subsequent retrieval process; therefore, the optimization technology can greatly improve the execution speed of the interpolation unit and contribution unit pairing algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a schematic diagram of the retrieval process of the interpolation cell center point on the known grid area; Figure 2 It is a schematic diagram of the basic geometric parameter list of the alternating direction digital tree; Figure 3 It is a schematic diagram of a sequence of alternating direction digital tree node objects; Figure 4 It is a schematic diagram of the protocol of the background grid processor group from the point to be interpolated; Figure 5 is a schematic diagram of the process of returning and extracting cross-processor pairing query results; Figure 6 It is a cross-sectional view of the overlapping hole model in the embodiment (cross section x=4.8). DETAILED DESCRIPTION
[0016] The present invention will be further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0017] Example 1 like Figures 1 to 6 As shown, the present invention discloses a construction method and a retrieval method of a high-dimensional space alternating direction digital tree, which corrects the extended bounding box parameters of nodes at all levels of the alternating direction digital tree in a bottom-up order through a recursive execution mode, thereby overcoming the bonding effect between nodes at the same level. In the retrieval process of the alternating direction digital tree, the application of the present invention can reduce the backtracking frequency, thereby effectively reducing the time cost of the query operation.
[0018] Definitions of terms used in this invention: ① The critical bounding box of the point set: dimension Given a rectangular coordinate system in space , With a limited set , where the subscript is ( ) is represented by the element coordinates of , if the order , , ( ), then by Planes and ( ) is a rectangular area enclosed in space Point Set The critical bounding box of Represents the AND relationship of multiple logical expressions. From the definition, we can see that the point set The critical bounding box of is unique.
[0019] ②Extension bounding box of point set: define ① midpoint set The planes where the critical bounding boxes of each surface are located are translated outward to obtain a new set of planes and ( ), the rectangular area they enclose in space
[0020] Point Set The extended bounding box of It is called the extended bounding box. ( ) coordinate components, It is called the extended bounding box. The supremum of the coordinate components; where Represents the AND relationship of multiple logical expressions. From the definition, we can see that the point set The extended bounding box of is not unique.
[0021] ③ The extended bounding box of the node: In the alternating direction digital tree of the present invention, the current node The extended bounding box corresponding to the point set contained in the subtree of the root node is also called a node. The extended bounding box of .
[0022] In view of the problems of the prior art, the present invention provides a construction method and a retrieval method for an alternating direction digital tree in a high-dimensional space. Compared with the traditional alternating direction digital tree, the present invention adds a recursive operation process in the construction process. Starting from the terminal node of the alternating direction digital tree, the coverage of the extended bounding box of each level of the node is gradually reduced, while ensuring that the generalized point elements on each node are the inner points of the extended bounding box. This optimization algorithm can effectively suppress the adhesion effect between the coverage areas of sibling nodes of the same level, thereby reducing the number of backtracking times in the target positioning process and reducing the time cost of subsequent retrieval algorithms. In a standard C++ programming environment, such as Figure 1 As shown, the retrieval process of the interpolation cell center point on the known grid area includes the following 8 steps, among which step S5 is the key step of the present invention, and the other steps are the basic steps for realizing the present invention.
[0023] Step S1: Initialize the basic geometric parameters of the alternating direction digital tree. Figure 2 Alternating direction numbers shown The basic geometric parameters of the word tree are as follows: ① If the dimension of the physical space where the background grid to be retrieved is , then declare a signed integer variable is the internal data member of the alternating direction digital tree, and its value is set to , called generalized ②Declare a signed integer variable 𝑛 to store the total number of nodes and make it an internal data member of the alternating direction digital tree. ③Declare a double-precision floating-point variable To store geometric tolerance parameters, make them internal data members of the alternating direction digital tree. ④Declare the global root node pointer , making it an internal data member of the alternating direction digital tree, and its initialization value is the empty address ⑤Use the vector container of the C++ Standard Template Library ( ) declares the node sequence of the alternating direction digital tree , and initialize it to an empty vector. ⑥ Use the vector container of the C++ Standard Template Library to declare the target collector required for the alternating direction digital tree retrieval process , and initialize it to an empty vector. Here, the global root node pointer , node sequence And the target collector The elements are all customized using the present invention Describe the type. Figure 3 The initialization vector composed of the node addresses at each level in the alternating direction digital tree of the present invention is shown. In the retrieval structure of the present invention, the node set and the volume unit set form a one-to-one mapping. Because according to step S1, the total number of volume units of the background grid sub-block on the current processor is , so the vector The length is equal to .exist Figure 3 In the example, the box pointed by the arrow is the type. It describes the binding relationship between each body unit and each node. During the object construction process, the dynamic memory that needs to be opened includes: ① The index value stored in a signed integer variable , which is consistent with the traversal subscript of the volume unit sequence in the background grid sub-block. ② Generalized coordinate array stored in double-precision floating-point array , whose length is the same as the generalized Space Dimension Keep consistent. ③ The lower bound array of the extended bounding box stored in a double-precision floating-point array With the supremum array , their length is equal to ④ The present invention describes each The link relationship between the object and its left and right children, where the pointer variables of the left and right children are and , at the current step, they all point to empty address values .
[0024] Step S2: Calculate the critical bounding box parameters of the background grid unit. The following is an example of the traversal process of the background grid: ① Assume that the number of the current volume unit is , which contains The coordinates of the space grid points are ② Calculate along the three physical coordinate axes in turn The minimum and maximum values of the coordinate components of the space grid points are recorded as , thus forming a space composed of 6 planes The critical bounding box is cut out. At the same time, It can also be regarded as six-dimensional The generalized coordinates in space form a one-to-one mapping relationship with the critical bounding box. ③ Take the vector The subscript is Elements , copy the generalized coordinate components corresponding to the critical bounding box of the current volume unit to The Member variables In the array.
[0025] Step S3: Calculate the extended bounding box parameters of the global root node.
[0026] Step S31: Outer loop traverses node vector Each element in ( ), the inner loop follows Calculate the minimum value of the generalized coordinate components of all critical bounding boxes in all directions With the maximum value ( ), and then respectively and The value of is copied to Member variables and middle.
[0027] Step S32: Outer loop traverses node vector Each element in ( ), the inner loop follows The minimum scale component of all critical bounding boxes is calculated in each direction , and multiply it by the downscaling factor As a tree of alternating directions In the embodiment of the present invention, the empirical value =0.01 is sufficient.
[0028] Step S33: Modify the extended bounding box parameters of the root node so that all generalized points on the current processor become the inner points of the extended bounding box. The specific method is to change the extended bounding box parameters of the root node to , .
[0029] Step S4: insert and link nodes of all levels of the alternating direction digital tree. Because in step S3, the global root node has been bound to the body unit numbered 0, so in the current step, it is necessary to traverse from the body unit numbered 1 and insert the node elements bound to each other into the corresponding position of the alternating direction digital tree.
[0030] Step S41: Set temporary auxiliary variables for the node insertion process. ① Declare the type Pointer variable of type , and point it to the global root node address ②Declare a signed integer variable , Indicates the cross direction number variable (multidimensional space coordinate axis number variable), and sets its initial value to 0. ③ The length of the opening is Dynamic array of and ④Declare Boolean variables , and set its initial value to .
[0031] Step S42: Use The type loop inserts the current node into the alternating direction digital tree. When step S41 Declared Boolean variables equal When the condition is met, execute Loop, where the loop body is based on the pointer variable The existence of the left and right child nodes of the pointed object are judged separately.
[0032] Step S421: If the pointer variable The left child node of the object being pointed to If it exists, then further judge The extended bounding box of the node and the current node to be inserted When the covering relationship is established, ① first The pointer is updated to the left child node ,②Then according to the expression For alternating direction parameters Update (if If true, Update to 0; if If it is false, Updated to ), ③Finally continue the next loop process. If the pointer variable The left child node of the object being pointed to does not exist, then first, follow the current The variable indicates the direction of the coordinate cutting. The extended bounding box of the pointed node is halved and the left parameter value is stored in the dynamic array and Then, if the dynamic array and The extended bounding box described covers the current node to be inserted , then ① link the current node to be inserted to The left child position of the object pointed to, ② the dynamic array and The value is copied to the node's extended bounding box parameter and ③ Jump out of step S42 cycle.
[0033] Step S422: If the pointer variable The right child node of the object being pointed to If it exists, then further judge The extended bounding box of the node and the current node to be inserted When the covering relationship is established, ① first The pointer is updated to the right child node ,②Then according to the expression For alternating direction parameters Update, ③Finally continue the next loop process. If the pointer variable The right child node of the object being pointed to does not exist, then first, follow the current The variable indicates the direction of the coordinate cutting. The extended bounding box of the pointed node is halved and the right parameter value is stored in the dynamic array and Then, if the dynamic array and The extended bounding box described covers the current node to be inserted , then ① link the current node to be inserted to The right child position of the object pointed to, ② the dynamic array and The value is copied to the node's extended bounding box parameter and ③ Jump out of step S42 cycle.
[0034] Step S43: Release the dynamic array and storage space.
[0035] Step S5: Optimize the node coverage of the alternating direction digital tree. In the scope of , add a recursive function without a return type As its member function, the double-precision floating-point parameter 𝑒𝑝𝑠 is the tolerance correction parameter of the node extension bounding box.
[0036] In the alternating direction digital tree of the present invention, let the global root node pointer Calling functions directly , and the member variables of the alternating direction digital tree Assigning values to formal parameters , the node coverage can be optimized step by step from bottom to top. Function The definition is implemented in the order of step S51 to step S53.
[0037] Step S51: At the node In the scope of coordinate directions, combined with the generalized point coordinate array The upper and lower bounding parameters of the extended bounding box of the current node and To make corrections: , ( ).
[0038] Step S52: If the left child pointer of the current node Points to a non-null address value, so first let Referent execution The input tolerance parameter is still the parameter value of the function with the same name at the previous level. ; then extract Critical bounding box and lower bound parameters of members and , respectively, along the alternating direction digital tree defined The upper and lower bounding parameters of the extended bounding box of the current node in the coordinate direction and To make corrections: , ( ).
[0039] Step S53: If the right child pointer of the current node Points to a non-null address value, so first let Referent execution The input tolerance parameter is still the parameter value of the function with the same name at the previous level. ; then extract Critical bounding box and lower bound parameters of members and , respectively, along the alternating direction digital tree defined The upper and lower bounding parameters of the extended bounding box of the current node in the coordinate direction and To make corrections: , ( ).
[0040] Step S6: Retrieve the contributing cells that cover the known interpolation cell centroids.
[0041] Step S61: Globally reduce the geometric data of the spatial points to be retrieved. For implicit assembly of large-scale overlapping grids, a distributed memory management mode is needed to alleviate data storage pressure and improve the overall geometric analysis speed. Figure 4 The reduction of the interpolation points to the background grid processor group is shown, where the spatial points to be retrieved are distributed in processors (starting communication domain ), the background grid sub-blocks are distributed in processors (target communication domain ). The present invention is achieved by The set communication function obtains the union of the spatial points to be retrieved on the starting communication domain , and implement it on the target communication domain Information sharing is used to prepare for subsequent parallel retrieval.
[0042] Step S62: Non-recursive search of contribution units covering spatial points. On each processor, traverse the sequence of spatial points to be searched obtained by step S61. , check in turn on the current background grid sub-block The existence of the contribution unit of each element in the C++ standard template library is determined and located. ,Using node collectors in alternating direction digital tree structures Storage coverage The first address of the node where the critical bounding box of the point is located.
[0043] Step S7: Return the pairing relationship between the interpolation unit and the contribution unit. Return the pairing relationship between the spatial point and the contribution unit. Figure 5 The process of returning and extracting cross-processor pairing query results is shown. According to the direction of data flow, Figure 5 and Figure 4 The starting communication domain and the target communication domain in the are reversed. Figure 5 In the present invention, The set communication function obtains the union of the retrieved point and unit pairing information on the starting communication domain , and implement it on the target communication domain Information is shared, and each processor in the target communication domain extracts the necessary retrieval results based on the matching relationship between the spatial point and the current process.
[0044] Step S8: Release the storage space of the alternating direction digital tree member. In the present invention, the alternating direction digital tree node type is specified. The order of action of the destructor is as follows: ① Release the generalized coordinate array of the current node Storage space; ② Release the extended bounding box array of the current node and Storage space; ③Destruction of left child members Storage space; ④Destruction of right child members Therefore, in the current step, we only need to make the global root node pointer By calling the destructor once, the storage space of the alternating direction digital tree members can be recursively released.
[0045] Example 2 like Figures 1 to 6 As shown, as a further optimization of Example 1, based on Example 1, this embodiment also includes the following technical features: In order to enable ordinary technicians in this field to better understand the technical solution of the present invention, the following is a general simulation software used in the national numerical wind tunnel project. Take as an example, the technical solution of the present invention is further described. The software relies on the implicit assembly module of overlapping grids and has the function of unsteady flow field simulation based on moving grids. In the implicit assembly module of overlapping grids, the cross-processor pairing process between interpolation units and contribution units is completed based on the traditional alternating direction digital tree structure. Figure 6 The cross section of the overlapping burrowing model in the embodiment is shown, in which the two components are the wing and the missile body, and the body-fitting grids are generated around them to form an overlapping grid system, so that the overall grid unit scale reaches 420 million. On a domestic high-performance cluster, a 256-core CPU is used for parallel assembly. Comparing the wall time consumed by the pairing of the interpolation unit and the contribution unit before and after the implementation of the optimization method of the present invention (i.e., step S5), the total time cost is reduced by 57%. The embodiment shows that the application of the present invention can reduce the time cost of cross-processor interpolation of large overlapping grid flow fields and improve the computing performance of fluid simulation software.
[0046] As described above, the present invention can be preferably implemented.
[0047] All features disclosed in all embodiments in this specification, or steps in all methods or processes implicitly disclosed, except for mutually exclusive features and / or steps, can be combined and / or expanded or replaced in any manner.
[0048] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. According to the technical essence of the present invention, within the spirit and principles of the present invention, any simple modification, equivalent replacement and improvement made to the above embodiment still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for constructing a high-dimensional space alternating direction digital tree, characterized in that: The following steps are involved: S1, initialize the basic geometric parameters of the alternating direction digital tree; S2, calculate the critical bounding box parameters of the background grid cell; S3, calculate the extended bounding box parameters of the global root node; S4, insert and link nodes at all levels of the alternating direction digital tree; S5, optimize the node coverage of the alternating direction digital tree.
2. The method for constructing a high-dimensional space alternating direction digital tree according to claim 1, characterized in that: In step S1, the method for initializing the basic geometric parameters of the alternating direction digital tree includes one or more of the following: ① If the physical space dimension of the background grid to be retrieved is , then declare a signed integer variable For the internal data members of the alternating direction digital tree, The value is set to ;in, Indicates a general The dimension of space; ②Declare a signed integer variable is the total number of storage nodes, and Become an internal data member of the alternating direction digital tree; ③Declare a double-precision floating-point variable To store geometric tolerance parameters and use Become an internal data member of the alternating direction digital tree; ④Declare the global root node pointer ,make Becomes an internal data member of the alternating direction digital tree, and its initialization value is an empty address ; ⑤Use the vector container of C++ Standard Template Library Declare the node sequence of the alternating direction digital tree , and will Initialize to an empty vector; ⑥ Vector container using C++ Standard Template Library Declare the target collector required for the alternating direction digital tree retrieval process , and will Initialized to an empty vector.
3. The method for constructing a high-dimensional space alternating direction digital tree according to claim 2, characterized in that: Step S2 includes the following steps: S21, in the three-dimensional physical coordinate system During the traversal of the volume unit of the background grid, the number of the current volume unit is , the current volume unit contains The coordinates of the space grid points are ;in, , , Respectively represent the numbers 0, 1, -1 spatial grid points Axis coordinates, , , Respectively represent the numbers 0, 1, -1 spatial grid points Axis coordinates, , , Respectively represent the numbers 0, 1, -1 spatial grid points Axis coordinates; S22, along , , The directions of the three coordinate axes are calculated The minimum and maximum values of the coordinate components of the space grid points are recorded as , consisting of 6 spatial planes The critical bounding box cut out; at the same time, Treated as six-dimensional Generalized coordinates in space, It forms a one-to-one mapping relationship with the critical bounding box; among them, express Space grid points The minimum value of the axis coordinate component, express Space grid points The minimum value of the axis coordinate component, express Space grid points The minimum value of the axis coordinate component, express Space grid points The maximum value of the axis coordinate component, express Space grid points The maximum value of the axis coordinate component, express Space grid points The maximum value of the axis coordinate component; S23, take vector The subscript is Elements , copy the generalized coordinate components corresponding to the critical bounding box of the current volume unit to Member variables of Among them, Represents an array of generalized coordinates.
4. The method for constructing a high-dimensional space alternating direction digital tree according to claim 3, characterized in that: Step S3 includes the following steps: S31, outer loop traverses the node vector Each element in , the inner loop follows Count the minimum value of the generalized coordinate components of all critical bounding boxes in all directions With the maximum value , and then respectively and The value of is copied to Member variables of and Among them, represents an array containing the minimum values of all generalized coordinate components, represents an array containing the maximum values of all generalized coordinate components, Represents a node vector The element number in , , , represents the infimum of the extended bounding box, Represents the supremum of the extended bounding box; S32, outer loop traverses node vector Each element in , the inner loop follows The minimum scale component of all critical bounding boxes is calculated in each direction , and Multiply by the downscaling factor As a tree of alternating directions ; S33, modifying the extended bounding box parameters of the root node so that all generalized points on the current processor become inner points of the modified extended bounding box, by changing the extended bounding box parameters of the root node to , ;in, express The number in is Elements of express The number in is elements.
5. The method for constructing a high-dimensional space alternating direction digital tree according to claim 4, characterized in that: Step S4 includes the following steps: S41, setting temporary auxiliary variables for the node insertion process, specifically including: ①Declaration type is Pointer variable of type , and will Points to the global root node address ; ②Declare a signed integer variable , and set The initial value is 0; Indicates the cross direction number variable; ③ The length of the opening is Dynamic array of and ;in, represents the infimum temporary variable, represents the supremum temporary variable; ④Declare Boolean variables , and set The initial value is ; S42, use The loop inserts the current node into the alternating direction digital tree: equal When the condition is met, execute Loop, where the loop body is based on the pointer variable The existence of the left child node and the right child node of the object being pointed to are judged respectively; S43, release dynamic array and storage space.
6. The method for constructing a high-dimensional space alternating direction digital tree according to claim 5, characterized in that: Step S42 includes the following steps: S421, if the pointer variable The left child node of the object being pointed to If exists, then judge The extended bounding box of the node to be inserted Coverage relationship: When the coverage relationship is established, first The pointer is updated to the left child node , then according to the expression For alternating direction parameters Update and then continue to the next Loop; if the pointer variable The left child node of the object being pointed to does not exist, first follow the current The variable indicates the direction of the coordinate cutting. The extended bounding box of the pointed node is halved and the left parameter value is stored in the dynamic array and Then, if the dynamic array and The extended bounding box described covers the current node to be inserted , then: link the current node to be inserted to The left child position of the object pointed to, the dynamic array and The value is copied to the node's extended bounding box parameter and In step S42, the cycle; Step S422: If the pointer variable The right child node of the object being pointed to If exists, then judge The extended bounding box of the node to be inserted Coverage relationship: When the coverage relationship is established, first The pointer is updated to the right child node , then according to the expression For alternating direction parameters Update and then continue to the next Loop; if the pointer variable The right child node of the object being pointed to does not exist, first follow the current The variable indicates the direction of the coordinate cutting. The extended bounding box of the pointed node is halved and the right parameter value is stored in the dynamic array and Then, if the dynamic array and The extended bounding box described covers the current node to be inserted , then: link the current node to be inserted to The right child position of the pointed object, the dynamic array and The value is copied to the node's extended bounding box parameter and In step S42, the cycle.
7. The method for constructing a high-dimensional space alternating direction digital tree according to claim 6, characterized in that: In step S5, the node class of the digital tree in the alternating direction In the scope of , add a recursive function without a return type As A member function of is the tolerance correction parameter of the node extension bounding box, and the global root node pointer Direct call , and the member variables of the alternating direction digital tree Value Assignment .
8. The method for constructing a high-dimensional space alternating direction digital tree according to claim 7, characterized in that: Step S5 includes the following steps: S51, at the node In the scope of coordinate directions, combined with the generalized point coordinate array The upper and lower bounding parameters of the extended bounding box of the current node and To make corrections: , ;in, , express No. elements; S52, if the left child pointer of the current node If the address pointed to is a non-null address value, first let Referent execution , the input tolerance parameter is the same as the function of the previous level ; then extract Supremum parameter of the critical bounding box of the member With the infimum parameter , respectively, along the alternating direction digital tree defined The supremum parameters of the extended bounding box of the current node in the coordinate direction With the infimum parameter To make corrections: , ; in, express No. elements, express No. elements; Step S53, if the right child pointer of the current node Points to a non-null address value, so first let Referent execution , whose input tolerance parameter is still the same as the function of the previous level ; then extract Supremum parameter of the critical bounding box of the member With the infimum parameter , respectively, along the alternating direction digital tree defined The supremum parameter of the extended bounding box of the current node in the coordinate direction With the infimum parameter To make corrections: , ; in, express No. elements, express No. elements.
9. A search method, characterized in that: The method for constructing a high-dimensional space alternating direction digital tree according to any one of claims 1 to 8 further comprises the following steps: S6, retrieve contributing cells that cover the known interpolation cell centers; S7, returning the pairing relationship between the interpolation unit and the contribution unit; S8, release the storage space of the alternating direction digital tree members.
10. A search method according to claim 9, characterized in that: Step S6 includes the following steps: S61, globally reducing the geometric data of the spatial point to be retrieved; S62, non-recursive search of contribution units covering spatial points: on each processor, traverse the sequence of spatial points to be searched obtained by the reduction in step S61 , check in turn on the current background grid sub-block The existence and location of the contribution unit of each element in the C++ standard template library are combined with the vector container ,Using node collectors in alternating direction digital tree structures Storage coverage The first address of the node where the critical bounding box of the point is located.