Topological Method, Device, Equipment, Storage Medium and Product for Hybrid Mesh
The method improves the efficiency and accuracy of topological processing of large-scale CGNS grid files by dividing data points among multiple processes, leveraging multi-core computing and ensuring accurate determination of starting points to complete grid element tasks.
Patent Information
- Application Number
- CN202411328026.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2044-09-23
AI Technical Summary
Traditional single-process serial processing methods cannot meet the needs of efficient simulation when facing large-scale CGNS grid files, especially hybrid grids in the aero engine field, resulting in insufficient topological speed and efficiency.
The node data points in the grid file are divided into multiple processes and processed in parallel. By determining the topology start point and target data point of each process, the multi-process parallel topology method is adopted to utilize the multi-core processing capabilities of modern computers to avoid omissions caused by the division of data points into adjacent processes.
Improve the efficiency and processing speed of grid topology, make full use of computing resources, ensure the accurate completion of topology tasks, and reduce errors caused by data point loss.
Smart Images

Figure CN119440802B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of computational fluid dynamics, and in particular, to a topology method, device, equipment, storage medium and product for a hybrid grid. Background Art
[0002] In the field of engineering simulation, the generated CGNS (CFD General Notation System) grid file usually includes multiple nodes, and each node contains millions or even hundreds of millions of data points. The scale of the grid cells formed by the topology of the data points is usually relatively large. With the improvement of the simulation accuracy requirements, the scale of the grid cells continues to expand, posing extremely high requirements for the topology speed and reading efficiency of the grid cells.
[0003] In traditional numerical simulations, the topology of the data points in the CGNS grid file is usually processed in a single-process serial manner, which causes significant time consumption when facing a large number of data points. Especially in the field of aeroengines, due to the large scale of the grid cells and the mixture of various different types of grid cells under the same node, for such hybrid grids, the single-process topology method can no longer meet the requirements of efficient simulation. Summary of the Invention
[0004] In view of the above problems, the present disclosure is proposed. The present disclosure provides a topology method, device, equipment, storage medium and product for a hybrid grid.
[0005] According to one aspect of the present disclosure, a topology method for a hybrid grid is provided, including:
[0006] Dividing the data points included in the nodes in the grid file based on the number of processes for generating grid cells, to obtain the data points that each process needs to perform topology on, where the attributes of the data points are the grid types to which the grid cells belong and / or the vertices constituting the grid cells;
[0007] Obtaining the latest N data points in the topological order from the data points that the i-th process needs to perform topology on; the N is determined based on the number of vertices corresponding to the target grid type, the target grid type being the grid type to which the grid cells formed by the largest number of vertices in the node belong, and the i-th process being any one of the processes;
[0008] Obtaining target data points whose attributes include the grid type from the N data points;
[0009] Based on the target data points and the data points required for the topology of the (i + 1)-th process, determine the topology starting point of the (i + 1)-th process. Based on the topology starting point, perform grid topology on the N data points and the data points required for the topology of the (i + 1)-th process; the topology starting point includes the target data points among the N data points where grid cells cannot be generated and / or the first data point among the data points required for the topology of the (i + 1)-th process.
[0010] In addition, the topology method of the hybrid grid according to an aspect of the present disclosure further includes:
[0011] Determining the topology starting point of the (i + 1)-th process based on the target data points and the data points required for the topology of the (i + 1)-th process includes:
[0012] Based on the topology order of the current target data point among the N data points, obtain the number of remaining data points whose topology order is later than that of the current target data point; and, based on the grid type indicated by the current target data point, obtain the number of vertices corresponding to the current target data point, where the current target data point is any one of the target data points; and, based on the data points required for the topology of the (i + 1)-th process, obtain the attribute of the first data point among the data points required for the topology of the (i + 1)-th process.
[0013] In the case where the number of the remaining data points is less than the number of vertices corresponding to the current target data point, determine the current target data point as the topology starting point;
[0014] In the case where the attribute of the first data point includes the grid type, determine the first data point as the topology starting point.
[0015] In addition, the topology method of the hybrid grid according to an aspect of the present disclosure further includes:
[0016] Performing grid topology on the N data points and the data points required for the topology of the (i + 1)-th process based on the topology starting point includes:
[0017] Insert the N data points in front of the first data point of the (i + 1)-th process to obtain the data points to be topologized for the (i + 1)-th process;
[0018] Based on the target topology starting point, calculate the theoretical topology order of the target data points to be topologized, where the target topology starting point is any one of the topology starting points, and the target data points to be topologized are the data points to be topologized whose attributes are characterized as the grid type;
[0019] When the attributes of the data points to be topologized located in the theoretical topological order are all of the grid type, obtain the topological structure generated based on the target topological starting point; when there are data points to be topologized located in the theoretical topological order whose attributes are not of the grid type, delete the target topological starting point from the topological starting points;
[0020] Select a new target topological starting point from the remaining topological starting points, and repeat the step of calculating the theoretical topological order of the target data points to be topologized based on the target topological starting point until there are no remaining topological starting points.
[0021] In addition, the topological method for a hybrid grid according to one aspect of the present disclosure further includes:
[0022] After repeating the step of calculating the theoretical topological order of the target data points to be topologized based on the target topological starting point until there are no remaining topological starting points, it further includes:
[0023] Obtain the number of topological structures generated by the (i + 1)-th process;
[0024] When the number of topological structures generated by the (i + 1)-th process is equal to 1, use the topological structure as the final topological structure of the (i + 1)-th process;
[0025] When the number of topological structures generated by the (i + 1)-th process is greater than 1, based on the topological structure generated by the i-th process and / or the topological structure generated by the (i + 2)-th process, determine the final topological structure of the (i + 1)-th process from the multiple topological structures generated by the (i + 1)-th process.
[0026] In addition, the topological method for a hybrid grid according to one aspect of the present disclosure further includes:
[0027] After repeating the step of calculating the theoretical topological order of the target data points to be topologized based on the target topological starting point until there are no remaining topological starting points, it further includes:
[0028] Update the pre-established topological number table based on the obtained number of topological structures generated by the (i + 1)-th process, where the topological number table is used to record the number of topological structures generated by the i-th process, the (i + 1)-th process, and the (i + 2)-th process;
[0029] When the number of topological structures generated by the (i + 1)-th process recorded after the update of the topological number table is greater than 1, update the number of topological structures generated by the (i + 1)-th process recorded in the topological number table based on the obtained number of topological structures generated by the i-th process and the (i + 2)-th process;
[0030] When the number of topologies generated by the (i + 1)-th process recorded after the update of the topology quantity table is equal to 1, update the number of topologies generated by the i-th process and the (i + 2)-th process to 1.
[0031] In addition, the topology method for a hybrid grid according to one aspect of the present disclosure further includes:
[0032] Based on the topology generated by the i-th process and / or the topology generated by the (i + 2)-th process, determine the final topology of the (i + 1)-th process from the multiple topologies generated by the (i + 1)-th process, including:
[0033] When the number of topologies generated by the i-th process is equal to 1, obtain the correct topology starting point of the (i + 1)-th process based on the end point of the topology generated by the i-th process, and determine the topology structure with the target topology starting point consistent with the correct topology starting point as the final topology of the (i + 1)-th process;
[0034] When the number of topologies generated by the i-th process is greater than 1, obtain the possible topology starting points of the (i + 1)-th process based on the end points of the multiple topologies generated by the i-th process, and obtain the possible topology end points of the (i + 1)-th process based on the topology starting points of the topologies generated by the (i + 2)-th process; based on the possible topology starting points and possible topology end points of the (i + 1)-th process, determine the target topology structure from the multiple topologies generated by the (i + 1)-th process, where the target topology structure uses the possible topology starting point as the topology starting point and the possible topology end point as the topology end point; when the number of target topology structures is equal to 1, determine the target topology structure as the final topology of the (i + 1)-th process, and when the number of target topology structures is greater than 1, wait for the number of topologies generated by the i-th process to be updated to 1 and execute the operation when the number of topologies generated by the i-th process is equal to 1.
[0035] According to another aspect of the present disclosure, there is provided a topology device for a hybrid grid, including:
[0036] A partitioning module, configured to partition the data points included in the nodes in the grid file based on the number of processes for generating grid cells, and obtain the data points that each process needs for topology, where the attributes of the data points are the grid types to which the grid cells belong and / or the vertices constituting the grid cells;
[0037] The first acquisition module is configured to acquire the latest N data points in terms of topological order from the data points required for topology by the i-th process; the N is determined based on the number of vertices corresponding to the target grid type, and the target grid type is the grid type to which the grid cell composed of the largest number of vertices among the nodes belongs, and the i-th process is any one of the processes;
[0038] The second acquisition module is configured to acquire target data points whose attributes include the grid type from the N data points;
[0039] The topology module is configured to determine the topology starting point of the (i + 1)-th process based on the target data points and the data points required for topology by the (i + 1)-th process, and perform grid topology on the N data points and the data points required for topology by the (i + 1)-th process based on the topology starting point; the topology starting point includes the target data points in the N data points where grid cells cannot be generated and / or the first data point among the data points required for topology by the (i + 1)-th process.
[0040] According to another aspect of the present disclosure, there is provided a computer device, including a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program to implement the method of the above aspect.
[0041] According to another aspect of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method of the above aspect is implemented.
[0042] According to another aspect of the present disclosure, there is provided a computer program product, including a computer program, and when the computer program is executed by a processor, the method of the above aspect is implemented.
[0043] As will be described in detail below, a topology method, device, equipment, storage medium, and product for a hybrid grid according to an embodiment of the present disclosure divide the data points under a node among multiple processes, and the multiple processes process in parallel to perform grid topology on the data points. This not only improves the topology efficiency and processing speed, but also can make full use of the multi-core processing capabilities of modern computers, and assigns the data point topology tasks to different processes for processing, improving the utilization rate of computing resources; on the other hand, in order to avoid the situation where the data points constituting the same grid cell are divided into two processes, the topology starting point of the (i + 1)-th process is determined through the target data points and the data points required for topology assigned to the (i + 1)-th process, which can ensure the determination of the topology starting point for the (i + 1)-th process and avoid the loss of data points resulting in missing grid cells that need to be topologized between adjacent processes.
[0044] It is to be understood that both the foregoing general description and the following detailed description are exemplary and are intended to provide further explanation of the claimed technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The above and other objects, features, and advantages of the present disclosure will become more apparent from the following detailed description of the embodiments of the present disclosure in conjunction with the accompanying drawings. The drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification, and together with the embodiments of the present disclosure are used to explain the present disclosure, and do not constitute a limitation to the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.
[0046] Figure 1 is a flowchart illustrating a topological method of applying a hybrid grid according to an embodiment of the present disclosure.
[0047] Figure 2 is another flowchart illustrating a topological method of applying a hybrid grid according to an embodiment of the present disclosure.
[0048] Figure 3 is a table illustrating the possible number of topologies of process 0-2 according to an embodiment of the present disclosure.
[0049] Figure 4 is a table illustrating the possible number of topologies of process 3-5 according to an embodiment of the present disclosure.
[0050] Figure 5 is a schematic structural diagram of a topological device of a hybrid grid according to an embodiment of the present disclosure.
[0051] Figure 6 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure.
[0052] Figure 7 is a schematic diagram of a computer program product according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0053] In order to make the objectives, technical solutions, and advantages of the present disclosure more apparent, exemplary embodiments according to the present disclosure will be described in detail below with reference to the accompanying drawings. It is obvious that the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments of the present disclosure. It should be understood that the present disclosure is not limited by the exemplary embodiments described herein.
[0054] In the field of engineering simulation, the generated CGNS (CFD General Notation System) grid files usually include multiple nodes, each node containing millions or even hundreds of millions of data points, and the scale of the grid cells formed by the topology of the data points is usually relatively large. With the improvement of the simulation accuracy requirements, the scale of the grid cells is continuously expanding, posing extremely high requirements for the topological speed and reading efficiency of the grid cells.
[0055] In traditional numerical simulations, the topology of the data points in CGNS grid files is usually processed in a single-process serial manner, which will cause significant time consumption when facing a large number of data points. Especially in the field of aeroengines, due to the large scale of the grid cells and the mixture of various different types of grid cells under the same node, for this kind of hybrid grid, the single-process topology method can no longer meet the requirements of efficient simulation.
[0056] As described above, with reference to the accompanying drawings, a topology method, device, equipment, storage medium and product of a hybrid grid according to an embodiment of the present disclosure are described. By dividing the data points under the node among multiple processes and parallel processing by multiple processes for grid topology of the data points, not only the topology efficiency and processing speed are improved, but also the multi-core processing capabilities of modern computers can be fully utilized, and the data point topology tasks are assigned to different processes for processing, improving the utilization rate of computing resources.
[0057] In addition, in order to avoid the situation where the data points constituting the same grid cell are divided into adjacent processes, by using the target data points and the data points that need to be topologized by the (i + 1)-th process, the topology starting point of the (i + 1)-th process can be determined, which can ensure the determination of the topology starting point for the (i + 1)-th process and avoid the occurrence of data point loss resulting in the inability to correctly complete the grid cell task.
[0058] On the other hand, by establishing a topology quantity table centered on each process and communicating between the topology quantity tables of adjacent processes to receive and send the topology structures and quantities of adjacent processes, the unique correct topology structure of the (i + 1)-th process can be determined, which is beneficial to improving the accuracy rate of topology.
[0059] To facilitate the understanding of this embodiment, first, a topology method for a hybrid grid disclosed in this embodiment of the present disclosure will be introduced in detail. The execution subject of the topology method for the hybrid grid provided in this embodiment of the present disclosure is generally a computer device with certain computing capabilities. Such a computer device includes, for example: a terminal device, a server, or other processing devices. The terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementation manners, the topology method for the hybrid grid may be implemented by a processor invoking computer-readable instructions stored in a memory.
[0060] As Figure 1 shown, it is a flowchart of the topology method for the hybrid grid provided in this embodiment of the present disclosure. The method includes S101 - S104:
[0061] S101: Divide the data points included in the nodes in the grid file based on the number of processes for generating grid cells, and obtain the data points that each process needs to topologize.
[0062] Among them, the grid file is a CGNS grid file generated during engineering simulation. The grid file includes multiple nodes, and each node includes multiple data points arranged in sequence (i.e., topological order).
[0063] The attribute of the data point is the grid type to which the grid cell belongs and / or the vertices constituting the grid cell. Specifically, a supported grid type code table is constructed in advance according to all supported grid types and their codes provided in the CGNS grid file. For example, the grid type represented by code 10 is a tetrahedral grid, which needs to be composed of 4 vertices; 14 represents a hexahedral grid, which needs to be composed of 6 vertices; 15 represents an octahedral grid, which needs to be composed of 8 vertices. Assume that the value of a certain data point is 8 (a code not existing in the grid type code table), indicating that the attribute of this data point is a vertex. In the subsequent topology process, this data point only serves as a vertex constituting a certain grid cell; assume that the value of this data point is 10, indicating that the attribute of this data point may be the grid type (tetrahedral grid) or a vertex. In the subsequent topology process, this data point may be the starting point of a certain grid cell, and its true attribute can be verified in the subsequent topology process.
[0064] Specifically, the process is used to generate grid cells through grid topology for data points, and divide the data points included in the node among each process. Assuming that the node includes 160 data points and the number of processes is 4, 40 data points that need to be topologized are evenly allocated to processes 0-3. Preferably, in this embodiment, the numbers of the data points that each process needs to be topologized are consecutive, and the numbers of the data points of adjacent processes are connected end to end.
[0065] Assume that the values of the data points that process 0 needs to be topologized are (sorted by number): 10, 1, 2, 3, 4, 14, 5, 6, 7, 8. Since "10" is the first in the topological order of process 0 and the attribute of "10" is the grid type, i.e., the tetrahedral grid, "10" must be the topological starting point of process 0. The "1, 2, 3, 4" behind "10" are the vertices that form the tetrahedral grid. "10, 1, 2, 3, 4" is a grid cell generated by topology, and "14" is the starting point of the next grid cell.
[0066] S102: Obtain the N data points with the latest topological order from the data points that the i-th process needs to be topologized.
[0067] Among them, the i-th process is any process, and N is determined based on the number of vertices corresponding to the target grid type. The target grid type is the grid type to which the grid cell composed of the largest number of vertices in the node belongs. Assume that the target grid type under the node in this embodiment is the octahedral grid represented by code 15. Since a total of 9 data points are required to generate the grid cell of the octahedron through topology, N = 9. This can ensure that there is at least one data point with the attribute of grid type among the N data points. Assume that the i-th process is process 1, then obtain the last 9 data points of process 1 and store the 9 data points separately for determining the topological starting point of process 2 in the subsequent steps.
[0068] S103: Obtain the target data point whose attribute includes the grid type from the N data points.
[0069] Specifically, obtain the values of the N data points. If the value of a certain data point is a code existing in the grid type code table, it is confirmed that the attribute of this data point includes the grid type. For example, if the value of a certain data point is 14, the attribute of this data point may be the grid type or the vertex that forms the grid cell, and it cannot be determined currently. Then this data point is considered as the target data point, and the true attribute of the target data point can be verified in the subsequent grid topology process.
[0070] S104: Based on the target data point and the data points that the (i + 1)-th process needs to be topologized, determine the topological starting point of the (i + 1)-th process, and perform grid topology on the N data points and the data points that the (i + 1)-th process needs to be topologized based on the topological starting point.
[0071] Among them, the topological starting point includes the target data points that fail to generate grid cells among the N data points and / or the first data point among the data points required for topology by the (i + 1)-th process. Specifically, S104 includes the following steps 11-17:
[0072] Step 11: Based on the topological order of the current target data point among the N data points, obtain the number of remaining data points whose topological order is later than that of the current target data point; and, based on the grid type indicated by the current target data point, obtain the number of vertices corresponding to the current target data point; and, based on the data points required for topology by the (i + 1)-th process, obtain the attribute of the first data point among the data points required for topology by the (i + 1)-th process.
[0073] Among them, the current target data point is any one of the target data points. Assume that the N data points are 9 data points, and in topological order, the values are: 14, 8, 9, 10, 11, 12, 13, 10, 14. Then the target data points are the 1st (14), 4th (10), 8th (10), and 9th data points (14). Example 1: When the current target data point is the 1st data point (14), the number of remaining data points whose topological order is later than that of the current target data point is 8, and the number of vertices corresponding to the current target data point is 6. Example 2: When the current target data point is the 8th data point (10), the number of remaining data points whose topological order is later than that of the current target data point is 1, and the number of vertices corresponding to the current target data point is 4.
[0074] Step 12: In the case where the number of remaining data points is less than the number of vertices corresponding to the current target data point, determine that the current target data point is the topological starting point; in the case where the attribute of the first data point includes a grid type, determine that the first data point is the topological starting point.
[0075] Specifically, the 1st data point (14) and the 4th data point (10) cannot be used as topological starting points. Taking the 1st data point (14) as an example, assume that the attribute of the 1st data point (14) is the grid type. Then the grid cell formed with the 1st data point (14) as the starting point must have been generated in process i. To avoid process (i + 1) from generating the same grid cell repeatedly, the 1st data point (14) cannot be used as the topological starting point. Among the above 9 data points, the 8th data point (10) and the 9th data point (14) are the topological starting points for the (i + 1)-th process.
[0076] Assuming that the value of the first data point among the data points that the i+1th process needs to have a topology is 11, it means that the attribute of the first data point cannot be a grid type, and the first data point cannot be used as a topology starting point. The real topology starting point of the i+1th process is the 8th data point (10) or the 9th data point (14), which needs to be verified in the subsequent grid topology process. However, assuming that the value of the first data point among the data points that the i+1th process needs to have a topology is 15, it means that the attribute of the first data point includes a grid type, and the first data point is also a topology starting point. The real topology starting point of the i+1th process is the 8th data point (10), the 9th data point (14), or the first data point, which needs to be verified in the subsequent grid topology process.
[0077] This embodiment takes into account special circumstances that may occur, for example, the data points constituting a certain grid unit are not truncated by process i and process i+1, and the first data point among the data points that process i+1 needs topology is the real topology starting point of process i+1. Therefore, by searching for the topology starting point of process i+1 from N data points and the first data point of process i+1, it can be ensured that the real topology starting point of process i+1 must exist among these N+1 data points, thus avoiding the omission of grid units that need topology between adjacent processes due to the loss of data points.
[0078] Step 13: Insert N data points in front of the first data point of the i+1th process to obtain the topological data points to be added to the i+1th process.
[0079] Specifically, assuming that the number of topological data points required by the i+1th process is 40, N=9, 9 data points are inserted in front of the first data point of the i+1th process, and the number of topological data points to be calculated for the i+1th process is 49 in total.
[0080] Step 14: Based on the target topology starting point, calculate the theoretical topological order of the target topological data points.
[0081] Wherein, the target topology starting point is any topology starting point, and the target to-be-topological data point is a to-be-topological data point whose attribute is characterized as a mesh type. Taking the target topology starting point as the 8th data point (10) as an example, the 8th data point (10) has a topological order of 1st in the i+1th process. Since the value 10 represents a tetrahedral mesh, the to-be-topological data points with topological orders of 1-5 constitute a tetrahedral mesh unit, and the starting point of the next mesh unit is the target to-be-topological data point, that is, the to-be-topological data point with a topological order of 6th. The confirmation method of the subsequent target to-be-topological data points is similar, and this embodiment will not be repeated.
[0082] Step 15: When the attributes of all the to-be-topologized data points in the theoretical topological order are of the grid type, obtain the topological structure generated based on the target topological starting point; when there are to-be-topologized data points in the theoretical topological order whose attributes are not of the grid type, delete the target topological starting point from the topological starting points.
[0083] Specifically, assume that the 8th data point (10) is the real topological starting point of the (i + 1)-th process. Then, theoretically, the attributes of the to-be-topologized data points with the topological order of 6 (i.e., the theoretical topological order) should be of the grid type, that is, the values of the to-be-topologized data points with the topological order of 6 should exist in the grid type code table. If, in the (i + 1)-th process, the values of all the to-be-topologized data points in each theoretical topological order exist in the grid type code table, it means that the (i + 1)-th process can generate a complete topological structure with the 8th data point (10) as the topological starting point, and save the topological structure. If the values of at least one to-be-topologized data point in the theoretical topological order do not exist in the grid type code table, it means that the 8th data point (10) is not the real topological starting point of the (i + 1)-th process and a complete topological structure cannot be generated, and this target topological starting point is deleted from the topological starting points.
[0084] Step 16: Select a new target topological starting point from the remaining topological starting points, and repeat Step 14 until there are no remaining topological starting points.
[0085] Assume that the topological starting points are: the 8th data point (10), the 9th data point (14), and the first data point of the (i + 1)-th process. If, in the (i + 1)-th process, the values of all the to-be-topologized data points in each theoretical topological order exist in the grid type code table, after saving the topological structure, select a new target topological starting point from the remaining topological starting points. For example, the new target topological starting point is the 9th data point (14), and then repeat Step 14. If the 8th data point (10) is not the real topological starting point of the (i + 1)-th process, delete the 8th data point (10) from the topological starting points, and then select a new target topological starting point from the remaining topological starting points. For example, the new target topological starting point is the 9th data point (14), and repeat Step 14.
[0086] Step 17: Obtain the number of topological structures generated by the (i + 1)-th process;
[0087] When the number of topological structures generated by the (i + 1)-th process is equal to 1, the topological structure is taken as the final topological structure of the (i + 1)-th process. For example, if only the 9th data point (14) can be used as the starting point of the target topology to generate a complete topological structure, then the 9th data point (14) is the real starting point of the topology of the (i + 1)-th process, and the topological structure is also the only correct final topological structure generated by the (i + 1)-th process.
[0088] When the number of topological structures generated by the (i + 1)-th process is greater than 1, based on the topological structure generated by the i-th process and / or the topological structure generated by the (i + 2)-th process, the final topological structure of the (i + 1)-th process is determined from the multiple topological structures generated by the (i + 1)-th process. For example, taking the 9th data point (14) and the first data point of the (i + 1)-th process as the starting points of the target topology can both generate complete topological structures, but each process can only generate a unique correct topological structure. Among the 9th data point (14) and the first data point of the (i + 1)-th process, only one data point is the real starting point of the topology of the (i + 1)-th process. In this case, it is necessary to determine the final topological structure of the (i + 1)-th process through the topological structure generated by the i-th process and / or the (i + 2)-th process. Specifically, this embodiment is explained in the following two cases:
[0089] Case 1: When the number of topological structures generated by the i-th process is equal to 1:
[0090] Based on the end point of the topological structure generated by the i-th process, obtain the correct starting point of the topology of the (i + 1)-th process, and determine the topological structure with the target starting point consistent with the correct starting point as the final topological structure of the (i + 1)-th process.
[0091] Specifically, the number of topological structures generated by the i-th process being equal to 1 means that the i-th process has generated the only correct final topological structure, and the end point of the topological structure of the i-th process is also unique. Based on the end point of the topological structure generated by the i-th process, obtain the number of the last data point of the topological structure generated by the i-th process. Suppose the number is 38, then it means that the data point numbered 39 is the correct starting point of the topology of the (i + 1)-th process, and the topological structure generated with the target starting point numbered 39 is the final topological structure of the (i + 1)-th process.
[0092] Case 2: When the number of topological structures generated by the i-th process is greater than 1, it includes the following steps:
[0093] 1) Based on the end points of the multiple topological structures generated by the i-th process, obtain the possible starting points of the topology of the (i + 1)-th process, and, based on the starting points of the topological structures generated by the (i + 2)-th process, obtain the possible end points of the topology of the (i + 1)-th process.
[0094] Specifically, assume that the i-th process generates two topological structures and has not yet determined a unique final topological structure. At this time, the i-th process has two end points. Assume that the (i + 2)-th process generates one topological structure, that is, the correct topological starting point of the (i + 2)-th process is determined. The possible topological end points of the (i + 1)-th process can be determined based on the correct topological starting point of the (i + 2)-th process. Here, it should be noted that in the case where the number of topological structures generated by the (i + 1)-th process is greater than 1 (assuming the number is equal to 2), the possible topological end points of the topological structures generated by the (i + 1)-th process may coincide. In this case of coincidence, although the possible topological end points of the (i + 1)-th process are determined, the correct topological starting point of the (i + 1)-th process cannot be determined.
[0095] 2) Based on the possible topological starting point and possible topological end points of the (i + 1)-th process, determine the target topological structure from the multiple topological structures generated by the (i + 1)-th process.
[0096] Specifically, the target topological structure has the possible topological starting point as the topological starting point and the possible topological end point as the topological end point. Assume that the possible topological starting points of the (i + 1)-th process are A and B, and the possible topological end point is C. If there is a topological structure with A as the topological starting point and C as the topological end point among the multiple topological structures generated by the (i + 1)-th process, then this topological structure is the target topological structure; if there is a topological structure with B as the topological starting point and C as the topological end point among the multiple topological structures generated by the (i + 1)-th process, then this topological structure is also the target topological structure.
[0097] 3) When the number of target topological structures is equal to 1, determine the target topological structure as the final topological structure of the (i + 1)-th process. When the number of target topological structures is greater than 1, wait for the number of topological structures generated by the i-th process to be updated to 1, and perform the operations in case 1.
[0098] Specifically, if there is only a topological structure with A as the topological starting point and C as the topological end point among the multiple topological structures generated by the (i + 1)-th process, then this target topological structure is the final topological structure of the (i + 1)-th process. If the number of target topological structures is greater than 1, it means that the final topological structure of the (i + 1)-th process cannot be determined currently. After the i-th process determines the final topological structure, the correct topological starting point of the (i + 1)-th process needs to be determined based on the final topological structure of the i-th process, and then the final topological structure of the (i + 1)-th process can be determined.
[0099] Preferably, in an embodiment of the present disclosure, a topology quantity table mainly based on each process is pre-constructed. The topology quantity table records the quantities of the topology structures generated by the i-th process, the (i + 1)-th process, and the (i + 2)-th process, and is used for communication between the i-th process, the (i + 1)-th process, and the (i + 2)-th process to determine the final topology structure of the (i + 1)-th process. In this embodiment, the topology quantity table constructed by the (i + 1)-th process (hereinafter referred to as the (i + 1)-th topology quantity table) will be taken as an example for explanation. Specifically, the following steps 18-19 are included:
[0100] Step 18: Update the pre-established (i + 1)-th topology quantity table based on the quantity of the topology structure generated by the (i + 1)-th process obtained.
[0101] Among them, the first bit of the (i + 1)-th topology quantity table is used to record the quantity of the topology structure generated by the i-th process, the second bit is used to record the quantity of the topology structure generated by the (i + 1)-th process, and the third bit is used to record the quantity of the topology structure generated by the (i + 2)-th process. The initial data recorded in the (i + 1)-th topology quantity table is 0 or a null value. It should be noted that in the case where the (i + 1)-th process is the first process or the last process, taking the (i + 1)-th process as the last process as an example, the quantity of the topology structure generated by the (i + 2)-th process recorded in the (i + 1)-th topology quantity table is "-1", that is, it is null.
[0102] After obtaining the quantity of the topology structure generated by the (i + 1)-th process, assuming that the quantity of the topology structure generated by the (i + 1)-th process is 1, then update the second bit recorded in the (i + 1)-th topology quantity table to 1. Preferably, in this embodiment, receive the quantity of the topology structure generated by the i-th process sent by the topology quantity table mainly constructed by the i-th process, and receive the quantity of the topology structure generated by the (i + 2)-th process sent by the topology quantity table mainly constructed by the (i + 2)-th process, and update the first bit and the third bit recorded in the (i + 1)-th topology quantity table.
[0103] Step 19: Case 1: In the case where the quantity of the topology structure generated by the (i + 1)-th process recorded after the (i + 1)-th topology quantity table is updated is equal to 1, update the quantities of the topology structures generated by the i-th process and the (i + 2)-th process to 1.
[0104] Specifically, when the value recorded in the second bit of the (i + 1)-th topology quantity table is 1, it indicates that the (i + 1)-th process has been able to determine the unique final topology structure. After the (i + 1)-th topology quantity table sends the quantity of the topology structure generated by the (i + 1)-th process to the topology quantity table mainly constructed by the i-th process, regardless of whether the i-th process can determine the final topology structure, the value recorded in the first bit of the (i + 1)-th topology quantity table can be updated to 1, indicating that the (i + 1)-th topology quantity table does not need to send quantity information to the topology quantity table mainly constructed by the i-th process anymore. Similarly, after the (i + 1)-th topology quantity table sends the quantity of the topology structure generated by the (i + 1)-th process to the topology quantity table mainly constructed by the (i + 2)-th process, the (i + 2)-th process must be able to determine the final topology structure based on the final topology structure of the (i + 1)-th process. Therefore, the value recorded in the third bit of the (i + 1)-th topology quantity table can be updated to 1, indicating that the (i + 1)-th topology quantity table does not need to send quantity information to the topology quantity table mainly constructed by the (i + 2)-th process anymore.
[0105] Case 2: When the quantity of the topology structure generated by the (i + 1)-th process recorded after the update of the topology quantity table is greater than 1, based on the quantities of the topology structures generated by the obtained i-th process and the (i + 2)-th process, update the quantity of the topology structure generated by the (i + 1)-th process recorded in the topology quantity table.
[0106] Specifically, based on the quantities of the topology structures generated by the obtained i-th process and the (i + 2)-th process, updating the quantity of the topology structure generated by the (i + 1)-th process recorded in the topology quantity table can refer to the specific method described in the above-mentioned Case 2.
[0107] As Figure 2 shown, it is another flowchart of the topology method for the hybrid grid provided by the embodiments of the present disclosure. The method includes S201 - S204:
[0108] S201: According to the number of data points of the nodes in the CGNS grid file, calculate the upper and lower limits of the numbers of the data points that each process needs to read in, and each process reads in the data points between its upper and lower limits respectively.
[0109] Different from the reading of a single grid type, in the embodiments of the present disclosure, when reading, the number of grid cells and the possible grid types included are not considered. Instead, each process calculates the number of data points that each process needs for topology according to the number of data points, and distributes them evenly to ensure that the quantity processed by each process is consistent as much as possible. Multiple processes perform parallel processing to improve the reading efficiency.
[0110] Specifically, S201 includes the following steps:
[0111] S2011: Open the CGNS grid file, scan the information of the data points in the current CGNS grid file, determine that the nodes include two or more types of grids (i.e., mixed grids), and each process obtains the total number of data points included in the nodes.
[0112] S2012: According to the number of processes, set the size of the communication domain of each process in MPI. Calculate the number of data points that each process needs to read and the upper and lower limits of the numbers according to the size of the communication domain.
[0113] For example, if the total number of data points is 20 and the number of processes is 2 (process 0 and process 1), then the number of data points that process 0 needs to read is 10, the lower limit of the number is 1, and the upper limit of the number is 10 (i.e., the data points numbered 1 - 10); the number of data points that process 1 needs to read is 10, the lower limit of the number is 11, and the upper limit of the number is 20 (i.e., the data points numbered 11 - 20).
[0114] S202: Based on the inter - process communication mechanism of MPI, send the information of the last N data points of the previous process to the next process.
[0115] Among them, the last process does not communicate. N is determined based on the number of vertices corresponding to the target grid type. The target grid type is the grid type to which the grid cell composed of the largest number of vertices in the node belongs. Assume that the target grid type under the node in this embodiment is the hexahedron grid represented by code 14. Since a total of 7 data points are required to generate the grid cells of the hexahedron by topology, so N = 7. Specifically, S202 includes the following steps:
[0116] S2021: The current process obtains the last N data points from the previous process through communication. Assume N = 7, save the 7 data points separately, and create a possible start point boolean array and a possible end point boolean array according to the number (length) of the N data points. The lengths of the possible start point boolean array and the possible end point boolean array in this embodiment are 7 + 1 = 8, and the initial value of the default boolean array is -1 (false). The possible start point boolean array represents the data points among the 7 data points and the first data point of the current process that may become the topological start point of the current process. Among them, there must be a unique correct topological start point; the possible end point boolean array represents the data points among the 7 data points and the first data point of the current process that may become the topological end point of the current process. Among them, there must be a unique correct topological end point.
[0117] S2022: Construct a supported grid type code table according to all supported grid types and their codes provided by the CGNS grid file.
[0118] Specifically, the supported mesh types depend on the solver itself. In this embodiment, the tetrahedron represented by code 10 and the hexahedron represented by code 14 are taken as examples.
[0119] S2023: Insert 7 data points in front of the first data point of the current process, and determine whether the values of the 7 data points and the first data point of the current process exist in the mesh type code table. Assume that the value of the 3rd data point among the 7 data points is 10, then update the value corresponding to the 3rd data point in the possible starting point boolean array to 1 (true).
[0120] S2024: Arbitrarily select a target data point from the data points with a value of 1 recorded in the possible starting point boolean array. Based on the topological order of the target data point among the 7 data points, obtain the number of remaining data points with a topological order later than the target data point; and, based on the mesh type indicated by the target data point, obtain the number of vertices corresponding to the target data point; in the case where the number of remaining data points is less than the number of vertices corresponding to the target data point, determine the target data point as a possible topological starting point.
[0121] If the number of remaining data points is greater than or equal to the number of vertices corresponding to the target data point, it means that this mesh cell can be completely generated in the previous process. To avoid duplicate generation, update the value corresponding to its position in the possible starting point boolean array to -1. And so on, filter all the data points with a value of 1 recorded in the possible starting point boolean array to determine the final possible topological starting points.
[0122] S203: Based on each topological starting point in turn, start the mesh topology for the data points of the current process.
[0123] Specifically, during the mesh topology process, filter illegal data points. The filtering logic is: during the mesh topology process, at the position of the data point where the attribute should be the mesh type, a data point with a value that does not exist in the mesh type code table appears. Then this data point is illegal, and the current topological starting point is not the correct topological starting point for the current process. Directly skip the current topological starting point and start the mesh topology for the current process based on the next topological starting point. Repeat this step in a loop until all topological starting points are traversed. This ensures that even if the topological starting point is inaccurate, the current process can still find the correct topological starting point through multiple attempts while greatly shortening the time to confirm the final topological structure.
[0124] Specifically, S203 includes the following steps:
[0125] S2031: Loop through all topological starting points to generate the mesh topology.
[0126] If an illegal data point appears, it is considered that the current topological starting point is incorrect and is skipped directly. If the grid topology can be topologically extended to the last data point of the current process, this topological structure is temporarily saved.
[0127] S2032: Create a table of the number of possible topologies.
[0128] The table of the number of possible topologies maintains the virtual states of the current process and adjacent processes. The length of the table is 3. The first bit represents the number of topological structures generated by the previous process, the second bit represents the number of topological structures generated by the current process, and the third bit represents the number of topological structures generated by the next process.
[0129] Among them, the virtual state is a state that exists to further reduce communication between processes. First, the number of topological structures (or their virtual states) generated by adjacent processes is recorded in the table of the number of possible topologies. To minimize communication and avoid wasting resources, after the current process sends a unique topological structure to an adjacent process, the number representing the adjacent process in the table of the number of possible topologies can be directly marked as 1 (virtual state). The reason for this is that after the current process sends a unique topological structure to its adjacent process, regardless of whether the adjacent process can find the final topological structure, there is no need to continue receiving data from the current process (because the data of the current process will not be updated anymore, and repeated sending is meaningless).
[0130] S2033: After each topological structure is generated by the current process, update the second bit of the table of the number of possible topologies.
[0131] S2034: If the current process generates one topological structure, it is determined as the final topological structure of the current process; if the current process generates multiple topological structures, the final topological structure of the current process needs to be determined according to the topological structures of adjacent processes.
[0132] S204: Through specific communication logic, communicate the known information between processes to adjacent processes, and find the final topological structure of each process on the basis of minimizing the number of communication times and communication volume.
[0133] After all processes have generated topological structures, according to the number of topological structures generated by each process, it is judged whether inter-process communication is required to determine which process generates the final topological structure. If a certain process indeed has multiple possible topological structures, the process will ensure the correct topological structure finally selected through further communication.
[0134] Specifically, S204 includes the following steps:
[0135] S2041: Communicate the possible topological starting points of each process to the previous process, and communicate the possible topological end points to the next process.
[0136] The purpose of this communication is to obtain the topological starting point of the subsequent process or the topological ending point of the previous process. At the same time, it is also determined which processes need to receive information and which processes need to send information in the subsequent topological process.
[0137] S2042: Update the possible topology quantity table according to the received topological starting point and topological ending point of the adjacent process. The previous process updates the first bit, and the subsequent process updates the third bit. If the current process has no previous or subsequent process, it is defaulted to -1 (empty).
[0138] S2043: Calculate whether the current process can determine the final topological structure according to the data in the possible topology quantity table.
[0139] Cross-compare the communication information with the topological structure of the current process according to the information (topological starting point and topological ending point of the adjacent process) received in S2042 or S2046. The next data point of the topological ending point of the previous process may be the topological starting point of the current process, and the topological starting point of the subsequent process may be the topological ending point of the current process.
[0140] S2044: Determine whether the current process sends data to the adjacent process according to the updated possible topology quantity table. Each process needs to determine whether it needs to continue to obtain and send data to the previous process or the subsequent process according to the possible topology quantity table.
[0141] S2045: Judge whether communication needs to continue between processes.
[0142] If the quantity of the topological structure of the current process is 1, it is not necessary to receive information from the adjacent process. If the quantity of the topological structure of the adjacent process is 1, the current process does not need to send information to the adjacent process. If the quantity of the topological structure of the previous process is not 1 (the first bit in the possible topology quantity table is not 1) or the quantity of the topological structure of the subsequent process is not 1 (the third bit in the possible topology quantity table is not 1), the current process needs to send the possible starting point boolean array to the previous process and send the possible ending point boolean array to the subsequent process.
[0143] S2046: When the current process meets the sending or receiving conditions, first receive the information sent by the previous process, and then receive the information sent by the subsequent process.
[0144] If the current process meets the requirement of receiving data, it continues to obtain the topological end point of the previous process and the topological start point of the next process. In each communication loop, the previous process and the next process may successfully find the final topological structure or reduce the number of topological structures. Therefore, the information obtained in each communication may be updated, and then the current process can reduce the number of topological structures according to the updated information. If the number of topological structures of the current process is reduced to 1, the possible topology number table is synchronously updated.
[0145] To further reduce the number of communications, the communication after sending the final topological structure can be specially processed: if the current process sends the topological start point and topological end point corresponding to the final topological structure to its adjacent process, regardless of whether the adjacent process can find the final topological structure, it is not necessary to continue receiving the information of the current process. If the adjacent process can find the unique final topological structure (or reduce the number of topological structures) through the final topological structure sent by the current process, since the information sent by the current process will not be updated, in the next communication loop, the information sent will not be any different. Communicating again is of no help to the adjacent process to find the final topological structure except increasing the communication pressure. On the contrary, if the previous process still cannot find the final topological structure (or cannot reduce the number of topological structures) after the current process sends the topological start point and topological end point corresponding to the final topological structure, then in the next communication loop, it is also of no help for the current process to send the same information.
[0146] Specifically, as Figure 3 shown, it is the possible topology number table of processes 0 - 2. Among them, the number of topological structures included in process 0 is 1, that is, the unique topological structure (final topological structure) is found. The number of topological structures included in processes 1 and 2 is 2, and the adjacent processes of processes 0 - 2 are denoted as -1 (empty).
[0147] According to S2041, the first communication is carried out, and each process communicates the topological start point and topological end point to the previous and next processes. According to S2042, the three possible topology number tables are updated (from -1 to 2). According to S2043, since the number of process 0 is 1, process 1 can find the correct topological start point according to the topological end point of process 0, and then change the second bit of the number table of process 1 to 1. In the number table of process 0, because the unique topological structure is sent to process 1, it means that the number of process 0 will not be updated continuously, so it is no longer necessary to send information to process 1, and the third bit in the number table of process 0 is changed to 1 (marked as virtual state). After receiving the information of process 0, process 1 successfully finds the final topological structure and changes the second bit in the number table of process 1 to 1.
[0148] In Process 2, after calculation, the number of topologies cannot be reduced, and thus loop communication is performed. According to S2044 - S2045, it is found that Process 2 still needs to communicate with Process 1. After the second communication, Process 2 finds that the number of Process 1 coming in this communication is 1. According to S2046, the number of Process 1 recorded in Process 2 is updated to 1. After Process 1 sends the only topology to Process 2, it will no longer send information to Process 2, and the third bit of the number table of Process 1 is changed to 1 (marked as virtual state). According to S2043, it is found that the correct topology starting point of Process 2 can be calculated based on the information of Process 1. At this time, all processes have found the final topology and no longer need communication, so the loop can be exited.
[0149] As Figure 4 shown, it is the possible topology number table of Processes 3 - 5. Among them, the number of topologies included in Processes 3 - 5 is 2 each, and the adjacent processes of Processes 3 - 5 are recorded as -1 (empty). Assume that Process 5 is the last process.
[0150] Perform the first communication according to S2041 - S2042 to update the possible topology number table of Processes 3 - 5. Among them, according to S2043, assume that the final topology of Process 4 can be determined, and the number of topologies of Process 4 is changed to 1. Perform the second communication to communicate the topology starting point and topology end point of Process 4 to Processes 3 and 5, and at the same time update the first bit and the third bit of the number table of Process 4 to 1 (changed to 1 in virtual state). Among them, after receiving the information of Process 4, Process 5 successfully finds the final topology and changes the second bit in the number table of Process 5 to 1. Since Process 3 communicates from back to front and fails to find the final topology, the number of Process 3 remains 2, and the final topology cannot be determined based on Process 4. However, since the data of Process 4 will not be updated further and there is no need to transmit information to Process 3 anymore, the first bit of the possible topology number table of Process 4 is changed to 1 (marked as virtual state), indicating that Process 4 will no longer send information to Process 3. At the same time, the third bit of Process 3 is updated to 1. Process 3 needs to record that it has received the final topology from Process 4 once and will not receive the information of Process 4 in the next communication loop. Process 3 can only rely on Process 2 to determine the final topology.
[0151] According to another aspect of the embodiments of the present disclosure, a topology device for a hybrid grid is provided. As Figure 5 shown, the device includes:
[0152] A partitioning module 101, configured to partition the data points included in the nodes in the grid file based on the number of processes for generating grid cells, so as to obtain the data points that each process needs for topology, and the attributes of the data points are the grid types to which the grid cells belong and / or the vertices constituting the grid cells.
[0153] The first acquisition module 102 is configured to acquire the latest N data points in terms of topological order from the data points required for the topology by the i-th process; the N is determined based on the number of vertices corresponding to the target grid type, and the target grid type is the grid type to which the grid cell composed of the largest number of vertices among the nodes belongs, and the i-th process is any one of the processes.
[0154] The second acquisition module 103 is configured to acquire target data points with attributes including the grid type from the N data points.
[0155] The topology module 104 is configured to determine the topology starting point of the (i + 1)-th process based on the target data points and the data points required for the topology by the (i + 1)-th process, and perform grid topology on the N data points and the data points required for the topology by the (i + 1)-th process based on the topology starting point; the topology starting point includes the target data points in the N data points where grid cells cannot be generated and / or the first data point among the data points required for the topology by the (i + 1)-th process.
[0156] In one or more embodiments, the topology module 104 is configured to:
[0157] Obtain the number of remaining data points with a topological order later than the current target data point based on the topological order of the current target data point in the N data points; and, obtain the number of vertices corresponding to the current target data point based on the grid type indicated by the current target data point, where the current target data point is any one of the target data points; and, obtain the attribute of the first data point among the data points required for the topology by the (i + 1)-th process based on the data points required for the topology by the (i + 1)-th process.
[0158] In the case where the number of the remaining data points is less than the number of vertices corresponding to the current target data point, determine the current target data point as the topology starting point.
[0159] In the case where the attribute of the first data point includes the grid type, determine the first data point as the topology starting point.
[0160] In one or more embodiments, the topology module 104 is configured to:
[0161] Insert the N data points in front of the first data point of the (i + 1)-th process to obtain the data points to be topologized for the (i + 1)-th process.
[0162] Calculate the theoretical topological order of the target data points to be topologized based on the target topology starting point, where the target topology starting point is any one of the topology starting points, and the target data points to be topologized are the data points to be topologized whose attributes are characterized as the grid type.
[0163] When the attributes of the to-be-topologized data points located in the theoretical topological order are all of the grid type, obtain the topological structure generated based on the target topological starting point; when there are attributes that are not of the grid type among the to-be-topologized data points located in the theoretical topological order, delete the target topological starting point from the topological starting points;
[0164] Select a new target topological starting point from the remaining topological starting points, and repeat the step of calculating the theoretical topological order of the target to-be-topologized data points based on the target topological starting point until there are no remaining topological starting points.
[0165] In one or more embodiments, after repeating the step of calculating the theoretical topological order of the target to-be-topologized data points based on the target topological starting point until there are no remaining topological starting points, it includes:
[0166] Obtain the number of topological structures generated by the (i + 1)-th process;
[0167] When the number of topological structures generated by the (i + 1)-th process is equal to 1, use the topological structure as the final topological structure of the (i + 1)-th process;
[0168] When the number of topological structures generated by the (i + 1)-th process is greater than 1, determine the final topological structure of the (i + 1)-th process from the multiple topological structures generated by the (i + 1)-th process based on the topological structure generated by the i-th process and / or the topological structure generated by the (i + 2)-th process.
[0169] In one or more embodiments, after repeating the step of calculating the theoretical topological order of the target to-be-topologized data points based on the target topological starting point until there are no remaining topological starting points, it includes:
[0170] Update the pre-established topological quantity table based on the obtained number of topological structures generated by the (i + 1)-th process, where the topological quantity table is used to record the number of topological structures generated by the i-th process, the (i + 1)-th process, and the (i + 2)-th process;
[0171] When the number of topological structures generated by the (i + 1)-th process recorded after the update of the topological quantity table is greater than 1, update the number of topological structures generated by the (i + 1)-th process recorded in the topological quantity table based on the obtained number of topological structures generated by the i-th process and the (i + 2)-th process;
[0172] When the number of topology structures generated by the (i + 1)-th process recorded after the update of the topology quantity table is equal to 1, update the number of topology structures generated by the i-th process and the (i + 2)-th process to 1.
[0173] In one or more embodiments, based on the topology structure generated by the i-th process and / or the topology structure generated by the (i + 2)-th process, determine the final topology structure of the (i + 1)-th process from the multiple topology structures generated by the (i + 1)-th process, including:
[0174] When the number of topology structures generated by the i-th process is equal to 1, obtain the correct topology starting point of the (i + 1)-th process based on the end point of the topology structure generated by the i-th process, and determine the topology structure with the target topology starting point consistent with the correct topology starting point as the final topology structure of the (i + 1)-th process;
[0175] When the number of topology structures generated by the i-th process is greater than 1, obtain the possible topology starting points of the (i + 1)-th process based on the end points of the multiple topology structures generated by the i-th process, and obtain the possible topology end points of the (i + 1)-th process based on the topology starting points of the topology structures generated by the (i + 2)-th process; based on the possible topology starting points and possible topology end points of the (i + 1)-th process, determine the target topology structure from the multiple topology structures generated by the (i + 1)-th process, where the target topology structure takes the possible topology starting point as the topology starting point and the possible topology end point as the topology end point; when the number of the target topology structures is equal to 1, determine the target topology structure as the final topology structure of the (i + 1)-th process, and when the number of the target topology structures is greater than 1, wait for the number of topology structures generated by the i-th process to be updated to 1, and execute the operation when the number of topology structures generated by the i-th process is equal to 1.
[0176] The topology device of the hybrid grid provided by the embodiments of the present disclosure and the topology method of the hybrid grid provided by the embodiments of the present disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, run, or implemented by them.
[0177] The embodiments of the present disclosure also provide a computer device to execute the above-mentioned topology method of the hybrid grid. Please refer to Figure 6 It shows a schematic diagram of a computer device provided by some embodiments of the present disclosure. As Figure 6As shown, the computer device 8 includes: a processor 800, a memory 801, a bus 802, and a communication interface 803. The processor 800, the communication interface 803, and the memory 801 are connected through the bus 802. A computer program that can run on the processor 800 is stored in the memory 801. When the processor 800 runs the computer program, it executes the topology method of the hybrid grid provided in any of the foregoing embodiments of the present disclosure.
[0178] Among them, the memory 801 may include a high-speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 803 (which can be wired or wireless), a communication connection is realized between this device network element and at least one other network element, and the Internet, wide area network, local area network, metropolitan area network, etc. can be used.
[0179] The bus 802 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. Among them, the memory 801 is used to store programs. After receiving an execution instruction, the processor 800 executes the program. The topology method of the hybrid grid disclosed in any of the foregoing embodiments of the present disclosure can be applied to the processor 800 or implemented by the processor 800.
[0180] The processor 800 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 800 or the instructions in the form of software. The above-mentioned processor 800 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPTA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute each method, step, and logic block diagram disclosed in the embodiments of the present disclosure. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present disclosure can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 801, and the processor 800 reads the information in the memory 801 and combines its hardware to complete the steps of the above method.
[0181] The computer device provided by the embodiments of the present disclosure and the topology method of the hybrid grid provided by the embodiments of the present disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, run, or implemented by them.
[0182] The present disclosure also provides a computer-readable storage medium corresponding to the topology method of the hybrid grid provided in the foregoing embodiment. The computer-readable storage medium is an optical disc, on which a computer program (i.e., a computer program product) is stored. When the computer program is run by a processor, it will execute the topology method of the hybrid grid provided in any of the foregoing embodiments.
[0183] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other optical or magnetic storage media, which will not be elaborated here one by one.
[0184] The computer-readable storage medium provided by the above embodiments of the present disclosure and the topology method of the hybrid grid provided by the embodiments of the present disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, run, or implemented by the application programs stored in it.
[0185] Embodiments of the present disclosure also provide a computer program product. Please refer to Figure 7 , the computer program product 600 carries program code, that is, computer program 601. The instructions included in the computer program 601 can be used to execute the steps of the topology method of the hybrid grid described in the above method embodiments. For details, please refer to the above method embodiments and will not be elaborated here.
[0186] Among them, the above computer program product can be specifically implemented in a way of hardware, software or a combination thereof. In an optional embodiment, the computer program product is specifically embodied as a computer storage medium. In another optional embodiment, the computer program product is specifically embodied as a software product, such as a Software Development Kit (SDK), etc.
[0187] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are only examples and not limitations. It cannot be considered that these advantages, benefits, effects, etc. are essential for each embodiment of the present disclosure. In addition, the above disclosed specific details are only for the purposes of illustration and easy understanding, rather than limitations. The above details do not limit the present disclosure to necessarily adopt the above specific details for implementation.
[0188] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present disclosure are only illustrative examples and do not intend to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open-ended words, meaning "including but not limited to", and can be used interchangeably with each other. The words "or" and "and" used here refer to "and / or", and can be used interchangeably with each other unless the context clearly indicates otherwise. The word "such as" used here refers to the phrase "such as but not limited to", and can be used interchangeably with each other.
[0189] In addition, as used herein, the "or" used in the enumeration of items starting with "at least one" indicates a separate enumeration. For example, the enumeration of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (that is, A and B and C). In addition, the term "exemplary" does not mean that the described examples are preferred or better than other examples.
[0190] It should also be noted that in the systems and methods of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of the present disclosure.
[0191] Various changes, substitutions, and alterations to the technology described herein can be made without departing from the teachings defined by the appended claims. Additionally, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and acts described above. Processes, machines, manufactures, compositions of events, means, methods, or acts that are currently existing or later to be developed and that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Accordingly, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or acts within their scope.
[0192] The foregoing description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the disclosure. Thus, the disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0193] The foregoing description has been presented for purposes of illustration and description. Additionally, this description is not intended to limit the embodiments of the disclosure to the forms disclosed herein. Although numerous example aspects and embodiments have been discussed above, those skilled in the art will recognize some of their variations, modifications, alterations, additions, and subcombinations.
Claims
1. A topological method for a hybrid grid, characterized in that Including: Dividing the data points included in the nodes in the grid file according to the number of processes for generating grid cells, to obtain the data points that each process needs for topology, where the attributes of the data points are the grid type to which the grid cell belongs and / or the vertices constituting the grid cell; Obtaining the latest N data points in terms of topology order from the data points that the i-th process needs for topology; The N is determined based on the number of vertices corresponding to the target grid type, where the target grid type is the grid type to which the grid cell composed of the largest number of vertices in the nodes belongs, and the i-th process is any one of the processes; Obtaining the target data points whose attributes include the grid type from the N data points; Determining the topology starting point of the (i + 1)-th process based on the target data points and the data points that the (i + 1)-th process needs for topology, and performing grid topology on the N data points and the data points that the (i + 1)-th process needs for topology based on the topology starting point; the topology starting point includes the target data points in the N data points where grid cells cannot be generated and / or the first data point among the data points that the (i + 1)-th process needs for topology; Determining the topology starting point of the (i + 1)-th process based on the target data points and the data points that the (i + 1)-th process needs for topology includes: Obtaining the number of remaining data points whose topology order is later than that of the current target data point based on the topology order of the current target data point in the N data points; and, obtaining the number of vertices corresponding to the current target data point based on the grid type indicated by the current target data point, where the current target data point is any one of the target data points; and, obtaining the attribute of the first data point among the data points that the (i + 1)-th process needs for topology based on the data points that the (i + 1)-th process needs for topology; In the case where the number of the remaining data points is less than the number of vertices corresponding to the current target data point, determining the current target data point as the topology starting point; In the case where the attribute of the first data point includes the grid type, determining the first data point as the topology starting point; Performing grid topology on the N data points and the data points that the (i + 1)-th process needs for topology based on the topology starting point includes: Inserting the N data points in front of the first data point of the (i + 1)-th process to obtain the data points to be topologized of the (i + 1)-th process; Calculating the theoretical topology order of the target data points to be topologized based on the target topology starting point, where the target topology starting point is any one of the topology starting points, and the target data points to be topologized are the data points to be topologized whose attributes are characterized as the grid type; In the case where the attributes of the data points to be topologized at the theoretical topology order are all the grid type, obtaining the topology structure generated based on the target topology starting point; in the case where there are data points to be topologized at the theoretical topology order whose attributes are not the grid type, deleting the target topology starting point from the topology starting points; Select a new target topology starting point from the remaining topology starting points, and repeat the step of calculating the theoretical topology order of the target data points to be topologized based on the target topology starting point until there are no remaining topology starting points.
2. The topological method of the hybrid grid according to claim 1, wherein, After repeating the step of calculating the theoretical topology order of the target data points to be topologized based on the target topology starting point until there are no remaining topology starting points, it further includes: Obtain the number of topology structures generated by the (i + 1)-th process; When the number of topology structures generated by the (i + 1)-th process is equal to 1, use the topology structure as the final topology structure of the (i + 1)-th process; When the number of topology structures generated by the (i + 1)-th process is greater than 1, based on the topology structure generated by the i-th process and / or the topology structure generated by the (i + 2)-th process, determine the final topology structure of the (i + 1)-th process from the multiple topology structures generated by the (i + 1)-th process.
3. The topological method of the hybrid grid according to claim 1, characterized in that, After repeating the step of calculating the theoretical topology order of the target data points to be topologized based on the target topology starting point until there are no remaining topology starting points, it further includes: Update a pre-established topology quantity table based on the obtained number of topology structures generated by the (i + 1)-th process, where the topology quantity table is used to record the number of topology structures generated by the i-th process, the (i + 1)-th process, and the (i + 2)-th process; When the number of topology structures generated by the (i + 1)-th process recorded after the update of the topology quantity table is greater than 1, update the number of topology structures generated by the (i + 1)-th process recorded in the topology quantity table based on the obtained number of topology structures generated by the i-th process and the (i + 2)-th process; When the number of topology structures generated by the (i + 1)-th process recorded after the update of the topology quantity table is equal to 1, update the number of topology structures generated by the i-th process and the (i + 2)-th process to 1.
4. The topological method of the hybrid grid according to claim 2, characterized in that, Based on the topology structure generated by the i-th process and / or the topology structure generated by the (i + 2)-th process, determining the final topology structure of the (i + 1)-th process from the multiple topology structures generated by the (i + 1)-th process includes: When the number of topology structures generated by the i-th process is equal to 1, obtain the correct topology starting point of the (i + 1)-th process based on the end point of the topology structure generated by the i-th process, and determine the topology structure with the target topology starting point being the same as the correct topology starting point as the final topology structure of the (i + 1)-th process; When the number of topology structures generated by the i-th process is greater than 1, based on the endpoints of the multiple topology structures generated by the i-th process, obtain the possible topology starting points of the (i + 1)-th process, and based on the topology starting points of the topology structures generated by the (i + 2)-th process, obtain the possible topology endpoints of the (i + 1)-th process; based on the possible topology starting points and possible topology endpoints of the (i + 1)-th process, from the multiple topology structures generated by the (i + 1)-th process, determine the target topology structure, where the target topology structure uses the possible topology starting point as the topology starting point and the possible topology endpoint as the topology endpoint; when the number of the target topology structures is equal to 1, determine the target topology structure as the final topology structure of the (i + 1)-th process, and when the number of the target topology structures is greater than 1, wait for the number of topology structures generated by the i-th process to be updated to 1, and execute the operation when the number of topology structures generated by the i-th process is equal to 1.
5. A topological device with a hybrid grid, characterized in that, Including: A partitioning module, configured to partition the data points included in the nodes in the grid file based on the number of processes for generating grid cells, to obtain the data points that each process needs to perform topology on, where the attributes of the data points are the grid types to which the grid cells belong and / or the vertices constituting the grid cells; A first obtaining module, configured to obtain the N data points with the latest topology order from the data points that the i-th process needs to perform topology on; The N is determined based on the number of vertices corresponding to the target grid type, where the target grid type is the grid type to which the grid cells composed of the largest number of vertices in the nodes belong, and the i-th process is any one of the processes; A second obtaining module, configured to obtain the target data points whose attributes include the grid type from the N data points; A topology module, configured to determine the topology starting point of the (i + 1)-th process based on the target data points and the data points that the (i + 1)-th process needs to perform topology on, and based on the topology starting point, perform grid topology on the N data points and the data points that the (i + 1)-th process needs to perform topology on; the topology starting point includes the target data points in the N data points where grid cells cannot be generated and / or the first data point among the data points that the (i + 1)-th process needs to perform topology on; Determining the topology starting point of the (i + 1)-th process based on the target data points and the data points that the (i + 1)-th process needs to perform topology on includes: Based on the topology order of the current target data point in the N data points, obtain the number of the remaining data points whose topology order is later than that of the current target data point; and based on the grid type indicated by the current target data point, obtain the number of vertices corresponding to the current target data point, where the current target data point is any one of the target data points; and based on the data points that the (i + 1)-th process needs to perform topology on, obtain the attributes of the first data point among the data points that the (i + 1)-th process needs to perform topology on. In the case where the number of the remaining data points is less than the number of vertices corresponding to the current target data point, determine the current target data point as the topological starting point; In the case where the attribute of the first data point includes the mesh type, determine the first data point as the topological starting point; Based on the topological starting point, perform mesh topology on the N data points and the data points that the (i + 1)-th process needs to topology, including: Insert the N data points in front of the first data point of the (i + 1)-th process to obtain the data points to be topologized of the (i + 1)-th process; Based on the target topological starting point, calculate the theoretical topological order of the target data points to be topologized, where the target topological starting point is any one of the topological starting points, and the target data points to be topologized are the data points to be topologized whose attributes are characterized as the mesh type; In the case where the attributes of the data points to be topologized in the theoretical topological order are all of the mesh type, obtain the topological structure generated based on the target topological starting point; in the case where there are data points with attributes not of the mesh type among the data points to be topologized in the theoretical topological order, delete the target topological starting point from the topological starting points; Select a new target topological starting point from the remaining topological starting points, and repeat the step of calculating the theoretical topological order of the target data points to be topologized based on the target topological starting point until there are no remaining topological starting points.
6. A computer device, comprising a memory, a processor, and a computer program stored on the memory, characterized in that, The processor executes the computer program to implement the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 4.
8. A computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Grid parallel reading method and device, terminal equipment and readable storage medium
CN116820772A
Spatial topological relation verification method and device, electronic equipment and storage medium
CN117786163A