Host unit searching method, device and system for searching adjacent units blocked by hole boundary

By constructing the vector before the hole boundary is blocked, traversing and judging the hole boundary surface unit, and determining the search path, the problem of path blockage in the adjacent unit search algorithm is solved, and stable search path breakthrough and adaptive improvement are achieved.

CN119272661AInactive Publication Date: 2025-01-07CHINA SHIPBUILDING ORLANDO WUXI SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411518115.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-01-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In computational fluid dynamics, the path of the adjacent cell search algorithm is easily blocked by the hole boundary, leading to search failure and affecting its applicability and stability.

Method used

By constructing the first vector from the center of the last judgment unit before being blocked by the hole boundary to the query node, traversing all surface units of the hole boundary, determining which hole boundary surface units the first vector passes through, and determining the next search direction to break through the hole boundary barrier based on these traversed hole boundary surface units.

Benefits of technology

It effectively solves the problem of adjacent cell search paths being blocked by hole boundaries, has good adaptability and stability, can handle any grid cell type and hole boundary form, and does not affect search efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119272661A_ABST
    Figure CN119272661A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computational fluid mechanics, and particularly discloses a host unit searching method, device and system for searching adjacent units blocked by hole boundaries, and the method comprises the steps: building a first vector from the center of the last judgment unit to a query node before the adjacent units are blocked by the hole boundaries when the adjacent units are blocked by the hole boundaries; determining a boundary domain of a hole boundary blocking the search of the current adjacent unit; cyclically traversing the surface units of the boundary domain; when it is determined that the first vector passes through the polygon where the surface unit of the boundary domain is located, determining a target search boundary surface unit according to the passed surface unit of the boundary domain; and determining a target judgment unit according to the grid unit to which the target search boundary surface unit belongs, and determining a search path according to the target judgment unit. According to the host unit search method for adjacent unit search blocked by the hole boundary, the problem that the adjacent unit search path is blocked by the hole boundary in an adjacent unit search algorithm can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computational fluid dynamics, and in particular to a host unit search method for searching adjacent units blocked by hole boundaries, a host unit search device for searching adjacent units blocked by hole boundaries, and a host unit search system. Background Art

[0002] In computational fluid dynamics (CFD), physical quantities (such as velocity, pressure, temperature, etc.) are often defined within grid nodes or grid cells. When a physical quantity at a certain location needs to be calculated, it is usually necessary to obtain values ​​from surrounding cells through interpolation. During the interpolation calculation process, it is necessary to determine the host cell of the interpolation point and the contributing cell of the interpolation calculation.

[0003] The neighboring cell search algorithm is a common method for host cell search in CFD. It is mainly used to quickly determine the grid cell where the particle or position is located, and to achieve smooth and efficient interpolation calculation and particle tracking in unstructured grids. The core idea is: starting from a known starting cell, according to the grid topology, gradually roam (or traverse) to the host cell containing the target point. The algorithm can quickly find the cell containing the target point without global search.

[0004] The neighboring cell search algorithm has the characteristics of high search efficiency, but it also has the disadvantage that the search path will fail once it is blocked by the hole boundary. With the increasing complexity of CFD calculation problems in engineering, it is common for the neighboring cell search path to be blocked by the hole boundary, and this obstruction problem will be encountered by any mesh cell type.

[0005] Therefore, how to solve the problem that the adjacent cell search path in the adjacent cell search algorithm is blocked by the hole boundary to enhance the applicability and search stability of the adjacent cell search algorithm in CFD has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0006] The present invention provides a host unit search method for searching adjacent units blocked by hole boundaries, a host unit search device for searching adjacent units blocked by hole boundaries, and a host unit search system, which solve the problem in the related art that the adjacent unit search path cannot be blocked by the hole boundary.

[0007] As a first aspect of the present invention, a method for searching a host unit blocked by a hole boundary for searching an adjacent unit is provided, which comprises:

[0008] When the adjacent unit search is blocked by the hole boundary, the first vector from the center of the last judgment unit before being blocked by the hole boundary to the query node is constructed;

[0009] Determine the boundary region of the hole boundary that blocks the current neighboring cell search;

[0010] Looping through the surface units of the boundary region to determine whether the first vector passes through the polygon where the surface unit of the boundary region is located;

[0011] When determining that the first vector passes through the polygon where the surface unit of the boundary domain is located, determining the target search boundary surface unit according to the surface unit of the boundary domain passed through;

[0012] A target judgment unit is determined according to the grid unit to which the target search boundary surface unit belongs, and a search path is determined according to the target judgment unit.

[0013] Further, looping through the surface units of the boundary region to determine whether the first vector passes through the polygon where the surface unit of the boundary region is located includes:

[0014] Loop through all the surface units in the boundary region;

[0015] In the loop traversal, for each face unit in the boundary region, it is determined whether the first vector has an intersection with the plane where the current face unit is located;

[0016] If the first vector and the plane where the current surface unit is located have an intersection point, whether the first vector passes through the polygon where the surface unit of the boundary region is located is determined based on whether the intersection point falls within the polygon where the current surface unit is located.

[0017] Further, if the first vector has an intersection with the plane where the current surface unit is located, judging whether the first vector passes through the polygon where the surface unit of the boundary region is located according to whether the intersection falls within the polygon where the current surface unit is located, including:

[0018] If the first vector and the plane where the current surface unit is located have an intersection point, determine the projection plane and project the intersection point and the current surface unit onto the projection plane to obtain the projection surface unit and the projection intersection point located on the projection plane;

[0019] Determining the positional relationship between the projection intersection point and the projection surface unit in the projection plane to determine whether the intersection point falls within the polygon where the current surface unit is located;

[0020] If the intersection point falls within the polygon where the current face unit is located, determining the polygon where the face unit where the first vector passes through the boundary region is located;

[0021] If the intersection point does not fall within the polygon where the current surface unit is located, it is determined that the first vector does not pass through the polygon where the surface unit of the boundary region is located.

[0022] Further, judging the positional relationship between the projection intersection point and the projection surface unit in the projection plane to determine whether the intersection point falls within the polygon where the current surface unit is located includes:

[0023] Determine the number of intersections between the projection intersection point and all edges of the polygon where the projection surface unit is located according to the ray method, so as to determine the positional relationship between the projection intersection point and the projection surface unit;

[0024] If the projection intersection point is located within the polygon where the projection surface unit is located, then determining that the intersection point falls within the polygon where the current surface unit is located;

[0025] If the projection intersection point is outside the polygon where the projection surface unit is located, it is determined that the intersection point falls outside the polygon where the current surface unit is located.

[0026] Further, judging the number of intersections between the projection intersection point and all edges of the polygon where the projection surface unit is located according to the ray method to determine the positional relationship between the projection intersection point and the projection surface unit includes:

[0027] Sending a ray from the projection intersection point, and determining the number of intersection points between the ray and all edges of the polygon where the projection surface unit is located;

[0028] If the number of intersection points is an odd number, it is determined that the projection intersection point is located within the polygon where the projection surface unit is located;

[0029] If the number of the intersection points is an even number, it is determined that the projection intersection point is located outside the polygon where the projection surface unit is located.

[0030] Further, emitting a ray from the projection intersection point and determining the number of intersections of the ray with all edges of the polygon where the projection surface unit is located includes:

[0031] Send out a ray in the X-axis direction from the projection intersection point;

[0032] Compare the Y coordinates of the projection intersection point with the Y coordinates of the two end points of each side of the polygon where the projection surface unit is located, and obtain a list of intersection points of the horizontal line in the X-axis direction where the projection intersection point is located and each side of the polygon where the projection surface unit is located;

[0033] The X coordinate of the projection intersection point is compared with the X coordinates of all the intersection points in the list of intersection points to determine the number of intersection points between the ray and all the edges of the polygon where the projection surface unit is located.

[0034] Furthermore, in the loop traversal, for each face unit in the boundary region, it is determined whether there is an intersection between the first vector and the plane where the current face unit is located, including:

[0035] Construct a second vector from the center of each face unit to the query node;

[0036] Respectively calculating the projection lengths of the first vector and the second vector on the surface normal vector of the plane where the current surface unit is located;

[0037] If the projection length of the second vector on the surface normal of the plane where the current surface unit is located is 0, or when the projection length of the second vector on the surface normal of the plane where the current surface unit is located is not 0 and the ratio of the projection lengths of the first vector and the second vector on the surface normal of the plane where the current surface unit is located is greater than 1, it is determined that the first vector has an intersection with the plane where the current surface unit is located, otherwise the first vector does not have an intersection with the plane where the current surface unit is located.

[0038] Further, when determining the polygon where the surface unit of the boundary region through which the first vector passes is located, determining the target search boundary surface unit according to the surface unit of the boundary region through which the first vector passes comprises:

[0039] When determining that the first vector passes through the polygon where the surface unit of the boundary domain is located, record the number information of the surface unit of the boundary domain passed through, wherein the number of the surface units of the boundary domain passed through includes at least two, and the number of the surface units of the boundary domain passed through includes at least the hole boundary surface units encountered when being blocked by the hole boundary;

[0040] If the number of the surface units of the boundary region that are passed through is two, the surface units of the boundary region remaining after excluding the hole boundary surface units encountered when being blocked by the hole boundary are determined as the target search boundary surface units;

[0041] If the number of the surface units of the boundary domain that are passed through is greater than two, the surface unit of the boundary domain that is closest to the query node among the surface units of the boundary domain remaining after excluding the hole boundary surface units encountered when blocked by the hole boundary is determined as the target search boundary surface unit.

[0042] As another aspect of the present invention, a host unit search device for neighboring unit search blocked by hole boundaries is provided, which is used to implement the host unit search method for neighboring unit search blocked by hole boundaries as described above, wherein the device comprises:

[0043] A construction module, used for constructing a first vector from the center of the last judgment unit before being blocked by the hole boundary to the query node when the adjacent unit search is blocked by the hole boundary;

[0044] A first determination module is used to determine a boundary region of a hole boundary that blocks the current adjacent unit search;

[0045] A loop traversal module, used for loop traversing the surface units of the boundary domain to determine whether the first vector passes through the polygon where the surface unit of the boundary domain is located;

[0046] A second determination module is used to determine the target search boundary surface unit according to the surface unit of the boundary domain passed through when determining that the first vector passes through the polygon where the surface unit of the boundary domain is located;

[0047] The third determination module is used to determine a target judgment unit according to the grid unit to which the target search boundary surface unit belongs, and determine a search path according to the target judgment unit.

[0048] As another aspect of the present invention, a host unit search system is provided, which includes: an adjacent unit search device and the aforementioned host unit search device for adjacent unit search blocked by hole boundaries, wherein the host unit search device for adjacent unit search blocked by hole boundaries is communicatively connected to the adjacent unit search device,

[0049] The neighbor unit search device is used to provide a neighbor unit search algorithm to implement host unit search;

[0050] The host unit search device for neighboring unit search blocked by hole boundaries is used to determine the search path of the judgment unit when the neighboring unit search is blocked by hole boundaries to assist the neighboring unit search device in completing the host unit search.

[0051] The host unit search method for adjacent unit search blocked by hole boundary provided by the present invention constructs the first vector with the center of the last judgment unit pointing to the query node when blocked by hole boundary, traverses all surface units of hole boundary, determines which hole boundary surface units the first vector passes through, and determines the next search direction to break through the hole boundary blockage according to the traversed hole boundary surface units, that is, determines the target judgment unit, thereby determining the search path blocked by hole boundary. The host unit search method for adjacent unit search blocked by hole boundary of the present invention can process computing grids of any grid unit type and hole boundary forms of any shape, can effectively solve the problem of adjacent unit search path being blocked by hole boundary, and has good adaptability and stability of search to break through hole boundary blockage. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present invention, but do not constitute a limitation of the present invention.

[0053] Figure 1 A flow chart of a method for searching a host unit blocked by a hole boundary for searching adjacent units provided by the present invention.

[0054] Figure 2 A schematic diagram of searching for adjacent cells by constructing vectors to break through hole boundary barriers provided by the present invention.

[0055] Figure 3 A flowchart of a specific method for cyclically traversing surface units in a boundary region provided by the present invention.

[0056] Figure 4 A flow chart of a method for determining whether a first vector intersects with a plane where a face unit is located, provided by the present invention.

[0057] Figure 5 A schematic diagram of determining whether a first vector intersects with a plane where a surface unit is located, provided by the present invention.

[0058] Figure 6 A flow chart of the method provided by the present invention for determining whether a first vector passes through a polygon where a face unit of a boundary region is located.

[0059] Figure 7 A schematic diagram of judging whether a test node in a plane falls within a polygon provided by the present invention.

[0060] Figure 8 A schematic diagram of judging whether a test node provided by the present invention falls within an irregular polygon.

[0061] Fig. 9 A flow chart of the method for determining target search boundary surface units provided by the present invention.

[0062] Fig.10 Schematic diagram of a spherical test grid for a test case provided by the present invention.

[0063] Fig.11 This is a schematic diagram of the test case search result output content provided by the present invention.

[0064] Fig.12 This is a schematic diagram of the visual display of the test points, starting unit, and host unit of the test case provided by the present invention.

[0065] Fig.13 A host unit search flow chart provided by the present invention.

[0066] Fig.14 A structural block diagram of a host unit search device provided by the present invention for searching adjacent units blocked by hole boundaries.

[0067] Fig.15 This is a structural block diagram of the host unit search system provided by the present invention. DETAILED DESCRIPTION

[0068] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0069] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present invention.

[0070] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so as to describe the embodiments of the present invention described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0071] Currently, the adjacent cell search algorithm fails once the search path is blocked by the hole boundary, which reduces the applicability and stability of the adjacent cell search algorithm in CFD.

[0072] Based on this, in this embodiment, a method for searching a host unit blocked by a hole boundary for searching an adjacent unit is provided. Figure 1 is a flow chart of a method for searching a host unit blocked by a hole boundary for searching an adjacent unit according to an embodiment of the present invention. Figure 1 As shown, including:

[0073] S100, when the adjacent unit search is blocked by a hole boundary, construct a first vector from the center of the last judgment unit before being blocked by the hole boundary to the query node;

[0074] In the embodiment of the present invention, when the adjacent unit search is blocked by the hole boundary, the first vector with the center of the last judgment unit pointing to the query node is constructed by connecting the query node and the center of the last judgment unit before being blocked.

[0075] by Figure 2 For example, in Figure 2In the unstructured grid in , it is necessary to determine the host cell of the query node P. The starting cell of the adjacent cell search is A. When the adjacent cell search is performed to cell B, the adjacent cell search path is blocked by the hole boundary. The conventional adjacent cell search method will fail to search in this case. The present invention first constructs the vector whose center points to the query node P when the blockage occurs, that is, Figure 2 The first vector BP in .

[0076] S200, determining a boundary region of a hole boundary that blocks the current adjacent unit search;

[0077] In the embodiment of the present invention, the boundary zone ID of the hole boundary blocking the current adjacent unit search is identified, and the boundary zone ID blocking the search is recorded. It should be noted that all grid boundary faces have boundary zone IDs for self-identification.

[0078] S300, looping through the surface units of the boundary region to determine whether the first vector passes through the polygon where the surface unit of the boundary region is located;

[0079] Specifically, a loop is traversed for the face units contained in the boundary domain determined in step S200 to determine whether there is an intersection between the first vector and the plane where the face units in the boundary domain are located. If there is an intersection, it is further determined whether the first vector passes through the polygon where the current face unit is located. If there is no intersection, it is impossible for the first vector to pass through the polygon where the current face unit is located.

[0080] It should be understood here that if the first vector does not pass through the polygon where the face unit of the boundary region is located, then the loop traversal process of the face units included in the boundary region is returned to continue the loop traversal.

[0081] S400, when it is determined that the first vector passes through the polygon where the surface unit of the boundary domain is located, determining the target search boundary surface unit according to the surface unit of the boundary domain passed through;

[0082] When determining the polygon where the face unit of the boundary domain passed by the first vector is located, the face unit currently passed through is recorded and the traversal is continued in a loop until the traversal is completed. Finally, the target search boundary face unit can be determined based on the face unit of the boundary domain passed by the first vector.

[0083] S500: determining a target judgment unit according to the grid unit to which the target search boundary surface unit belongs, and determining a search path according to the target judgment unit.

[0084] It should be understood that after the target search boundary surface unit is determined, the grid unit to which the target search boundary surface unit belongs can be determined as the target judgment unit, that is, the target on the next search path when blocked by the hole boundary is the target judgment unit, thereby determining the search path blocked by the hole boundary based on the target judgment unit.

[0085] Therefore, the host unit search method for adjacent unit search blocked by hole boundary provided by the present invention constructs the first vector with the center of the last judgment unit pointing to the query node when blocked by hole boundary, traverses all surface units of hole boundary, determines which hole boundary surface units the first vector passes through, and determines the next search direction to break through the hole boundary blockage according to the traversed hole boundary surface units, that is, determines the target judgment unit, thereby determining the search path blocked by hole boundary. The host unit search method for adjacent unit search blocked by hole boundary of the present invention can process computing grids of any grid unit type and hole boundary forms of any shape, can effectively solve the problem of adjacent unit search path being blocked by hole boundary, and has good adaptability and stability of search to break through hole boundary blockage.

[0086] It should be noted that in the process of determining the boundary domain of the hole boundary that blocks the current adjacent unit search, the boundary domain zoneID of the hole boundary that blocks the search path is found. All boundary surfaces of the CFD calculation grid have their own boundary domain zoneID. The role of the boundary domain zoneID is to facilitate the call of the surface units on each boundary surface. Figure 2 For example, the search path is blocked by an elliptical object surface boundary, and the boundary domain zoneID of the object surface boundary is recorded to determine the boundary domain of the hole boundary that blocks the current adjacent unit search.

[0087] In the embodiment of the present invention, the surface units of the boundary region are traversed in a loop to determine whether the first vector passes through the polygon where the surface unit of the boundary region is located, such as Figure 3 As shown, including:

[0088] S310, looping through all the surface units in the boundary region;

[0089] In the embodiment of the present invention, Figure 2 As shown, all the surface units of the elliptical boundary domain are traversed in a loop. Figure 2 The two-dimensional shape is shown. Figure 2 All the surface units in represent multiple line segments constituting the elliptical boundary domain; it should be understood here that if it is a three-dimensional shape, all the surface units of the boundary domain represent multiple planes constituting the boundary domain.

[0090] S320, determining, for each face unit in the boundary region in the loop traversal, whether the first vector has an intersection with the plane where the current face unit is located;

[0091] In the embodiment of the present invention, when all the surface units in the boundary region are traversed in a loop, it is necessary to determine for each surface unit in the boundary region whether the first vector has an intersection with the plane where the surface unit is located.

[0092] Specifically, in the loop traversal, for each face unit in the boundary region, it is determined whether the first vector has an intersection with the plane where the current face unit is located, such as Figure 4 As shown, including:

[0093] S321, constructing a second vector from the center of each face unit to the query node;

[0094] like Figure 5 As shown in the figure, the adjacent unit search starts from unit S. When searching for unit C, the search path is blocked by the rectangular object surface boundary. The first vector CP of the unit center of the last judgment unit C before the search path is blocked is constructed to point to the query node P; all the surface units on the hole boundary are traversed in a loop. When traversing to the surface unit F, the surface normal vector of the surface unit is N f , a second vector FP connecting the center of the surface unit F and the query node P.

[0095] S322, respectively calculating the projection lengths of the first vector and the second vector on the surface normal vector of the plane where the current surface unit is located;

[0096] In the embodiment of the present invention, the first vector CP is calculated in the current surface normal vector N f The projection length on the surface, and the second vector FP on the surface normal N f The positional relationship between the first vector and the plane where the current surface unit is located can be determined by the projection lengths of the first vector and the second vector on the surface normal vector of the plane where the current surface unit is located.

[0097] Specifically, the first vector CP and the second vector FP are in the plane normal vector N f The calculation formula of the upper projection length ratio β is as follows:

[0098]

[0099] S323. If the projection length of the second vector on the surface normal of the plane where the current surface unit is located is 0, or when the projection length of the second vector on the surface normal of the plane where the current surface unit is located is not 0 and the ratio of the projection lengths of the first vector and the second vector on the surface normal of the plane where the current surface unit is located is greater than 1, it is determined that the first vector has an intersection with the plane where the current surface unit is located, otherwise the first vector does not have an intersection with the plane where the current surface unit is located.

[0100] In the embodiment of the present invention, when When , it means that point P falls within the plane where the surface unit is located, then the first vector CP intersects with the plane where the surface unit is located, and the intersection point is point P. When β>1.0, the first vector CP intersects with the plane where the surface unit is located, and the coordinate calculation formula of the intersection point is: in represents the intersection coordinates, Represents the coordinates of the query node P.

[0101] S330: If the first vector and the plane where the current surface unit is located have an intersection, determine whether the first vector passes through the polygon where the surface unit of the boundary region is located based on whether the intersection falls within the polygon where the current surface unit is located.

[0102] It should be understood that when it is determined that the first vector and the plane where the current face unit is located have an intersection, it is necessary to further determine whether the intersection point falls within the polygon where the current face unit is located. If not, return to continue looping through the face units included in the hole boundary; if so, record the number of the following unit, and then return to continue looping through other face units on the hole boundary.

[0103] In the embodiment of the present invention, if the first vector and the plane where the current surface unit is located have an intersection, whether the first vector passes through the polygon where the surface unit of the boundary region is located is determined based on whether the intersection falls within the polygon where the current surface unit is located. Figure 6 As shown, including:

[0104] S331: If the first vector and the plane where the current surface unit is located have an intersection, determine a projection plane and project the intersection and the current surface unit onto the projection plane to obtain a projection surface unit and a projection intersection located on the projection plane;

[0105] In an embodiment of the present invention, in the case where the first vector and the plane where the current face unit is located have an intersection, when judging the positional relationship between the intersection and the current face unit, since it is more complicated to judge whether the intersection falls within the face unit in space, it can be converted into a point in the plane and a polygon positional relationship judgment, and the target plane of the conversion is determined according to the direction of the face normal vector of the face unit. The specific implementation method is to determine the main direction of the face normal vector according to the X, Y and Z components of the face normal vector, and the plane where the main direction is located is the target plane of the conversion, and the intersection points and polygons in the space are converted into two-dimensional nodes and polygons in the target plane to facilitate subsequent judgment.

[0106] S332, determining the positional relationship between the projection intersection point and the projection surface unit in the projection plane to determine whether the intersection point falls within the polygon where the current surface unit is located;

[0107] It should be understood that after the above intersection points and surface units are projected, the positional relationship between the projected intersection points and the projection surface units can be determined in the projection plane, based on which the positional relationship between the intersection points and the surface units in the result space can be determined.

[0108] Specifically, judging the positional relationship between the projection intersection point and the projection surface unit in the projection plane to determine whether the intersection point falls within the polygon where the current surface unit is located includes:

[0109] (1) determining the number of intersections between the projection intersection point and all edges of the polygon where the projection surface unit is located according to the ray method, so as to determine the positional relationship between the projection intersection point and the projection surface unit;

[0110] It should be noted that the ray method is used to determine the positional relationship between a point and a polygon in a plane. Specifically, a ray is emitted from the intersection point to determine the number of intersections between the ray and all the edges of the polygon. If the number of intersections is odd, it means that the intersection point is inside the polygon of the face unit. If the number of intersections is even, it means that the intersection point is outside the polygon of the face unit.

[0111] In an embodiment of the present invention, judging the number of intersections between the projection intersection point and all edges of the polygon where the projection surface unit is located according to the ray method to determine the positional relationship between the projection intersection point and the projection surface unit includes:

[0112] (11) emitting a ray from the projection intersection point, and determining the number of intersection points of the ray with all edges of the polygon where the projection surface unit is located;

[0113] In the embodiment of the present invention, Figure 7 As shown in the example, Figure 7 The middle polygon is a severely concave polygon with 14 sides, and the red point P is the test point. Figure 7As shown, there are 8 edges intersecting with the horizontal line in the X-axis direction where the test point P is located, and 6 edges not intersecting. If the number of points on both sides of the test point P is an odd number, the test point is inside the polygon, otherwise it is outside the polygon. In this example, there are 5 intersection points on the left side of the test point and 3 intersection points on the right side, which are all odd numbers, so the point is inside the polygon.

[0114] It should be understood that the judgment method of the present invention is also applicable to some polygons with strange shapes, such as Figure 8 The polygon intersects itself. The decagon has intersecting lines. The overlapping parts of the polygons cancel each other out to form a hole. When the point is in the hole, such as Figure 8 As shown in , there are an even number of intersection points (2 and 2) on both sides, and it can still be accurately judged to be outside the polygon. It can be seen that this method has a strong adaptability to the shape of the polygon when judging the position relationship between the point and the polygon. It is not only applicable to regular grid surface units, but also to some distorted or even overlapping grid surface units.

[0115] In the embodiment of the present invention, emitting a ray from the projection intersection point and determining the number of intersections of the ray with all edges of the polygon where the projection surface unit is located includes:

[0116] (111) emitting a ray in the X-axis direction from the projection intersection;

[0117] (112) comparing the Y coordinate of the projection intersection point with the Y coordinates of the two end points of each side of the polygon where the projection surface unit is located, so as to determine which sides of the polygon where the projection surface unit is located have intersections with the horizontal line in the X-axis direction where the projection intersection point is located, and then calculating to obtain a list of intersections between the horizontal line in the X-axis direction where the projection intersection point is located and each side of the polygon where the projection surface unit is located;

[0118] (113) Compare the X coordinate of the projection intersection point with the X coordinates of all intersection points in the intersection point list to determine the number of intersection points between the ray and all edges of the polygon where the projection surface unit is located.

[0119] It should be understood that when determining the number of intersections between the ray emitted from the projection intersection point and the polygon, the following method can be used: first, the Y coordinate of the test point is compared with the Y coordinates of the two endpoints of each edge of the polygon, and a list of intersections between the horizontal line in the X-axis direction where the test point is located and the polygon edge is obtained. Then, by comparing the X coordinate of the test point with the X coordinate of the intersection in the intersection list, the parity of the number of intersections between the ray and the polygon is determined, and then whether the point is inside the polygon is determined.

[0120] The following is the code for implementing the position relationship between points and polygon units in C language:

[0121]

[0122] (12) If the number of intersection points is an odd number, determining that the projection intersection point is located within the polygon where the projection surface unit is located;

[0123] (13) If the number of the intersection points is an even number, it is determined that the projection intersection point is located outside the polygon where the projection surface unit is located.

[0124] It should be understood that based on the above-determined number of intersections, if the number of intersections is odd, the projection intersection is determined to be within the polygon where the projection surface unit is located; conversely, if the number of intersections is even, the projection intersection is determined to be outside the polygon where the projection surface unit is located.

[0125] (2) if the projection intersection point is located within the polygon where the projection surface unit is located, then determining that the intersection point falls within the polygon where the current surface unit is located;

[0126] (3) If the projection intersection point is outside the polygon where the projection surface unit is located, it is determined that the intersection point falls outside the polygon where the current surface unit is located.

[0127] It should be understood that after the positional relationship between the above-mentioned projection intersection and the projection surface unit is determined, the positional relationship between the intersection and the polygon where the current surface unit is located can be determined based on the positional relationship between the projection intersection and the projection surface unit, that is, when the projection intersection is located within the polygon where the projection surface unit is located, the intersection falls within the polygon where the current surface unit is located; conversely, when the projection intersection is located outside the polygon where the projection surface unit is located, it is determined that the intersection falls outside the polygon where the current surface unit is located.

[0128] S333: If the intersection point falls within the polygon where the current surface unit is located, determine the polygon where the surface unit where the first vector passes through the boundary region is located;

[0129] S334: If the intersection point does not fall within the polygon where the current surface unit is located, determine the polygon where the surface unit where the first vector does not pass through the boundary region is located.

[0130] It should be understood that based on the positional relationship between the intersection point and the current face unit, the positional relationship between the first vector and the face unit of the boundary domain can be further determined, that is, if the intersection point falls within the polygon where the current face unit is located, then the polygon where the face unit of the boundary domain through which the first vector passes is determined; conversely, if the intersection point does not fall within the polygon where the current face unit is located, then the polygon where the face unit of the boundary domain that the first vector does not pass is determined.

[0131] In the embodiment of the present invention, when determining the polygon where the surface unit of the boundary region through which the first vector passes is located, the target search boundary surface unit is determined according to the surface unit of the boundary region through which the first vector passes, such as Fig. 9 As shown, including:

[0132] S410, when it is determined that the first vector passes through the polygon where the surface unit of the boundary domain is located, record the number information of the surface unit of the boundary domain passed through, wherein the number of the surface units of the boundary domain passed through includes at least two, and the number of the surface units of the boundary domain passed through includes at least the hole boundary surface units encountered when being blocked by the hole boundary;

[0133] In the embodiment of the present invention, after the loop traversal of the surface units in the above-mentioned boundary region is completed, the numbers of the surface units in two boundary regions are usually recorded, one of which is the boundary surface unit when it is blocked, and the other indicates the boundary surface unit to be searched in the next step (the grid unit to which the boundary surface unit belongs is the next judgment unit). Figure 2 For example, when the loop traversal is completed, it is found that the hole boundary surface units passed by the vector BP are the boundary surface units of unit B and the boundary surface units of unit Q, among which the boundary surface unit of unit B is the hole boundary unit encountered when the search is blocked. Therefore, the boundary surface unit of unit Q is the solution found by the present invention to solve the blocking problem. The belonging unit Q of the boundary surface unit is the next judgment unit for the adjacent unit search, thereby successfully breaking through the obstruction of the hole boundary to the search path.

[0134] S420: If the number of the surface units of the boundary region that are passed through is two, the surface units of the boundary region remaining after excluding the hole boundary surface units encountered when being blocked by the hole boundary are determined as target search boundary surface units;

[0135] S430: If the number of the surface units of the boundary domain that are passed through is greater than two, then the surface unit of the boundary domain that is closest to the query node among the surface units of the boundary domain remaining after excluding the hole boundary surface units encountered when blocked by the hole boundary is determined as the target search boundary surface unit.

[0136] In the embodiment of the present invention, for some cases where the hole boundary is particularly complex, the numbers of more than two boundary surface units will be recorded. After excluding the boundary surface units when blocked, the hole boundary surface unit closest to the query node is selected to determine the search direction. In specific implementation, the hole boundary surface unit closest to the query point is determined by analyzing the size of the projection length ratio of the two vectors on the surface normal vector. The larger the projection length ratio, the closer the hole boundary surface unit is to the query node.

[0137] The specific implementation process of the method for searching a host unit blocked by a hole boundary for searching adjacent units of the present invention is described in detail below in conjunction with specific embodiments.

[0138] like Fig.10As shown in the figure, it is an unstructured grid. The outer boundary and inner boundary of the calculation grid are both spherical surfaces. The two spheres are concentric with each other. The coordinates of the center of the sphere are (0, 0, 0). The diameter of the large sphere is 4m, and the diameter of the small sphere is 2m. A tetrahedral unstructured grid is generated between the large sphere and the small sphere. The small sphere mesh is a hole boundary mesh, which is used to separate the search path.

[0139] The test purpose of the embodiment of the present invention is to verify whether the adjacent unit search path is blocked by the hole boundary, and whether the adjacent unit search algorithm based on the ray method, combined with the present invention, can break through the hole boundary barrier and successfully find the host unit of the test point. Therefore, the test conditions are designed as follows:

[0140] The test node coordinates are (1.0, 0.5, -0.5), and the search starting unit is defined on the opposite side of the test point hole boundary. According to the generated calculation grid information, the unit number of the starting unit is 201, and the starting unit center coordinates are (-1.02666, 0.367157, 0.100226).

[0141] The adjacent unit search algorithm based on the ray method is used, combined with the host unit search method for adjacent units blocked by hole boundaries of the present invention, and the program outputs the result after programming. Fig.11 As shown in the figure, the program finds that the host unit number of the test node is 91, the center coordinates of the host unit are (0.972262, 0.087409, -0.37325), and the query takes 0.0037s. The test node, the center of the starting unit, and the center of the host unit are displayed on the grid, as shown in the figure. Fig.12 As shown. Fig.12 It can be seen that the test node and the starting unit of the search are deliberately separated on both sides of the hole boundary formed by the ball, and the starting unit is near the hole boundary. The conventional adjacent unit search path will definitely be blocked by the hole boundary, but the current program uses the host unit search method for adjacent unit search blocked by the hole boundary of the present invention, and successfully finds the host unit of the test node. From the distance between the center coordinates of the found host unit and the test point, the two are very close. Considering the large scale of the test grid, the host unit of the test node is correct according to the distance between the test node and the center of the host unit.

[0142] In summary, the above case tests show that when the search path of adjacent units is blocked by the hole boundary, the present invention can effectively break through the hole boundary barrier and successfully find the query node host unit, and the solution of the present invention is very efficient and has strong practical value.

[0143] When the adjacent unit search path is blocked by the hole boundary, the host unit search method for adjacent unit search blocked by the hole boundary of the present invention breaks through the hole boundary barrier and finds the next judgment unit. The specific implementation flow chart is as follows: Fig.13As shown:

[0144] SA, finds the host cells of all query nodes based on the neighboring cell search algorithm;

[0145] SB, currently searching for host units for query node P;

[0146] SC, determines whether the search path is blocked by the hole boundary. If so, execute SD, otherwise execute SL;

[0147] SD, the vector from the center of the last judgment unit to the query node before the construction of the block;

[0148] SE, records the hole boundary zoneID that blocks the search path;

[0149] SF, loop through all the face units whose zoneID is the SE record value, and execute SG on the face units during the traversal process;

[0150] SG, determine whether the vector constructed by SD intersects with the plane where the face unit is located. If so, execute SH, if not, return to execute SF;

[0151] SH, determine whether the intersection point in SG falls within the polygon of the face unit. If so, execute SI. If not, return to execute SF.

[0152] SI, record the number of the hole boundary surface unit where the vector passes through in SH, and continue to execute SJ;

[0153] SJ, determine whether all surface units in SF have been traversed. If so, execute SK, if not, return to execute SF;

[0154] SK, determines the next judgment unit according to the face unit number recorded in SI, and then continues to execute SL;

[0155] SL, perform adjacent cell search and continue to execute SM;

[0156] SM, determines whether the host unit is found, if so, executes SN, if not, executes SB;

[0157] SN, finds the host unit of query node P and ends the search for the query point.

[0158] Therefore, in the process of searching for host cells of all query nodes in the computational grid using the adjacent cell search algorithm, if the search path is blocked by a hole boundary, the host cell search method for adjacent cell search blocked by a hole boundary of the present invention is adopted, by constructing a vector pointing to the query node from the center of the last judgment cell before the blockage, looping through all surface cells on the hole boundary, finding the hole boundary surface cell that the construction vector passes through, finding the next judgment cell based on the found hole boundary surface cell, continuing to search for the host cell of the query point based on the adjacent cell search, and repeating the above operation until the host cells of all query points are found.

[0159] In summary, the present invention provides a host unit search method for adjacent unit search blocked by hole boundaries. By constructing a vector pointing from the center of the unit to the query point, traversing the hole boundary surface units, and finding the hole boundary surface units that the vector passes through, the invention can effectively solve the problem that the adjacent unit search path is blocked by the hole boundary; based on the ray method, by counting the odd and even numbers of intersections between the rays emitted by the test point and the polygon edge, it is determined whether the point falls within the polygon. This method has a strong adaptability to the shape of the polygon and is applicable not only to conventional grid surface units, but also to some twisted or even staggered and overlapping grid surface units. In addition, the present invention's host unit search method for adjacent unit search blocked by hole boundaries can also stably break through the hole boundary blockage without excessively sacrificing search efficiency, and successfully find the host unit.

[0160] As another embodiment of the present invention, a host unit search device 100 for searching for neighboring units blocked by hole boundaries is provided, which is used to implement the host unit search method for searching for neighboring units blocked by hole boundaries as described above, wherein: Fig.14 As shown, including:

[0161] A construction module 110, for constructing a first vector from the center of the last judgment unit before being blocked by the hole boundary to the query node when the adjacent unit search is blocked by the hole boundary;

[0162] A first determination module 120, configured to determine a boundary region of a hole boundary that blocks the current adjacent cell search;

[0163] A loop traversal module 130, configured to loop traverse the surface units of the boundary region to determine whether the first vector passes through the polygon where the surface unit of the boundary region is located;

[0164] A second determination module 140 is configured to determine a target search boundary surface unit according to the surface unit of the boundary region passed through when determining that the first vector passes through a polygon where the surface unit of the boundary region is located;

[0165] The third determination module 150 is used to determine a target judgment unit according to the grid unit to which the target search boundary surface unit belongs, and determine a search path according to the target judgment unit.

[0166] The host unit search device provided by the present invention is used for searching adjacent units blocked by hole boundaries. By constructing a first vector with the center of the last judgment unit pointing to the query node when blocked by a hole boundary, all surface units of the hole boundary are traversed, and which hole boundary surface units the first vector passes through are determined, and the next search direction for breaking through the hole boundary blockage is determined based on the traversed hole boundary surface units, that is, the target judgment unit is determined, thereby determining the search path blocked by the hole boundary. The host unit search device for searching adjacent units blocked by hole boundaries of the present invention can process computing grids of any grid unit type and hole boundary forms of any shape, can effectively solve the problem of the adjacent unit search path being blocked by the hole boundary, and has good adaptability and stability in breaking through the hole boundary blockage search.

[0167] The specific working process of the host unit search device for neighboring unit search blocked by hole boundaries of the present invention can refer to the description of the host unit search method for neighboring unit search blocked by hole boundaries in the previous text, which will not be repeated here.

[0168] As another embodiment of the present invention, a host unit search system 10 is provided, wherein Fig.15 As shown, it includes: a neighboring unit search device 200 and the host unit search device 100 for neighboring unit search blocked by hole boundaries as described above, wherein the host unit search device 100 for neighboring unit search blocked by hole boundaries is communicatively connected with the neighboring unit search device 200,

[0169] The neighbor unit search device 200 is used to provide a neighbor unit search algorithm to implement host unit search;

[0170] The host unit search device 100 for neighboring unit search blocked by hole boundaries is used to determine the search path of the judgment unit when the neighboring unit search is blocked by hole boundaries, so as to assist the neighboring unit search device to complete the host unit search.

[0171] In an embodiment of the present invention, when searching for a host unit, the host unit is searched through an adjacent unit search algorithm. When the adjacent unit search is blocked by the host unit during the search process, the host unit search device 100 used for the adjacent unit search blocked by the hole boundary determines the search path of the judgment unit to assist the adjacent unit search device in completing the search of the host unit.

[0172] In summary, the host unit search system provided by the present invention adopts the host unit search device mentioned above for searching adjacent units blocked by hole boundaries, can process computing grids of any grid unit type and hole boundaries of any shape, can effectively solve the problem of adjacent unit search paths being blocked by hole boundaries, and has good adaptability and search stability that breaks through hole boundary obstructions.

[0173] In the embodiment of the present invention, the neighboring unit search algorithm may specifically include a barycentric coordinate method or a ray method, etc.

[0174] The working process of the host unit search system of the present invention can refer to the description of the host unit search method for searching adjacent units blocked by hole boundaries in the above text, which will not be repeated here.

[0175] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.

Claims

1. A method for searching adjacent cells for host cells blocked by hole boundaries, characterized in that: include: When the adjacent unit search is blocked by the hole boundary, the first vector from the center of the last judgment unit before being blocked by the hole boundary to the query node is constructed; Determine the boundary region of the hole boundary that blocks the current neighboring cell search; Looping through the surface units of the boundary region to determine whether the first vector passes through the polygon where the surface unit of the boundary region is located; When determining that the first vector passes through the polygon where the surface unit of the boundary domain is located, determining the target search boundary surface unit according to the surface unit of the boundary domain passed through; A target judgment unit is determined according to the grid unit to which the target search boundary surface unit belongs, and a search path is determined according to the target judgment unit.

2. The method for searching host cells blocked by hole boundaries for searching adjacent cells according to claim 1, characterized in that: The surface units of the boundary region are traversed in a loop to determine whether the first vector passes through the polygon where the surface units of the boundary region are located, including: Loop through all the surface units in the boundary region; In the loop traversal, for each face unit in the boundary region, it is determined whether the first vector has an intersection with the plane where the current face unit is located; If the first vector and the plane where the current surface unit is located have an intersection point, whether the first vector passes through the polygon where the surface unit of the boundary region is located is determined based on whether the intersection point falls within the polygon where the current surface unit is located.

3. The method for searching host cells blocked by hole boundaries for searching adjacent cells according to claim 2, characterized in that: If the first vector and the plane where the current surface unit is located have an intersection point, then judging whether the first vector passes through the polygon where the surface unit of the boundary region is located according to whether the intersection point falls within the polygon where the current surface unit is located, including: If the first vector and the plane where the current surface unit is located have an intersection point, determine the projection plane and project the intersection point and the current surface unit onto the projection plane to obtain the projection surface unit and the projection intersection point located on the projection plane; Determining the positional relationship between the projection intersection point and the projection surface unit in the projection plane to determine whether the intersection point falls within the polygon where the current surface unit is located; If the intersection point falls within the polygon where the current face unit is located, determining the polygon where the face unit where the first vector passes through the boundary region is located; If the intersection point does not fall within the polygon where the current surface unit is located, it is determined that the first vector does not pass through the polygon where the surface unit of the boundary region is located.

4. The method for searching host cells blocked by hole boundaries for searching adjacent cells according to claim 3, characterized in that: Determining the positional relationship between the projection intersection point and the projection surface unit in the projection plane to determine whether the intersection point falls within the polygon where the current surface unit is located includes: Determine the number of intersections between the projection intersection point and all edges of the polygon where the projection surface unit is located according to the ray method, so as to determine the positional relationship between the projection intersection point and the projection surface unit; If the projection intersection point is located within the polygon where the projection surface unit is located, then determining that the intersection point falls within the polygon where the current surface unit is located; If the projection intersection point is outside the polygon where the projection surface unit is located, it is determined that the intersection point falls outside the polygon where the current surface unit is located.

5. The method for searching host cells blocked by hole boundaries for searching adjacent cells according to claim 4, characterized in that: Determining the number of intersections between the projection intersection point and all edges of the polygon where the projection surface unit is located according to the ray method to determine the positional relationship between the projection intersection point and the projection surface unit includes: Sending a ray from the projection intersection point, and determining the number of intersection points between the ray and all edges of the polygon where the projection surface unit is located; If the number of intersection points is an odd number, it is determined that the projection intersection point is located within the polygon where the projection surface unit is located; If the number of the intersection points is an even number, it is determined that the projection intersection point is located outside the polygon where the projection surface unit is located.

6. The method for searching host cells blocked by hole boundaries for searching adjacent cells according to claim 5, characterized in that: Sending a ray from the projection intersection point and determining the number of intersections between the ray and all edges of the polygon where the projection surface unit is located includes: Send out a ray in the X-axis direction from the projection intersection point; Compare the Y coordinates of the projection intersection point with the Y coordinates of the two end points of each side of the polygon where the projection surface unit is located, and obtain a list of intersection points of the horizontal line in the X-axis direction where the projection intersection point is located and each side of the polygon where the projection surface unit is located; The X coordinate of the projection intersection point is compared with the X coordinates of all the intersection points in the list of intersection points to determine the number of intersection points between the ray and all the edges of the polygon where the projection surface unit is located.

7. The method for searching host cells blocked by hole boundaries for searching adjacent cells according to claim 2, characterized in that: In the loop traversal, for each face unit in the boundary region, determining whether there is an intersection between the first vector and the plane where the current face unit is located includes: Construct a second vector from the center of each face unit to the query node; Respectively calculating the projection lengths of the first vector and the second vector on the surface normal vector of the plane where the current surface unit is located; If the projection length of the second vector on the surface normal of the plane where the current surface unit is located is 0, or when the projection length of the second vector on the surface normal of the plane where the current surface unit is located is not 0 and the ratio of the projection lengths of the first vector and the second vector on the surface normal of the plane where the current surface unit is located is greater than 1, it is determined that the first vector has an intersection with the plane where the current surface unit is located, otherwise the first vector does not have an intersection with the plane where the current surface unit is located.

8. The method for searching for host cells blocked by hole boundaries for searching for adjacent cells according to any one of claims 1 to 7, characterized in that: When determining the polygon where the surface unit of the boundary region passes through by the first vector, determining the target search boundary surface unit according to the surface unit of the boundary region passed through includes: When determining that the first vector passes through the polygon where the surface unit of the boundary domain is located, record the number information of the surface unit of the boundary domain passed through, wherein the number of the surface units of the boundary domain passed through includes at least two, and the number of the surface units of the boundary domain passed through includes at least the hole boundary surface units encountered when being blocked by the hole boundary; If the number of the surface units of the boundary region that are passed through is two, the surface units of the boundary region remaining after excluding the hole boundary surface units encountered when being blocked by the hole boundary are determined as the target search boundary surface units; If the number of the surface units of the boundary domain that are passed through is greater than two, the surface unit of the boundary domain that is closest to the query node among the surface units of the boundary domain remaining after excluding the hole boundary surface units encountered when blocked by the hole boundary is determined as the target search boundary surface unit.

9. A device for searching a host unit blocked by a hole boundary for searching a neighboring unit, used to implement the method for searching a host unit blocked by a hole boundary for searching a neighboring unit as claimed in any one of claims 1 to 8, characterized in that: include: A construction module, used for constructing a first vector from the center of the last judgment unit before being blocked by the hole boundary to the query node when the adjacent unit search is blocked by the hole boundary; A first determination module is used to determine a boundary region of a hole boundary that blocks the current adjacent unit search; A loop traversal module, used for loop traversing the surface units of the boundary domain to determine whether the first vector passes through the polygon where the surface unit of the boundary domain is located; A second determination module is used to determine the target search boundary surface unit according to the surface unit of the boundary domain passed through when determining that the first vector passes through the polygon where the surface unit of the boundary domain is located; The third determination module is used to determine a target judgment unit according to the grid unit to which the target search boundary surface unit belongs, and determine a search path according to the target judgment unit.

10. A host unit search system, characterized in that: include: The adjacent unit search device and the host unit search device for adjacent unit search blocked by hole boundaries as claimed in claim 9, wherein the host unit search device for adjacent unit search blocked by hole boundaries is communicatively connected to the adjacent unit search device, The neighbor unit search device is used to provide a neighbor unit search algorithm to implement host unit search; The host unit search device for neighboring unit search blocked by hole boundaries is used to determine the search path of the judgment unit when the neighboring unit search is blocked by hole boundaries to assist the neighboring unit search device in completing the host unit search.