A nested grid hole unit determination method, device, terminal and medium
By constructing the K-dimensional tree and diffusion method of the mesh, the hole units in the nested mesh are quickly judged, which solves the problem of low efficiency of traditional methods and realizes efficient multi-nested mesh hole units determination.
Patent Information
- Application Number
- CN202510039750.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-10
AI Technical Summary
The traditional hole unit determination method is very inefficient and cannot effectively handle the hole unit determination task in multiple nested grids.
By constructing the K-dimensional tree of each grid, the relationship between the target boundaries and units is determined, and the K-dimensional tree and diffusion method are used to quickly determine the hole units, avoiding the complex process of unit decomposition and intersecting judgment in traditional methods.
It improves the efficiency of hole unit determination, can effectively handle hole unit determination tasks in multiple nested grids, and reduces computational complexity and time consumption.
Smart Images

Figure CN119478008B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of fluid mechanics technology, and in particular to a nested grid hole unit determination method, device, terminal and medium. Background Art
[0002] In computational fluid dynamics, the nested grid (also known as overlapping grid) method has been widely used in scenes with large relative displacement of objects or optimization problems that require changing the position and direction of objects. Grid is a tool used to discretize the computational domain in computational fluid dynamics. Nested grid is a special type of grid that allows overlapping, nesting or overlapping between different grid blocks, thereby reducing the difficulty of grid generation. Cell is the basic component of the grid, representing a discrete point or area in the computational domain. The nested grid method requires marking different grid cells as computational cells, interpolation cells and hole cells. This process is called the nested grid cutting process (also known as the assembly process). Multi-nested grids refer to three or more grids participating in the cutting process, so multi-nested grids are more complicated than the cutting process involving only two grids. The computational cell is a cell that normally participates in the flow field calculation; the interpolation cell is a cell whose variable value is obtained by interpolating the variable values of the computational cells in other grids; the hole cell is a cell that does not participate in the flow field calculation. The determination of the hole cell is a very important part of the nested grid cutting process.
[0003] The traditional hole cell determination method is to determine whether each cell of the background grid can find a cell containing its cell center in the component grid. If not, the cell is determined to be a hole cell. The process of determining whether a cell contains a point requires decomposing the cell into multiple tetrahedrons, and then determining whether each tetrahedron contains the point. Therefore, the efficiency of the traditional hole cell determination method is very low.
[0004] Therefore, the prior art has defects and needs to be improved and developed. Summary of the invention
[0005] The present application provides a nested grid hole unit determination method, device, terminal and medium to solve the technical problem of low efficiency of the hole unit determination method in the related art.
[0006] To achieve the above objectives, this application adopts the following technical solutions:
[0007] A nested grid hole unit determination method, wherein the method comprises:
[0008] Determine a target boundary that is not a preset type boundary in each grid of the target computation domain, and construct a K-dimensional tree for each grid based on the target boundary;
[0009] Determine a number of first units in the current grid that do not intersect with all the target boundaries, select any one of the first units as a first target unit, and determine a hole unit determination result of the first target unit based on each of the K-dimensional trees;
[0010] Based on the hole unit determination result of the first target unit, determining the hole unit determination results of all first units in the current grid by a diffusion method;
[0011] A number of second units in the current grid intersecting with all the target boundaries are determined, and hole unit determination results of all the second units are determined based on the respective K-dimensional trees.
[0012] In one embodiment of the present application, determining a target boundary that is not a preset type boundary in each grid of the target computing domain, and constructing a K-dimensional tree of each grid based on the target boundary includes:
[0013] Determine a target boundary that is not a preset type boundary in each grid of the target computational domain;
[0014] Constructing a K-dimensional tree for each grid, allocating all faces of the target boundary corresponding to each grid to different leaf nodes of the corresponding K-dimensional tree, each leaf node including a number of faces;
[0015] A leaf node bounding box corresponding to each leaf node is calculated, and a surface bounding box corresponding to each surface is calculated, wherein both the leaf node bounding box and the surface bounding box are axis-aligned bounding boxes.
[0016] In one embodiment of the present application, determining the hole unit determination result of the first target unit based on each of the K-dimensional trees includes:
[0017] Determine a first target point on the target boundary of all grids that is closest to the center of the first target unit, and construct a first target line segment between the center of the first target unit of the current grid and the center of the unit where the first target point is located;
[0018] Preliminarily screening the first target leaf nodes whose leaf node bounding boxes intersect with the first target line segment in the K-dimensional tree of all grids, and secondarily screening the first target surface bounding boxes intersecting with the first target line segment from each of the first target leaf nodes;
[0019] Taking the surface corresponding to the first target surface bounding box obtained by screening all grids as the first target surface, determining the number of all first target surfaces intersecting with the first target line segment, and obtaining the total number of intersections between the first target line segment and the target boundary;
[0020] The hole unit determination result of the first target unit in the current grid is determined according to the parity of the total number of intersections between the first target line segment and the target boundary.
[0021] In one embodiment of the present application, determining the number of all first target surfaces intersecting with the first target line segment includes:
[0022] Decomposing each of the first target surfaces into a plurality of triangles respectively, and determining a first intersection determination result between each of the triangles of each of the first target surfaces and the first target line segment;
[0023] If the first intersection determination result is that at least one triangle in the first target surface intersects with the first target line segment, the first target surface intersects with the first target line segment to obtain the number of all first target surfaces intersecting with the first target line segment.
[0024] In one embodiment of the present application, determining the hole unit determination result of the first target unit in the current grid according to the parity of the total number of intersections between the first target line segment and the target boundary includes:
[0025] If the total number of intersections between the first target line segment and the target boundary is an odd number, determining that the first target unit in the current grid is a hole unit;
[0026] If the total number of intersections between the first target line segment and the target boundary is an even number, it is determined that the first target unit in the current grid is not a hole unit.
[0027] In one embodiment of the present application, based on the hole unit determination result of the first target unit, determining the hole unit determination results of all first units in the current grid by a diffusion method includes:
[0028] Determine all first target neighboring cells that do not intersect with the target boundary among neighboring cells of the first target cell of the current grid, and set the hole cell determination results of all the first target neighboring cells to be the same as the hole cell determination result of the first target cell;
[0029] Determine a second target adjacent unit that does not intersect the target boundary from adjacent units of the first target adjacent unit, and set the hole unit determination results of all the second target adjacent units to the same hole unit determination result as the first target unit, until the hole unit determination results of all the first units in the current grid that do not intersect the target boundary and are located in the same independent non-intersecting area are set, wherein the independent non-intersecting area is an area separated solely by the second unit;
[0030] If there are still first cells in the current grid that have no hole cell determination result set and do not intersect with all the target boundaries, any first cell is selected from all the remaining first cells as the next first target cell for hole cell determination, so as to obtain a hole cell determination result of the next first target cell;
[0031] Based on the hole unit determination result of the next first target unit, the hole unit determination results of all first units in the independent non-intersecting area where the next first target unit is located are determined by a diffusion method until the hole unit determination results of all first units in the current grid are set.
[0032] In one embodiment of the present application, determining a number of second units in the current grid that intersect with all the target boundaries, and determining hole unit determination results of all the second units based on each of the K-dimensional trees includes:
[0033] For each second unit, determine the second target point on the target boundary of all grids that is closest to the center of the second unit, and construct a second target line segment between the center of the second unit of the current grid and the center of the unit where the second target point is located;
[0034] Preliminarily screening the second target leaf nodes whose leaf node bounding boxes intersect with the second target line segment in the K-dimensional tree of all grids, and secondarily screening the second target surface bounding boxes intersecting with the second target line segment from each of the second target leaf nodes;
[0035] Taking the surface corresponding to the second target surface bounding box obtained by screening all the grids as the second target surface, determining the number of all second target surfaces intersecting with the second target line segment, and obtaining the total number of intersections between the second target line segment and the target boundary;
[0036] The hole unit determination result of all the second units in the current grid is determined according to the parity of the total number of intersections between the second target line segment and the target boundary.
[0037] The present application also provides a nested grid hole unit determination device, wherein the device comprises:
[0038] A construction module, used for determining a target boundary that is not a preset type boundary in each grid of the target computing domain, and constructing a K-dimensional tree of each grid based on the target boundary;
[0039] A first determination module is used to determine a number of first cells in the current grid that do not intersect with all the target boundaries, select any one of the first cells as a first target cell, and determine a hole cell determination result of the first target cell based on each of the K-dimensional trees;
[0040] A diffusion module, configured to determine hole unit determination results of all first units in the current grid by a diffusion method based on the hole unit determination result of the first target unit;
[0041] The second determination module is used to determine a number of second units in the current grid that intersect with all the target boundaries, and determine hole unit determination results of all the second units based on each of the K-dimensional trees.
[0042] The present application also provides a terminal, which includes: a memory, a processor, and a nested grid hole unit determination program stored in the memory and executable on the processor, wherein the nested grid hole unit determination program implements the steps of the nested grid hole unit determination method as described above when executed by the processor.
[0043] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program can be executed to implement the steps of the nested grid hole unit determination method as described above.
[0044] Beneficial effects of the present invention: The method of the embodiment of the present invention determines the target boundary that is not a preset type boundary in each grid of the target calculation domain, and constructs a K-dimensional tree for each grid based on the target boundary; determines a number of first units in the current grid that do not intersect with all the target boundaries, selects any one of the first units as the first target unit, and determines the hole unit determination result of the first target unit based on each of the K-dimensional trees; based on the hole unit determination result of the first target unit, determines the hole unit determination results of all the first units in the current grid by a diffusion method; determines a number of second units in the current grid that intersect with all the target boundaries, and determines the hole unit determination results of all the second units based on each of the K-dimensional trees. The present application determines the hole unit determination result of the first target unit based on the K-dimensional tree, and then determines the hole unit determination results of the remaining first units in the grid where the first target unit is located by a diffusion method, without the need to determine whether a unit contains a point, thereby improving the determination efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flow chart of a preferred embodiment of the nested grid hole unit determination method of the present invention.
[0046] Figure 2 It is a cross-sectional schematic diagram of an embodiment of the present invention in which the non-Chimaera boundaries of the current grid and other grids intersect.
[0047] Figure 3 It is a cross-sectional schematic diagram of another embodiment of the present invention in which the non-Chimaera boundaries of the current grid and other grids intersect.
[0048] Figure 4 It is a schematic cross-sectional view of the intersection of the first target line segment and the surface bounding box in the present invention.
[0049] Figure 5 It is a functional principle block diagram of a preferred embodiment of the nested grid hole unit determination device in the present invention.
[0050] Figure 6 It is a functional principle block diagram of a preferred embodiment of the terminal in the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0052] The nested grid hole unit determination method, device, terminal and medium of the embodiment of the present application are described below with reference to the accompanying drawings. In view of the problem that the hole unit determination method in the related art mentioned in the above background technology is very inefficient, the present application provides a nested grid hole unit determination method, in which the target boundary that is not a preset type boundary in each grid of the target calculation domain is determined, and a K-dimensional tree of each grid is constructed based on the target boundary; several first units in the current grid that do not intersect with all the target boundaries are determined, and any one of the first units is selected as the first target unit, and the hole unit determination result of the first target unit is determined based on each of the K-dimensional trees; based on the hole unit determination result of the first target unit, the hole unit determination results of all the first units in the current grid are determined by a diffusion method; several second units in the current grid that intersect with all the target boundaries are determined, and the hole unit determination results of all the second units are determined based on each of the K-dimensional trees. The present application determines the hole unit determination result of the first target unit based on the K-dimensional tree, and then determines the hole unit determination results of the remaining first units in the grid where the first target unit is located by a diffusion method, without the process of determining whether a unit contains a point, thereby improving the determination efficiency.
[0053] See also Figure 1 The nested grid hole unit determination method described in the embodiment of the present invention comprises the following steps:
[0054] Step S100: determining a target boundary that is not a preset type boundary in each grid of the target computation domain, and constructing a K-dimensional tree of each grid based on the target boundary.
[0055] Specifically, the preset type of boundary is a chimera boundary. A chimera boundary is a boundary type specially set by engineers for a certain boundary in a nested mesh example. It is a boundary that has no actual physical meaning and can be partially or completely removed during the nested mesh cutting process. Boundaries that are not chimera boundaries are referred to as non-chimera boundaries, that is, the target boundary of this application is a non-chimera boundary, and the calculation domain refers to all meshes.
[0056] In the embodiment of the present application, the step S100 specifically includes:
[0057] Step S110, determining a target boundary in each grid of the target calculation domain that is not a preset type boundary;
[0058] Step S120, constructing a K-dimensional tree for each grid, and assigning all faces of the target boundary corresponding to each grid to different leaf nodes of the corresponding K-dimensional tree, each of the leaf nodes including a number of faces;
[0059] Step S130: Calculate the leaf node bounding box corresponding to each leaf node, and calculate the surface bounding box corresponding to each surface, wherein both the leaf node bounding box and the surface bounding box are axis-aligned bounding boxes.
[0060] Specifically, the axis-aligned bounding box of each face of the non-Chimaera boundary of each grid is determined, and then the axis-aligned bounding box (AABB) of each leaf node of the K-dimensional tree is determined, that is, each node of the face is traversed, the minimum and maximum values of the coordinate components of all nodes are set to the minimum and maximum values of the corresponding components of the face bounding box, and then the minimum and maximum values of the corresponding components of the leaf node bounding box are set to the minimum and maximum values of the corresponding components of the bounding boxes of all faces in the leaf node.
[0061] This application constructs a K-dimensional tree of the grid and then makes a decision based on each K-dimensional tree.
[0062] like Figure 1 As shown, the nested grid hole unit determination method also includes the following steps:
[0063] Step S200, determining a number of first units in the current grid that do not intersect with all the target boundaries, selecting any one of the first units as a first target unit, and determining a hole unit determination result of the first target unit based on each of the K-dimensional trees.
[0064] Specifically, in step S200, "all the target boundaries" refer to the target boundaries of all grids in the target calculation domain. Since the cells in the current grid will not intersect with the target boundary of the current grid, the present application actually refers to determining a number of first cells in the current grid that do not intersect with the target boundaries of other grids except the current grid, such as Figure 2 and Figure 3 shown.
[0065] In the embodiment of the present application, determining the hole unit determination result of the first target unit based on each of the K-dimensional trees includes:
[0066] Determine a first target point on the target boundary of all grids that is closest to the center of the first target unit, and construct a first target line segment between the center of the first target unit of the current grid and the center of the unit where the first target point is located;
[0067] Preliminarily screening the first target leaf nodes whose leaf node bounding boxes intersect with the first target line segment in the K-dimensional tree of all grids, and secondarily screening the first target surface bounding boxes intersecting with the first target line segment from each of the first target leaf nodes;
[0068] Taking the surface corresponding to the first target surface bounding box obtained by screening all grids as the first target surface, determining the number of all first target surfaces intersecting with the first target line segment, and obtaining the total number of intersections between the first target line segment and the target boundary;
[0069] The hole unit determination result of the first target unit in the current grid is determined according to the parity of the total number of intersections between the first target line segment and the target boundary.
[0070] Specifically, determine the nearest point from the center of any first target unit that does not intersect with the non-Chimaera boundary to the non-Chimaera boundary, that is, the first target point, construct the first target line segment between the center of the first target unit and the center of the unit where the first target point is located, use the axis-aligned bounding box and line segment intersection determination algorithm to quickly filter out the leaf nodes whose axis-aligned bounding boxes of K-dimensional tree leaves do not intersect with the first target line segment, obtain the first target leaf node, and then use the axis-aligned bounding box and line segment intersection determination algorithm to quickly filter out the first target surface whose surface bounding box intersects with the first target line segment. Traverse different grids to obtain the first target surface of all grids.
[0071] Before determining whether a cell is a hole cell, it is necessary to determine the number of intersections between the first target line segment and the surface of the target boundary, that is, whether a line segment in space intersects with the surface. In conventional algorithms, if you want to calculate this problem, you need to decompose each surface of the target boundary into triangles, and then determine the intersection of each triangle with the line segment in space. Since there are many surfaces on the target boundary, the calculation is complicated, resulting in a huge amount of calculation and low calculation efficiency.
[0072] Since the present application distributes all faces of the target boundary to different leaf nodes of the K-dimensional tree, and calculates the leaf node bounding box and the face bounding box, and since both the leaf node bounding box and the face bounding box are axis-aligned bounding boxes, the present application first performs a preliminary screening in the leaf node bounding box. The leaf node bounding box that does not intersect with the first target line segment must not have a face that intersects with the first target line segment. Therefore, the preliminary screening obtains the first target leaf node whose leaf node bounding box intersects with the first target line segment. Then, the face bounding box in the first target leaf node is screened. The face bounding box that does not intersect with the first target line segment must not have a face that intersects with the first target line segment. Therefore, the secondary screening obtains the face bounding box that intersects with the first target line segment. Therefore, the present application transforms the problem into determining whether a line segment in space intersects with the axis-aligned bounding box. This judgment is very simple and greatly improves the calculation efficiency. In addition, the present application first preliminarily judges the leaf node bounding box, further reducing the calculation steps, and then judges the face bounding box one by one, further improving the calculation efficiency.
[0073] The present application determines the hole unit determination result of the first target unit by the parity of the total number of first intersection points. Specifically, in the most basic scenario, if a unit is a hole unit, the line connecting the center of the unit where the nearest point of the unit to the target boundary is located will intersect with the target boundary, and the number of intersection points is 1, which is an odd number; if a unit is not a hole unit, the line connecting the center of the unit where the nearest point of the unit to the target boundary is located does not intersect with the target boundary, and the number of intersection points is 0, which is an even number. If the scenario is more complex, the number of intersection points is not simply 0 and 1, but may be other odd and even numbers.
[0074] In the embodiment of the present application, the hole unit determination result of the first target unit is determined by the parity of the total number of the first intersection points, and the determination efficiency is higher.
[0075] In one embodiment of the present application, determining the number of all first target surfaces intersecting with the first target line segment includes:
[0076] Decomposing each of the first target surfaces into a plurality of triangles respectively, and determining a first intersection determination result between each of the triangles of each of the first target surfaces and the first target line segment;
[0077] If the first intersection determination result is that at least one triangle in the first target surface intersects with the first target line segment, the first target surface intersects with the first target line segment to obtain the number of all first target surfaces intersecting with the first target line segment.
[0078] Specifically, after the present application selects the face bounding box that intersects with the first target line segment, the face inside the face bounding box does not necessarily intersect with the first target line segment. It is possible that the first target line segment passes through the face bounding box without intersecting with the face inside the face bounding box. Figure 4 At this time, the first target surface selected is decomposed into multiple triangles, and the spatial line segment and triangle intersection determination algorithm is used to determine whether each triangle intersects with the first target line segment. As long as there is a triangle intersecting with the first target line segment, the first target surface is determined to intersect with the first target line segment, and the number of intersections between the first target line segment and the target boundary (non-Chimera boundary) is increased by 1.
[0079] The embodiment of the present application only determines whether the screened first target surface intersects with the first target line segment, which greatly reduces the amount of calculation and improves the calculation efficiency.
[0080] In an embodiment of the present application, determining a hole unit determination result of the first target unit in the current grid according to the parity of the total number of intersections between the first target line segment and the target boundary includes:
[0081] If the total number of intersections between the first target line segment and the target boundary is an odd number, determining that the first target unit in the current grid is a hole unit;
[0082] If the total number of intersections between the first target line segment and the target boundary is an even number, it is determined that the first target unit in the current grid is not a hole unit.
[0083] The embodiment of the present application determines the hole unit determination result of the first target unit by the parity of the total number of first intersection points, thereby improving the determination efficiency.
[0084] like Figure 1 As shown, the nested grid hole unit determination method also includes the following steps:
[0085] Step S300: Based on the hole unit determination result of the first target unit, determine the hole unit determination results of all first units in the current grid by a diffusion method.
[0086] In the embodiment of the present application, the step S300 specifically includes:
[0087] Step S310, determining all first target neighboring cells that do not intersect with the target boundary among neighboring cells of the first target cell of the current grid, and setting the hole cell determination results of all the first target neighboring cells to be the same as the hole cell determination result of the first target cell;
[0088] Step S320: determining a second target adjacent unit that does not intersect the target boundary from adjacent units of the first target adjacent unit, and setting the hole unit determination results of all the second target adjacent units to the same hole unit determination result as the first target unit, until the hole unit determination results of all the first units in the current grid that do not intersect the target boundary and are located in the same independent non-intersecting area are set, wherein the independent non-intersecting area is an area separated by the second unit alone;
[0089] Step S330: If there are still first cells in the current grid that have no hole cell determination result set and do not intersect with all the target boundaries, any first cell is selected from all the remaining first cells as the next first target cell for hole cell determination, so as to obtain a hole cell determination result of the next first target cell;
[0090] Step S340: Based on the hole unit determination result of the next first target unit, determine the hole unit determination results of all first units in the independent non-intersecting area where the next first target unit is located by a diffusion method until the hole unit determination results of all first units in the current grid are set.
[0091] Specifically, since the diffusion method is to diffuse adjacently from the first target unit, the first unit separated by the second unit (i.e., the unit intersecting with the target boundary) cannot be diffused to. One or more independent non-intersecting areas will appear in a grid, which is related to the number of grids that overlap with the grid, the shape of the target boundary, and other factors. Figure 2 and Figure 3 As shown, Figure 2 The current grid is divided into two independent non-intersecting regions by the non-Chimera boundary of another grid. Figure 3 The current grid is divided into three independent non-intersecting regions by the non-Chimera boundaries of the other two grids.
[0092] For each independent non-intersecting region, it is necessary to select a first target unit for hole unit determination, and then diffuse based on the first target unit to obtain all hole unit determination results of the first unit in the independent non-intersecting region where the first target unit is located.
[0093] The embodiment of the present application uses a diffusion method to perform hole unit determination on all first units in the current independent non-intersecting area, which has high determination efficiency and is applicable to multiple nested grids.
[0094] like Figure 1 As shown, the nested grid hole unit determination method also includes the following steps:
[0095] Step S400: determine a number of second units in the current grid that intersect with all the target boundaries, and determine hole unit determination results of all the second units based on each of the K-dimensional trees.
[0096] In the embodiment of the present application, the step S400 specifically includes:
[0097] Step S410: for each second unit, determine the second target point on the target boundary of all grids that is closest to the center of the second unit, and construct a second target line segment between the center of the second unit of the current grid and the center of the unit where the second target point is located;
[0098] Step S420, preliminarily screening the second target leaf nodes whose leaf node bounding boxes intersect with the second target line segment in the K-dimensional tree of all grids, and secondarily screening the second target surface bounding boxes intersecting with the second target line segment from each of the second target leaf nodes;
[0099] Step S430: taking the surface corresponding to the second target surface bounding box obtained by screening all the grids as the second target surface, determining the number of all second target surfaces intersecting with the second target line segment, and obtaining the total number of intersections between the second target line segment and the target boundary;
[0100] Step S440: Determine the hole unit determination result of all the second units in the current grid according to the parity of the total number of intersections between the second target line segment and the target boundary.
[0101] Specifically, for the second cells in the current grid that intersect with all the target boundaries, each second cell needs to be individually determined whether it is a hole cell, and the determination method for each second cell is consistent with the determination method for the first target cell. For each grid, the determination is performed according to steps S100-S400.
[0102] The efficient multi-nested grid hole unit determination method provided by the present invention can quickly determine the hole units of the multi-nested grids, solving the problem that the existing nested grid hole unit determination is limited to non-multi-nested grids involving only one background grid and one component grid, and solving the problem of low efficiency of the existing hole unit determination technology.
[0103] In one embodiment, if Figure 5 As shown, based on the above nested grid hole unit determination method, the present invention also provides a nested grid hole unit determination device, including:
[0104] A construction module 100 is used to determine a target boundary that is not a preset type boundary in each grid of the target computing domain, and to construct a K-dimensional tree for each grid based on the target boundary;
[0105] A first determination module 200 is used to determine a number of first cells in the current grid that do not intersect with all the target boundaries, select any one of the first cells as a first target cell, and determine a hole cell determination result of the first target cell based on each of the K-dimensional trees;
[0106] A diffusion module 300 is used to determine the hole unit determination results of all first units in the current grid by a diffusion method based on the hole unit determination result of the first target unit;
[0107] The second determination module 400 is used to determine a number of second cells in the current grid that intersect with all the target boundaries, and determine hole cell determination results of all the second cells based on each of the K-dimensional trees.
[0108] It should be noted that the above explanation of the embodiment of the nested grid hole unit determination method is also applicable to the nested grid hole unit determination device of this embodiment, and will not be repeated here.
[0109] The present invention discloses a nested grid hole unit determination device, which determines the target boundary that is not a preset type boundary in each grid of the target calculation domain, and constructs a K-dimensional tree for each grid based on the target boundary; determines a number of first units in the current grid that do not intersect with all the target boundaries, selects any one of the first units as the first target unit, and determines the hole unit determination result of the first target unit based on each of the K-dimensional trees; based on the hole unit determination result of the first target unit, determines the hole unit determination results of all the first units in the current grid by a diffusion method; determines a number of second units in the current grid that intersect with all the target boundaries, and determines the hole unit determination results of all the second units based on each of the K-dimensional trees. The present application determines the hole unit determination result of the first target unit based on the K-dimensional tree, and then determines the hole unit determination results of the remaining first units in the grid where the first target unit is located by a diffusion method, without the need to determine whether a unit contains a point, thereby improving the determination efficiency.
[0110] Figure 6 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. The terminal may include:
[0111] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .
[0112] When the processor 502 executes the program, the nested grid hole unit determination method provided in the above embodiment is implemented.
[0113] Furthermore, the terminal further includes:
[0114] The communication interface 503 is used for communication between the memory 501 and the processor 502 .
[0115] The memory 501 is used to store computer programs that can be executed on the processor 502 .
[0116] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0117] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0118] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.
[0119] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0120] This embodiment also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above nested grid hole unit determination method is implemented.
[0121] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0122] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0123] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes additional implementations, in which the order shown or discussed may not be followed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0124] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can read instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary and then storing it in a computer memory.
[0125] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0126] A person skilled in the art may understand that all or part of the steps in the above-mentioned embodiment method may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0127] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0128] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A nested grid hole unit determination method, characterized in that: The method comprises: Determine a target boundary that is not a preset type boundary in each grid of the target computation domain, and construct a K-dimensional tree for each grid based on the target boundary; Determine a number of first units in the current grid that do not intersect with all the target boundaries, select any one of the first units as a first target unit, and determine a hole unit determination result of the first target unit based on each of the K-dimensional trees; Based on the hole unit determination result of the first target unit, determining the hole unit determination results of all first units in the current grid by a diffusion method; Determine a number of second units in the current grid that intersect with all the target boundaries, and determine hole unit determination results of all the second units based on each of the K-dimensional trees; Determining a target boundary that is not a preset type boundary in each grid of the target computational domain, and constructing a K-dimensional tree of each grid based on the target boundary, including: Determine a target boundary that is not a preset type boundary in each grid of the target computational domain; Constructing a K-dimensional tree for each grid, allocating all faces of the target boundary corresponding to each grid to different leaf nodes of the corresponding K-dimensional tree, each leaf node including a number of faces; Calculate a leaf node bounding box corresponding to each leaf node, and calculate a face bounding box corresponding to each face, wherein both the leaf node bounding box and the face bounding box are axis-aligned bounding boxes; Determining a hole unit determination result of the first target unit based on each of the K-dimensional trees includes: Determine a first target point on the target boundary of all grids that is closest to the center of the first target unit, and construct a first target line segment between the center of the first target unit of the current grid and the center of the unit where the first target point is located; Preliminarily screening the first target leaf nodes whose leaf node bounding boxes intersect with the first target line segment in the K-dimensional tree of all grids, and secondarily screening the first target surface bounding boxes intersecting with the first target line segment from each of the first target leaf nodes; Taking the surface corresponding to the first target surface bounding box obtained by screening all grids as the first target surface, determining the number of all first target surfaces intersecting with the first target line segment, and obtaining the total number of intersections between the first target line segment and the target boundary; The hole unit determination result of the first target unit in the current grid is determined according to the parity of the total number of intersections between the first target line segment and the target boundary.
2. The nested grid hole unit determination method according to claim 1, characterized in that: Determining the number of all first target surfaces intersecting the first target line segment includes: Decomposing each of the first target surfaces into a plurality of triangles respectively, and determining a first intersection determination result between each of the triangles of each of the first target surfaces and the first target line segment; If the first intersection determination result is that at least one triangle in the first target surface intersects with the first target line segment, the first target surface intersects with the first target line segment to obtain the number of all first target surfaces intersecting with the first target line segment.
3. The nested grid hole unit determination method according to claim 1, characterized in that: Determining a hole unit determination result of the first target unit in the current grid according to the parity of the total number of intersections between the first target line segment and the target boundary includes: If the total number of intersections between the first target line segment and the target boundary is an odd number, determining that the first target unit in the current grid is a hole unit; If the total number of intersections between the first target line segment and the target boundary is an even number, it is determined that the first target unit in the current grid is not a hole unit.
4. The nested grid hole unit determination method according to claim 1, characterized in that: Based on the hole unit determination result of the first target unit, determining the hole unit determination results of all first units in the current grid by a diffusion method includes: Determine all first target neighboring cells that do not intersect with the target boundary among neighboring cells of the first target cell of the current grid, and set the hole cell determination results of all the first target neighboring cells to be the same as the hole cell determination result of the first target cell; Determine a second target adjacent unit that does not intersect the target boundary from adjacent units of the first target adjacent unit, and set the hole unit determination results of all the second target adjacent units to the same hole unit determination result as the first target unit, until the hole unit determination results of all the first units in the current grid that do not intersect the target boundary and are located in the same independent non-intersecting area are set, wherein the independent non-intersecting area is an area separated solely by the second unit; If there are still first cells in the current grid that have no hole cell determination result set and do not intersect with all the target boundaries, any first cell is selected from all the remaining first cells as the next first target cell for hole cell determination, so as to obtain a hole cell determination result of the next first target cell; Based on the hole unit determination result of the next first target unit, the hole unit determination results of all first units in the independent non-intersecting area where the next first target unit is located are determined by a diffusion method until the hole unit determination results of all first units in the current grid are set.
5. The nested grid hole unit determination method according to claim 1, characterized in that: Determining a number of second units in the current grid that intersect with all the target boundaries, and determining hole unit determination results of all the second units based on each of the K-dimensional trees, including: For each second unit, determine the second target point on the target boundary of all grids that is closest to the center of the second unit, and construct a second target line segment between the center of the second unit of the current grid and the center of the unit where the second target point is located; Preliminarily screening the second target leaf nodes whose leaf node bounding boxes intersect with the second target line segment in the K-dimensional tree of all grids, and secondarily screening the second target surface bounding boxes intersecting with the second target line segment from each of the second target leaf nodes; Taking the surface corresponding to the second target surface bounding box obtained by screening all the grids as the second target surface, determining the number of all second target surfaces intersecting with the second target line segment, and obtaining the total number of intersections between the second target line segment and the target boundary; The hole unit determination result of all the second units in the current grid is determined according to the parity of the total number of intersections between the second target line segment and the target boundary.
6. A nested grid hole unit determination device, characterized in that: The device comprises: A construction module, used for determining a target boundary that is not a preset type boundary in each grid of the target computing domain, and constructing a K-dimensional tree of each grid based on the target boundary; A first determination module is used to determine a number of first cells in the current grid that do not intersect with all the target boundaries, select any one of the first cells as a first target cell, and determine a hole cell determination result of the first target cell based on each of the K-dimensional trees; A diffusion module, configured to determine hole unit determination results of all first units in the current grid by a diffusion method based on the hole unit determination result of the first target unit; A second determination module is used to determine a number of second units in the current grid that intersect with all the target boundaries, and determine hole unit determination results of all the second units based on each of the K-dimensional trees; Determining a target boundary that is not a preset type boundary in each grid of the target computational domain, and constructing a K-dimensional tree of each grid based on the target boundary, including: Determine a target boundary that is not a preset type boundary in each grid of the target computational domain; Constructing a K-dimensional tree for each grid, allocating all faces of the target boundary corresponding to each grid to different leaf nodes of the corresponding K-dimensional tree, each leaf node including a number of faces; Calculate a leaf node bounding box corresponding to each leaf node, and calculate a face bounding box corresponding to each face, wherein both the leaf node bounding box and the face bounding box are axis-aligned bounding boxes; Determining a hole unit determination result of the first target unit based on each of the K-dimensional trees includes: Determine a first target point on the target boundary of all grids that is closest to the center of the first target unit, and construct a first target line segment between the center of the first target unit of the current grid and the center of the unit where the first target point is located; Preliminarily screening the first target leaf nodes whose leaf node bounding boxes intersect with the first target line segment in the K-dimensional tree of all grids, and secondarily screening the first target surface bounding boxes intersecting with the first target line segment from each of the first target leaf nodes; Taking the surface corresponding to the first target surface bounding box obtained by screening all grids as the first target surface, determining the number of all first target surfaces intersecting with the first target line segment, and obtaining the total number of intersections between the first target line segment and the target boundary; The hole unit determination result of the first target unit in the current grid is determined according to the parity of the total number of intersections between the first target line segment and the target boundary.
7. A terminal, characterized in that: include: A memory, a processor, and a nested grid hole unit determination program stored in the memory and executable on the processor, wherein the nested grid hole unit determination program, when executed by the processor, implements the steps of the nested grid hole unit determination method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program can be executed to implement the steps of the nested grid hole unit determination method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Explicit nested grid assembly method and device and storage medium
CN114201823A
Adaptive Cartesian grid rapid generation optimization method
CN118094668A