Hybrid grid topology method and device, equipment, storage medium and product
By dividing the data points in the CGNS grid file into multiple processes in parallel, the problem of inefficient topology speed and reading efficiency under traditional single-process serial processing method is solved, and more efficient grid topology and computing resource utilization is achieved .
Patent Information
- Application Number
- CN202411328026.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-09-23
AI Technical Summary
When facing large-scale CGNS grid files, the traditional single-process serial processing method leads to insufficiency of topological speed and read efficiency, which cannot meet the efficient simulation needs of aircraft engines and other fields.
By dividing the data points under the node to multiple processes, the data points are grid topologically topified by using parallel processing methods. The specific steps include dividing data points based on the number of processes, determining the topology start point of each process, and performing a grid topology based on the target data point and the data point of the next process.
It improves topological efficiency and processing speed, makes full use of the multi-core processing capabilities of modern computers, improves the utilization rate of computing resources, and avoids the missed grid cell caused by data point loss.
Smart Images

Figure CN119440802A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of computational fluid dynamics, and in particular to a topological method, device, equipment, storage medium and product of a hybrid grid. Background Art
[0002] In the field of engineering simulation, the generated CGNS (CFD General Notation System) grid files usually include multiple nodes, each of which contains millions or even hundreds of millions of data points. The scale of the grid units formed by the topology of the data points is usually large. As the requirements for simulation accuracy increase, the scale of the grid units continues to expand, which places extremely high requirements on the topological speed and reading efficiency of the grid units.
[0003] In traditional numerical simulations, the topology of data points in CGNS grid files is usually processed serially using a single process, which can result in significant time consumption when faced with large-scale data points. This is especially true in the field of aero-engines, where the scale of the grid cells is large and multiple different types of grid cells are mixed under the same node. For such mixed grids, the single-process topology method can no longer meet the needs of efficient simulation. Summary of the invention
[0004] The present disclosure is proposed in view of the above problems, and provides a topology method, device, equipment, storage medium and product of a hybrid grid.
[0005] According to one aspect of the present disclosure, a topology method for a hybrid grid is provided, comprising:
[0006] Based on the number of processes used to generate the grid unit, data points included in the nodes in the grid file are divided to obtain data points of topology required for each process, wherein the attributes of the data points are the grid type to which the grid unit belongs and / or the vertices constituting the grid unit;
[0007] From the data points of topology required by the i-th process, obtain the N data points with the latest topological order; the N is determined based on the number of vertices corresponding to the target mesh type, the target mesh type is the mesh type to which the mesh unit composed of the largest number of vertices in the node belongs, and the i-th process is any one of the processes;
[0008] Acquire a target data point whose attributes include the grid type from the N data points;
[0009] Based on the target data point and the data point that the i+1th process requires topology, determine the topology starting point of the i+1th process, and based on the topology starting point, perform grid topology on the N data points and the data point that the i+1th process requires topology; the topology starting point includes the target data point that failed to generate a grid unit among the N data points and / or the first data point among the data points that the i+1th process requires topology.
[0010] In addition, the hybrid grid topology method according to one aspect of the present disclosure further includes:
[0011] Based on the target data point and the topological data point required by the (i+1)th process, determining the topological starting point of the (i+1)th process includes:
[0012] Based on the topological order of the current target data point among the N data points, the number of remaining data points whose topological order is later than the current target data point is obtained; and, based on the mesh type indicated by the current target data point, the number of vertices corresponding to the current target data point is obtained, and the current target data point is any one of the target data points; and, based on the data point that the i+1th process needs topology, the attributes of the first data point among the data points that the i+1th process needs topology are obtained;
[0013] In a 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 topological starting point;
[0014] In a case where the attribute of the first data point includes the grid type, the first data point is determined to be the topology starting point.
[0015] In addition, the hybrid grid topology method according to one aspect of the present disclosure further includes:
[0016] Based on the topology starting point, mesh topology is performed on the N data points and the data points that the (i+1)th process needs topology, including:
[0017] Insert the N data points in front of the first data point of the i+1th process to obtain the pending topological data points of the i+1th process;
[0018] Based on the target topology starting point, calculating the theoretical topological order of the target to-be-topological data point, the target topology starting point is any one of the topology starting points, and the target to-be-topological data point is a to-be-topological data point characterized by a grid type of attribute;
[0019] In the case where the attributes of the to-be-topological data points located in the theoretical topological order are all of the grid type, a topological structure generated based on the target topological starting point is obtained; in the case where there are to-be-topological data points located in the theoretical topological order whose attributes are not of the grid type, the target topological starting point is deleted from the topological starting points;
[0020] A new target topology starting point is selected from the remaining topology starting points, and the step of calculating the theoretical topological order of the target topology data points based on the target topology starting point is repeated until there are no remaining topology starting points.
[0021] In addition, the hybrid grid topology method according to one aspect of the present disclosure further includes:
[0022] After repeatedly executing the step of calculating the theoretical topological order of the target topological data points based on the target topological starting point until there are no remaining topological starting points, the method further includes:
[0023] Obtain the number of topological structures generated by the i+1th process;
[0024] When the number of topological structures generated by the (i+1)th process is equal to 1, the topological structure is used as the final topological structure of the (i+1)th process;
[0025] When the number of topological structures generated by the i+1th process is greater than 1, based on the topological structure generated by the i+1th process and / or the topological structure generated by the i+2th process, the final topological structure of the i+1th process is determined from the multiple topological structures generated by the i+1th process.
[0026] In addition, the hybrid grid topology method according to one aspect of the present disclosure further includes:
[0027] After repeatedly executing the step of calculating the theoretical topological order of the target topological data points based on the target topological starting point until there are no remaining topological starting points, the method further includes:
[0028] Based on the obtained number of topological structures generated by the i+1th process, a pre-established topological quantity table is updated, where the topological quantity table is used to record the number of topological structures generated by the i-th process, the i+1th process, and the i+2th process;
[0029] When the number of topological structures generated by the i+1th process recorded in the topological quantity table after the topological quantity table is updated is greater than 1, based on the obtained numbers of topological structures generated by the i+1th process and the i+2th process, the number of topological structures generated by the i+1th process recorded in the topological quantity table is updated;
[0030] When the number of topological structures generated by the (i+1)th process recorded after the topological quantity table is updated is equal to 1, the number of topological structures generated by the (i+1)th process and the (i+2)th process is updated to 1.
[0031] In addition, the hybrid grid topology method according to one aspect of the present disclosure further includes:
[0032] Determining a final topology structure of the i+1th process from a plurality of topology structures generated by the i+1th process based on the topology structure generated by the i-th process and / or the topology structure generated by the i+2th process comprises:
[0033] When the number of topological structures generated by the i-th process is equal to 1, based on the end point of the topological structure generated by the i-th process, the correct topological starting point of the i+1-th process is obtained, and the topological structure whose target topological starting point is consistent with the correct topological starting point is determined as the final topological structure of the i+1-th process;
[0034] In the case that the number of topological structures generated by the i-th process is greater than 1, based on the end points of the multiple topological structures generated by the i-th process, a possible topological starting point of the i+1-th process is obtained, and based on the topological starting point of the topological structure generated by the i+2-th process, a possible topological end point of the i+1-th process is obtained; based on the possible topological starting point and the possible topological end point of the i+1-th process, a target topological structure is determined from the multiple topological structures generated by the i+1-th process, and 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; in the case that the number of target topological structures is equal to 1, the target topological structure is determined to be the final topological structure of the i+1-th process, and in the case that 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 operations when the number of topological structures generated by the i-th process is equal to 1.
[0035] According to another aspect of the present disclosure, a topology device of a hybrid grid is provided, comprising:
[0036] A partitioning module, used to partition the data points included in the nodes in the grid file based on the number of processes used to generate the grid unit, and obtain the data points required for the topology of each process, wherein the attributes of the data points are the grid type to which the grid unit belongs and / or the vertices constituting the grid unit;
[0037] A first acquisition module is used to acquire N data points with the latest topological order from the data points that the i-th process needs topology; the N is determined based on the number of vertices corresponding to the target mesh type, the target mesh type is the mesh type to which the mesh unit composed of the largest number of vertices in the node belongs, and the i-th process is any one of the processes;
[0038] A second acquisition module, used for acquiring a target data point whose attributes include the grid type from the N data points;
[0039] A topology module is used to determine a topology starting point of the i+1th process based on the target data point and the data point that the i+1th process needs topology, and based on the topology starting point, perform grid topology on the N data points and the data point that the i+1th process needs topology; the topology starting point includes the target data point that fails to generate a grid unit among the N data points and / or the first data point among the data points that the i+1th process needs topology.
[0040] According to another aspect of the present disclosure, a computer device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method of the above aspect.
[0041] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. 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, a computer program product is provided, 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, according to a hybrid grid topology method, apparatus, device, storage medium and product of an embodiment of the present disclosure, by dividing the data points under the node into multiple processes, multiple processes are processed in parallel, and the data points are grid topologically processed, which not only improves the topological efficiency and processing speed, but also can make full use of the multi-core processing capabilities of modern computers, assign data point topological tasks to different processes for processing, and improve the utilization rate of computing resources; on the other hand, in order to avoid the situation where the data points constituting the same grid unit are divided into two processes, the topological starting point of the i+1th process is determined by the target data point and the data point assigned to the i+1th process that requires topology, which can ensure that the topological starting point is determined for the i+1th process, avoiding the loss of data points and the omission of grid units requiring topology 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 technology as claimed. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the accompanying 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 mesh according to an embodiment of the present disclosure.
[0047] Figure 2 is another flow chart illustrating a topological method for applying a hybrid mesh according to an embodiment of the present disclosure.
[0048] Figure 3 is a table illustrating the number of possible topologies for applying processes 0 - 2 according to an embodiment of the present disclosure.
[0049] Figure 4 is a table illustrating the number of possible topologies for applying processes 3 - 5 according to an embodiment of the present disclosure.
[0050] Figure 5 It is a schematic diagram illustrating the structure of a topology device of a hybrid grid according to an embodiment of the present disclosure.
[0051] Figure 6 It is a schematic diagram illustrating the structure of a computer device according to an embodiment of the present disclosure.
[0052] Figure 7 is a schematic diagram illustrating a computer program product according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present disclosure more obvious, the exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.
[0054] In the field of engineering simulation, the generated CGNS (CFD General Notation System) grid files usually include multiple nodes, each of which contains millions or even hundreds of millions of data points. The scale of the grid units formed by the topology of the data points is usually large. As the requirements for simulation accuracy increase, the scale of the grid units continues to expand, which places extremely high requirements on the topological speed and reading efficiency of the grid units.
[0055] In traditional numerical simulations, the topology of data points in CGNS grid files is usually processed serially using a single process, which can result in significant time consumption when faced with large-scale data points. This is especially true in the field of aero-engines, where the scale of the grid cells is large and multiple different types of grid cells are mixed under the same node. For such mixed grids, the single-process topology method can no longer meet the needs of efficient simulation.
[0056] In the above, a hybrid grid topology method, apparatus, device, storage medium and product according to an embodiment of the present disclosure are described with reference to the accompanying drawings. By dividing the data points under the nodes into multiple processes, and processing the multiple processes in parallel, the data points are grid topologically processed, which not only improves the topological efficiency and processing speed, but also can make full use of the multi-core processing capabilities of modern computers, assign data point topology tasks to different processes for processing, and improve the utilization rate of computing resources.
[0057] In addition, in order to avoid the situation where the data points constituting the same grid unit are divided into adjacent processes, the topological starting point of the i+1th process is determined by the target data points and the data points required for the topology assigned to the i+1th process. This ensures that the topological starting point is determined for the i+1th process, avoiding the loss of data points that may lead to the inability to correctly complete the grid unit 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, receiving and sending the topology structure and quantity of adjacent processes, the unique and correct topology structure of the i+1th process can be determined, which is beneficial to improving the accuracy of the topology.
[0059] To facilitate understanding of this embodiment, a hybrid grid topology method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the hybrid grid topology method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal DiTital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the hybrid grid topology method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0060] like Figure 1 As shown, it is a flowchart of a topological method of a hybrid grid provided by an embodiment of the present disclosure, and the method includes S101-S104:
[0061] S101: Based on the number of processes used to generate grid units, data points included in the nodes in the grid file are divided to obtain data points required for topology of each process.
[0062] The mesh file is a CGNS mesh file generated during engineering simulation. The mesh file includes multiple nodes, and each node includes multiple data points arranged in number (ie, topological order).
[0063] The attributes of a data point are the mesh type to which the mesh unit belongs and / or the vertices that constitute the mesh unit. Specifically, a supported mesh type code table is constructed in advance based on all supported mesh types and their codes provided by the CGNS mesh file. For example, the mesh type represented by code 10 is a tetrahedral mesh, which must be composed of 4 vertices, the mesh type represented by 14 is a hexahedral mesh, which must be composed of 6 vertices, and the mesh type represented by 15 is an octahedral mesh, which must be composed of 8 vertices. Assuming that the value of a data point is 8 (a code that does not exist in the mesh type code table), it means that the attribute of this data point is a vertex. In the subsequent topology process, this data point is only used as a vertex that constitutes a mesh unit; assuming that the value of this data point is 10, it means that the attribute of this data point may be a mesh type (tetrahedral mesh) or a vertex. In the subsequent topology process, this data point may be the starting point of a mesh unit, and its true attribute can be verified in the subsequent topology process.
[0064] Specifically, the process is used to generate grid units for grid topology of data points, and the data points included in the node are divided into each process. Assuming that the node includes 160 data points and the number of processes is 4, 40 data points requiring topology are evenly distributed to processes 0-3. In this embodiment, the data points requiring topology of each process are preferably numbered consecutively, and the numbers of data points of adjacent processes are connected end to end.
[0065] Assume that process 0 needs the following topological data points (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 mesh type, i.e., tetrahedral mesh, "10" must be the topological starting point of process 0. The "1, 2, 3, 4" after "10" are the vertices that make up the tetrahedral mesh. "10, 1, 2, 3, 4" is a mesh unit generated by topology, and "14" is the starting point of the next mesh unit.
[0066] S102: Obtain the latest N data points in topological order from the data points that the i-th process needs topology.
[0067] Among them, the i-th process is any process, N is determined based on the number of vertices corresponding to the target mesh type, the target mesh type is the mesh type to which the mesh unit consisting of the largest number of vertices in the node belongs, assuming that the target mesh type under the node of this embodiment is an octahedral mesh represented by code 15, since the topological generation of the octahedral mesh unit requires a total of 9 data points, N=9, which can ensure that there is at least one data point with the attribute of mesh type among the N data points. Assuming that the i-th process is process 1, the last 9 data points of process 1 are obtained, and the 9 data points are stored separately for determining the topological starting point of process 2 in subsequent steps.
[0068] S103: Acquire a target data point whose attributes include a grid type from the N data points.
[0069] Specifically, the values of N data points are obtained. If the value of a data point is a code in the grid type code table, the attribute of this data point is confirmed to include the grid type. For example, if the value of a data point is 14, the attribute of this data point may be the grid type or the vertex constituting the grid unit. It cannot be determined at present. In this case, this data point is considered to be the target data point. The real attribute of the target data point can be verified in the subsequent grid topology process.
[0070] S104: Based on the target data points and the data points that the i+1th process needs topology, determine the topology starting point of the i+1th process, and based on the topology starting point, perform mesh topology on the N data points and the data points that the i+1th process needs topology.
[0071] The topology starting point includes the target data point that fails to generate a grid unit among the N data points and / or the first data point among the data points that the i+1th process needs topology. 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 the current target data point; and, based on the mesh 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 point that the i+1th process needs topology, obtain the attributes of the first data point among the data points that the i+1th process needs topology.
[0073] Wherein, the current target data point is any target data point. Assuming that N data points are 9 data points, in topological order, the values are: 14, 8, 9, 10, 11, 12, 13, 10, 14, respectively. Then the target data points are the 1st (14), 4th (10), 8th (10), and 9th data points (14). Example 1: The current target data point is the 1st data point (14), the number of remaining data points that are later than the current target data point in topological order is 8, and the number of vertices corresponding to the current target data point is 6. Example 2: The current target data point is the 8th data point (10), the number of remaining data points that are later than the current target data point in topological order is 1, and the number of vertices corresponding to the current target data point is 4.
[0074] Step 12: When the number of 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; when the attribute of the first data point includes a mesh type, determine the first data point as the topological starting point.
[0075] Specifically, the first data point (14) and the fourth data point (10) cannot be used as the topology starting point. Taking the first data point (14) as an example, assuming that the attribute of the first data point (14) is the grid type, then the grid unit formed with the first data point (14) as the starting point must have been generated in process i. In order to avoid the process i+1 from repeatedly generating the same grid unit, the first data point (14) cannot be used as the topology starting point. Among the above 9 data points, the 8th data point (10) and the 9th data point (14) are the topology starting points of the i+1th 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 the to-be-topological data points 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 of the to-be-topological data points in the theoretical topological order that are not of the grid type, delete the target topological starting point from the topological starting point.
[0083] Specifically, assuming that the 8th data point (10) is the true topological starting point of the i+1th process, then in theory, the attribute of the to-be-topological data point with the topological order of the 6th (i.e., the theoretical topological order) should be a grid type, that is, the value of the to-be-topological data point with the topological order of the 6th should exist in the grid type code table. If in the i+1th process, the values of each to-be-topological data point of the theoretical topological order exist in the grid type code table, it means that the i+1th process can generate a complete topological structure with the 8th data point (10) as the topological starting point, and the topological structure is saved. If the value of at least one to-be-topological data point of the theoretical topological order does not exist in the grid type code table, it means that the 8th data point (10) is not the true topological starting point of the i+1th process, and a complete topological structure cannot be generated, and this target topological starting point is deleted from the topological starting point.
[0084] Step 16: Select a new target topology starting point from the remaining topology starting points, and repeat step 14 until there are no remaining topology 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+1th process. If in the i+1th process, the values of the to-be-topological data points of each theoretical topological order are present in the grid type code table, after the topological structure is saved, a new target topological starting point is selected from the remaining topological starting points, for example, the new target topological starting point is the 9th data point (14), and then step 14 is repeated. If the 8th data point (10) is not the true topological starting point of the i+1th process, the 8th data point (10) is deleted from the topological starting points, and then a new target topological starting point is selected from the remaining topological starting points, for example, the new target topological starting point is the 9th data point (14), and step 14 is repeated.
[0086] Step 17: Get the number of topological structures generated by the i+1th process;
[0087] When the number of topological structures generated by the i+1th process is equal to 1, the topological structure is used as the final topological structure of the i+1th process. For example, only when the 9th data point (14) is used as the target topological starting point can a complete topological structure be generated, then the 9th data point (14) is the real topological starting point of the i+1th process, and the topological structure is also the only correct final topological structure generated by the i+1th process.
[0088] In the case where the number of topological structures generated by the i+1th process is greater than 1, the final topological structure of the i+1th process is determined from the multiple topological structures generated by the i+1th process based on the topological structure generated by the i+1th process and / or the topological structure generated by the i+2th process. For example, a complete topological structure can be generated with the 9th data point (14) and the first data point of the i+1th process as the target topological starting point, 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+1th process, only one data point is the true topological starting point of the i+1th process. In this case, the final topological structure of the i+1th process needs to be determined through the topological structure generated by the i+1th process and / or the i+2th process. Specifically, this embodiment is explained in the following two situations:
[0089] Case 1: When the number of topologies generated by the i-th process is equal to 1:
[0090] Based on the end point of the topology structure generated by the i-th process, the correct topology starting point of the i+1-th process is obtained, and the topology structure whose target topology starting point is consistent with the correct topology starting point is determined as the final topology structure of the i+1-th process.
[0091] Specifically, the number of topological structures generated by the i-th process is equal to 1, indicating 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, the number of the last data point of the topological structure generated by the i-th process is obtained. Assuming that the number is 38, it means that the data point numbered 39 is the correct topological starting point of the i+1th process, and the topological structure generated with the target topological starting point numbered 39 is the final topological structure of the i+1th process.
[0092] Case 2: When the number of topological structures generated by the i-th process is greater than 1, the following steps are included:
[0093] 1) Based on the end points of multiple topological structures generated by the i-th process, a possible topological starting point of the i+1-th process is obtained, and based on the topological starting point of the topological structure generated by the i+2-th process, a possible topological end point of the i+1-th process is obtained.
[0094] Specifically, assuming that the i-th process generates 2 topological structures, and the i-th process has not yet determined the unique final topological structure, the i-th process has 2 end points. Assuming that the i+2-th process generates 1 topological structure, that is, the correct topological starting point of the i+2-th process is determined, the possible topological end point of the i+1-th process can be determined based on the correct topological starting point of the i+2-th process. It should be noted here in the embodiment of the present disclosure that when 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 overlap. In this case of overlap, 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 the possible topological end point of the (i+1)th process, a target topological structure is determined from the multiple topological structures generated by the (i+1)th process.
[0096] Specifically, the target topology structure takes the possible topology starting point as the topology starting point and the possible topology ending point as the topology ending point. Assuming that the possible topology starting points of the i+1th process are A and B, and the possible topology ending point is C, if there is a topology structure with A as the topology starting point and C as the topology ending point among the multiple topologies generated by the i+1th process, then this topology structure is the target topology structure; if there is a topology structure with B as the topology starting point and C as the topology ending point among the multiple topologies generated by the i+1th process, then this topology structure is also the target topology structure.
[0097] 3) When the number of target topological structures is equal to 1, the target topological structure is determined to be the final topological structure of the i+1th 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 operation of situation 1.
[0098] Specifically, if among the multiple topological structures generated by the i+1th process, there is only a topological structure with A as the topological starting point and C as the topological end point, then this target topological structure is the final topological structure of the i+1th process. If the number of target topological structures is greater than 1, it means that the final topological structure of the i+1th process cannot be determined at present, and it is necessary to wait for the final topological structure of the i-th process to be determined, and then determine the correct topological starting point of the i+1th process according to the final topological structure of the i-th process, and then determine the final topological structure of the i+1th process.
[0099] Preferably, in the embodiment of the present disclosure, a topology quantity table based on each process is pre-constructed, and the topology quantity table records the number of topological 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 topological structure of the i+1-th process. This embodiment will take the topology quantity table constructed by the i+1-th process (hereinafter referred to as the i+1-th topology quantity table) as an example for explanation, and specifically includes the following steps 18-19:
[0100] Step 18: Based on the obtained number of topological structures generated by the (i+1)th process, the pre-established (i+1)th topological quantity table is updated.
[0101] The first bit of the i+1th topology quantity table is used to record the number of topological structures generated by the i+1th process, the second bit is used to record the number of topological structures generated by the i+1th process, and the third bit is used to record the number of topological structures generated by the i+2th process. The initial data recorded in the i+1th topology quantity table is 0 or a null value. It should be noted that, when the i+1th process is the first process or the last process, taking the i+1th process as the last process as an example, the number of topological structures generated by the i+2th process recorded in the i+1th topology quantity table is "-1", that is, null.
[0102] After obtaining the number of topological structures generated by the i+1th process, assuming that the number of topological structures generated by the i+1th process is 1, the second bit recorded in the i+1th topological quantity table is updated to 1. Preferably, this embodiment receives the number of topological structures generated by the i+1th process sent by the topological quantity table mainly constructed with the i+1th process, and receives the number of topological structures generated by the i+2th process sent by the topological quantity table mainly constructed with the i+2th process, and updates the first and third bits recorded in the i+1th topological quantity table.
[0103] Step 19: Case 1: When the number of topological structures generated by the i+1th process recorded after the i+1th topological quantity table is updated is equal to 1, the number of topological structures generated by the i-th process and the i+2th process is updated to 1.
[0104] Specifically, the value of the second record in the i+1th topology quantity table is 1, indicating that the i+1th process has been able to determine the only final topology structure. After the i+1th topology quantity table sends the number of topology structures generated by the i+1th process to the topology quantity table built mainly by the i-th process, regardless of whether the i-th process can determine the final topology structure, the value of the first record in the i+1th topology quantity table can be updated to 1, indicating that the i+1th topology quantity table does not need to send quantity information to the topology quantity table built mainly by the i-th process. Similarly, after the i+1th topology quantity table sends the number of topology structures generated by the i+1th process to the topology quantity table built mainly by the i+2th process, the i+2th process can definitely determine the final topology structure based on the final topology structure of the i+1th process, so the value of the third record in the i+1th topology quantity table can be updated to 1, indicating that the i+1th topology quantity table does not need to send quantity information to the topology quantity table built mainly by the i+2th process.
[0105] Case 2: When the number of topological structures generated by the i+1th process recorded after the topological quantity table is updated is greater than 1, the number of topological structures generated by the i+1th process recorded in the topological quantity table is updated based on the obtained number of topological structures generated by the i-th process and the i+2th process.
[0106] Specifically, based on the obtained number of topological structures generated by the i-th process and the i+2-th process, the number of topological structures generated by the i+1-th process recorded in the topological quantity table is updated. The specific method described in the above scenario 2 can be referred to.
[0107] like Figure 2 As shown, it is another flow chart of the topology method of the hybrid grid provided by the embodiment of the present disclosure, and the method includes S201-S204:
[0108] S201: According to the number of data points of the nodes of the CGNS grid file, the upper and lower limits of the numbers of the data points that each process needs to read are calculated, and each process reads the data points between the upper and lower limits of the process.
[0109] Unlike reading a single grid type, the embodiment of the present disclosure does not consider the number of grid units and the possible grid types contained during reading. Instead, each process calculates the number of topological data points required for each process based on the number of data points and the principle of equal distribution, so as to maximize the consistency of the number processed by each process, and perform multi-process parallel processing to improve reading efficiency.
[0110] Specifically, S201 includes the following steps:
[0111] S2011: Open the CGNS grid file, scan the information of the data points of the current CGNS grid file, determine that the node includes two or more grid types (ie, mixed grids), and each process obtains the total number of data points included in the node.
[0112] S2012: According to the number of processes, the size of the communication domain of each process is set in MPI. According to the size of the communication domain, the number of data points that each process needs to read and the upper and lower limits of the numbers are calculated.
[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 (that is, 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 (that is, data points numbered 11-20).
[0114] S202: Based on the inter-process communication mechanism of MPI, the information of the last N data points of the previous process is sent 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 mesh type, the target mesh type is the mesh type to which the mesh unit consisting of the largest number of vertices in the node belongs, assuming that the target mesh type under the node of this embodiment is a hexahedral mesh represented by code 14, since the topology generation of the hexahedral mesh unit requires a total of 7 data points, 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. Assuming N=7, the 7 data points are saved separately, and a possible starting point Boolean array and a possible ending point Boolean array are created according to the number (length) of N data points. The length of the possible starting point Boolean array and the possible ending point Boolean array of this embodiment is 7+1=8, and the initial value of the default Boolean array is -1 (false). The possible starting point Boolean array represents the data points that may become the topological starting point of the current process among the 7 data points and the first data point of the current process, among which there must be a unique correct topological starting point; the possible ending point Boolean array represents the data points that may become the topological end point of the current process among the 7 data points and the first data point of the current process, among which there must be a unique correct topological end point.
[0117] S2022: Construct a supported mesh type code table based on all supported mesh types and their codes provided by the CGNS mesh file.
[0118] Specifically, the supported mesh types depend on the solver itself. This embodiment takes a tetrahedron represented by code 10 and a hexahedron represented by code 14 as examples.
[0119] S2023: Insert 7 data points in front of the first data point of the current process, determine whether the values of the 7 data points and the first data point of the current process exist in the grid type code table, and assume that the value of the third data point among the 7 data points is 10, then update the value of the position corresponding to the third data point in the possible starting point Boolean array to 1 (true).
[0120] S2024: randomly select a target data point from the data points whose values are 1 recorded in the Boolean array of possible starting points, and based on the topological order of the target data point among the 7 data points, obtain the number of remaining data points whose topological order is 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; when the number of remaining data points is less than the number of vertices corresponding to the target data point, determine that the target data point is 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 the grid unit can be completely generated in the previous process. In order to avoid repeated generation, the value of the position corresponding to the Boolean array of possible starting points is updated to -1. Similarly, all data points with a value of 1 recorded in the Boolean array of possible starting points are screened to determine the final possible topological starting point.
[0122] S203: Starting to perform mesh topology on the data points of the current process based on each topology starting point in turn.
[0123] Specifically, in the process of mesh topology, illegal data points are screened out. The screening logic is as follows: in the process of mesh topology, if a data point whose attribute should be a mesh type appears and whose value does not exist in the mesh type code table, then this data point is illegal, and the current topology starting point is not the correct topology starting point of the current process. The current topology starting point is directly skipped, and the mesh topology of the current process is started based on the next topology starting point. This step is repeated until all topology starting points are traversed. This ensures that even if the topology starting point is inaccurate, the current process can still find the correct topology starting point through multiple attempts, which greatly shortens the time to confirm the final topology structure.
[0124] Specifically, S203 includes the following steps:
[0125] S2031: Loop through all topology starting points to generate a mesh topology.
[0126] If an illegal data point appears, the current topology starting point is considered to be wrong and skipped directly. If the grid topology can be topologically extended to the last data point of the current process, the topology structure is temporarily saved.
[0127] S2032: Create a table of possible topology quantities.
[0128] The possible topology quantity table maintains the virtual state of the current process and the adjacent processes. The length of the quantity 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 the communication between processes. First, the number of topological structures generated by adjacent processes (or their virtual states) is recorded in the possible topological number table. In order to reduce communication as much as possible and avoid wasting resources, the current process can directly mark the number of adjacent processes in the possible topological number table as 1 (virtual state) after sending a unique topological structure to the adjacent process. The reason for this is: if the current process sends a unique topological structure to its adjacent process, regardless of whether the adjacent process can find the final topological structure, it does not need to continue to receive the data of the current process (because the data of the current process will no longer be updated, and it is meaningless to send it repeatedly).
[0130] S2033: After the current process generates each topology structure, the second position of the possible topology quantity table is updated.
[0131] S2034: If the current process generates a 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 based on the topological structures of adjacent processes.
[0132] S204: Through a specific communication logic, known information between processes is communicated to adjacent processes, and the final topology structure of each process is found on the basis of satisfying the minimum number of communications and the minimum communication volume.
[0133] When all processes have generated the topology, the number of topologies generated by each process determines whether inter-process communication is needed to determine which process generated the final topology. If a process does have multiple possible topologies, the process will communicate further to ensure that the correct topology is finally selected.
[0134] Specifically, S204 includes the following steps:
[0135] S2041: Communicate the possible topological starting point of each process to the previous process, and communicate the possible topological end point to the next process.
[0136] The purpose of this communication is to obtain the topological starting point of the subsequent process or the topological end point of the previous process, and also to determine 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 topology start point and topology end point of the adjacent process. The first position is updated for the previous process and the third position is updated for the next process. If the current process has no previous or next process, the default is -1 (empty).
[0138] S2043: Calculate whether the current process can determine the final topology structure based on the data in the possible topology quantity table.
[0139] According to the information received in S2042 or S2046 (the topological starting point and the topological end point of the adjacent process), the communication information is cross-compared with the topological structure of the current process. The next data point of the topological end point of the previous process may be the topological starting point of the current process, and the topological starting point of the next process may be the topological end 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 next process according to the possible topology quantity table.
[0141] S2045: Determine whether the processes need to continue communicating.
[0142] If the number of topological structures of the current process is 1, there is no need to receive information from the adjacent process. If the number of topological structures of the adjacent process is 1, the current process does not need to send information to the adjacent process. If the number of topological structures of the previous process is not 1 (the first bit in the possible topological number table is not 1) or the number of topological structures of the next process is not 1 (the third bit in the possible topological number table is not 1), the current process needs to send a Boolean array of possible starting points to the previous process and a Boolean array of possible ending points to the next process.
[0143] S2046: When the current process meets the sending or receiving conditions, it first receives the information sent by the previous process, and then receives the information sent by the next process.
[0144] If the current process meets the requirements for receiving data, it will continue to obtain the topological end point of the previous process and the topological starting point of the next process. In each communication cycle, 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, so that 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 topological quantity table is updated synchronously.
[0145] In order to further reduce the number of communications, the communication after sending the final topology structure can be specially handled: if the current process sends the topology starting point and topology end point corresponding to the final topology structure to its adjacent process, no matter whether the adjacent process can find the final topology structure, it does not need to continue to receive the information of the current process. If the adjacent process can find the only final topology structure (or reduce the number of topology structures) through the final topology structure sent by the current process, since the information sent by the current process will not continue to be updated, the information sent will not be any different in the next communication cycle. The communication again will not help the adjacent process find the final topology structure except increasing the communication pressure. On the contrary, if the previous process still cannot find the final topology structure (or cannot reduce the number of topology structures) after the current process sends the topology starting point and topology end point corresponding to the final topology structure, then in the next communication cycle, the current process will not help at all if it sends the same information.
[0146] Specifically, Figure 3 As shown, this is a table of possible topologies of process 0-2, where the number of topological structures included in process 0 is 1, that is, a unique topological structure (final topological structure) is found, the number of topological structures included in process 1 and process 2 is 2, and the adjacent processes of process 0-2 are recorded as -1 (empty).
[0147] According to S2041, the first communication is performed, and each process communicates the topological starting point and the topological end point to the previous and next processes. According to S2042, the three possible topological quantity tables are updated (from -1 to 2). According to S2043, since the quantity of process 0 is 1, process 1 can find the correct topological starting point according to the topological end point of process 0, and then change the second bit of the quantity table of process 1 to 1. In the quantity table of process 0, because a unique topological structure is sent to process 1, it means that the quantity of process 0 will not continue to be updated, so there is no need to send information to process 1, and change the third bit of the quantity table of process 0 to 1 (marked as a virtual state). After receiving the information from process 0, process 1 successfully finds the final topological structure and changes the second bit of the quantity table of process 1 to 1.
[0148] In process 2, the number of topological structures cannot be reduced after calculation, and a circular 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 1s that communicated this time is 1. According to S2046, the number of process 1 recorded in process 2 is updated to 1. After process 1 sends the only topological structure 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 a virtual state). According to S2043, it is found that the correct topological starting point of process 2 can be calculated based on the information of process 1. At this time, all processes have found the final topological structure and no longer need to communicate, so they can exit the loop.
[0149] like Figure 4 As shown, this is a table of possible topological quantities of processes 3-5, wherein the number of topological structures included in processes 3-5 is 2, the adjacent processes of processes 3-5 are recorded as -1 (empty), and it is assumed that process 5 is the last process.
[0150] According to S2041-S2042, the first communication is performed to update the possible topology quantity table of processes 3-5. Among them, according to S2043, assuming that the final topology structure of process 4 can be determined, the number of the topology structure of process 4 is changed to 1. The second communication is performed, and the topology starting point and the topology end point of process 4 are communicated to process 3 and process 5, and the first and third bits of the number table of process 4 are updated to 1 (changed to 1 in a virtual state). Among them, after receiving the information of process 4, process 5 successfully finds the final topology structure and changes the second bit in the number table of process 5 to 1. Since process 3 communicates from back to front, assuming that the final topology structure cannot be found, the number of process 3 is still 2, and the final topology structure cannot be determined according to process 4. However, since the data of process 4 will not continue to be updated, there is no need to transmit information to process 3, then the first bit of the possible topology quantity table of process 4 is changed to 1 (marked as a 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 structure from process 4 once. In the next communication cycle, it will no longer receive information from process 4. Process 3 can only rely on process 2 to determine the final topology structure.
[0151] According to another aspect of the embodiments of the present disclosure, a topological device of a hybrid grid is provided, such as Figure 5 As shown, the device comprises:
[0152] The partitioning module 101 is used to partition the data points included in the nodes in the grid file based on the number of processes used to generate the grid unit, and obtain the topological data points required for each process, wherein the attributes of the data points are the grid type to which the grid unit belongs and / or the vertices constituting the grid unit.
[0153] The first acquisition module 102 is used to obtain the N data points with the latest topological order from the topological data points required by the i-th process; the N is determined based on the number of vertices corresponding to the target mesh type, the target mesh type is the mesh type to which the mesh unit composed of the largest number of vertices in the node belongs, and the i-th process is any one of the processes.
[0154] The second acquisition module 103 is configured to acquire a target data point whose attributes include the grid type from the N data points.
[0155] The topology module 104 is used to determine the topology starting point of the i+1th process based on the target data point and the data point that the i+1th process needs topology, and based on the topology starting point, perform grid topology on the N data points and the data point that the i+1th process needs topology; the topology starting point includes the target data point that failed to generate a grid unit among the N data points and / or the first data point among the data points that the i+1th process needs topology.
[0156] In one or more embodiments, the topology module 104 is used to:
[0157] Based on the topological order of the current target data point among the N data points, the number of remaining data points whose topological order is later than the current target data point is obtained; and, based on the mesh type indicated by the current target data point, the number of vertices corresponding to the current target data point is obtained, and the current target data point is any one of the target data points; and, based on the data point that the i+1th process needs topology, the attributes of the first data point among the data points that the i+1th process needs topology are obtained;
[0158] In a 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 topological starting point;
[0159] In a case where the attribute of the first data point includes the grid type, the first data point is determined to be the topology starting point.
[0160] In one or more embodiments, the topology module 104 is used to:
[0161] Insert the N data points in front of the first data point of the i+1th process to obtain the pending topological data points of the i+1th process;
[0162] Based on the target topology starting point, calculating the theoretical topological order of the target to-be-topological data point, the target topology starting point is any one of the topology starting points, and the target to-be-topological data point is a to-be-topological data point characterized by a grid type of attribute;
[0163] In the case where the attributes of the to-be-topological data points located in the theoretical topological order are all of the grid type, a topological structure generated based on the target topological starting point is obtained; in the case where there are to-be-topological data points located in the theoretical topological order whose attributes are not of the grid type, the target topological starting point is deleted from the topological starting points;
[0164] A new target topology starting point is selected from the remaining topology starting points, and the step of calculating the theoretical topological order of the target topology data points based on the target topology starting point is repeated until there are no remaining topology starting points.
[0165] In one or more embodiments, after repeatedly executing the step of calculating the theoretical topological order of the target topological data points based on the target topological starting point until there are no remaining topological starting points, the method includes:
[0166] Obtain the number of topological structures generated by the i+1th process;
[0167] When the number of topological structures generated by the (i+1)th process is equal to 1, the topological structure is used as the final topological structure of the (i+1)th process;
[0168] When the number of topological structures generated by the i+1th process is greater than 1, based on the topological structure generated by the i+1th process and / or the topological structure generated by the i+2th process, the final topological structure of the i+1th process is determined from the multiple topological structures generated by the i+1th process.
[0169] In one or more embodiments, after repeatedly executing the step of calculating the theoretical topological order of the target topological data points based on the target topological starting point until there are no remaining topological starting points, the method includes:
[0170] Based on the obtained number of topological structures generated by the i+1th process, a pre-established topological quantity table is updated, where the topological quantity table is used to record the number of topological structures generated by the i-th process, the i+1th process, and the i+2th process;
[0171] When the number of topological structures generated by the i+1th process recorded in the topological quantity table after the topological quantity table is updated is greater than 1, based on the obtained numbers of topological structures generated by the i+1th process and the i+2th process, the number of topological structures generated by the i+1th process recorded in the topological quantity table is updated;
[0172] When the number of topological structures generated by the (i+1)th process recorded after the topological quantity table is updated is equal to 1, the number of topological structures generated by the (i+1)th process and the (i+2)th process is updated 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, determining the final topology structure of the i+1-th process from the multiple topology structures generated by the i+1-th process includes:
[0174] When the number of topological structures generated by the i-th process is equal to 1, based on the end point of the topological structure generated by the i-th process, the correct topological starting point of the i+1-th process is obtained, and the topological structure whose target topological starting point is consistent with the correct topological starting point is determined as the final topological structure of the i+1-th process;
[0175] In the case that the number of topological structures generated by the i-th process is greater than 1, based on the end points of the multiple topological structures generated by the i-th process, a possible topological starting point of the i+1-th process is obtained, and based on the topological starting point of the topological structure generated by the i+2-th process, a possible topological end point of the i+1-th process is obtained; based on the possible topological starting point and the possible topological end point of the i+1-th process, a target topological structure is determined from the multiple topological structures generated by the i+1-th process, and 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; in the case that the number of target topological structures is equal to 1, the target topological structure is determined to be the final topological structure of the i+1-th process, and in the case that 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 operations when the number of topological structures generated by the i-th process is equal to 1.
[0176] The topological device of the hybrid grid provided in the embodiment of the present disclosure and the topological method of the hybrid grid provided in the embodiment of the present disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, operated or implemented therein.
[0177] The present disclosure also provides a computer device to execute the above-mentioned hybrid grid topology method. Figure 6 It shows a schematic diagram of a computer device provided by some embodiments of the present disclosure. Figure 6As shown, the computer device 8 includes: a processor 800, a memory 801, a bus 802 and a communication interface 803, wherein the processor 800, the communication interface 803 and the memory 801 are connected via the bus 802; the memory 801 stores a computer program that can be run on the processor 800, and when the processor 800 runs the computer program, the topological method of the hybrid grid provided in any of the aforementioned embodiments of the present disclosure is executed.
[0178] The memory 801 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the device network element and at least one other network element is realized through at least one communication interface 803 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0179] The bus 802 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 801 is used to store a program, and the processor 800 executes the program after receiving an execution instruction. The topology method of the hybrid grid disclosed in any implementation of the above-mentioned embodiment of the present disclosure may 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 hardware integrated logic circuit or software instructions in the processor 800. The above processor 800 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a ready-made programmable gate array (FPTA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor to be executed, or a combination of hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field 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. The storage medium is located in the memory 801, and the processor 800 reads the information in the memory 801 and completes the steps of the above method in combination with its hardware.
[0181] The computer device provided by the embodiment of the present disclosure and the topological method of the hybrid grid provided by the embodiment 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] An embodiment of the present disclosure also provides a computer-readable storage medium corresponding to the topological method of the hybrid grid provided in the aforementioned embodiment. The computer-readable storage medium is a CD 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 topological method of the hybrid grid provided in any of the aforementioned 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 are not listed here one by one.
[0184] The computer-readable storage medium provided by the above-mentioned embodiment of the present disclosure and the topological method of the hybrid grid provided by the embodiment of the present disclosure are based on the same inventive concept, and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.
[0185] The present disclosure also provides a computer program product. Figure 7 The computer program product 600 carries a program code, namely a computer program 601. The instructions included in the computer program 601 can be used to execute the steps of the topological method of the hybrid grid described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0186] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0187] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0188] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0189] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0190] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0191] Various changes, substitutions, and modifications of the techniques described herein may be made without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of the present disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and actions described above. Currently existing or later to be developed processes, machines, manufactures, compositions of events, means, methods, or actions that perform substantially the same functions or achieve substantially the same results as the corresponding aspects described herein may be utilized. Thus, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or actions within their scope.
[0192] The above 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 may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0193] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A topological method of a hybrid grid, characterized in that: include: Based on the number of processes used to generate the grid unit, data points included in the nodes in the grid file are divided to obtain data points of topology required for each process, wherein the attributes of the data points are the grid type to which the grid unit belongs and / or the vertices constituting the grid unit; From the data points that the i-th process needs topology, obtain the N data points with the latest topological order; The N is determined based on the number of vertices corresponding to the target mesh type, the target mesh type is the mesh type to which the mesh unit consisting of the largest number of vertices in the node belongs, and the i-th process is any one of the processes; Acquire a target data point whose attributes include the grid type from the N data points; Based on the target data point and the data point that the i+1th process requires topology, determine the topology starting point of the i+1th process, and based on the topology starting point, perform grid topology on the N data points and the data point that the i+1th process requires topology; the topology starting point includes the target data point that failed to generate a grid unit among the N data points and / or the first data point among the data points that the i+1th process requires topology.
2. The hybrid grid topology method according to claim 1, characterized in that: Based on the target data point and the topological data point required by the (i+1)th process, determining the topological starting point of the (i+1)th process includes: Based on the topological order of the current target data point among the N data points, the number of remaining data points whose topological order is later than the current target data point is obtained; and, based on the mesh type indicated by the current target data point, the number of vertices corresponding to the current target data point is obtained, and the current target data point is any one of the target data points; and, based on the data point that the i+1th process needs topology, the attributes of the first data point among the data points that the i+1th process needs topology are obtained; In a 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 topological starting point; In a case where the attribute of the first data point includes the grid type, the first data point is determined to be the topology starting point.
3. The hybrid grid topology method according to claim 1, characterized in that: Based on the topology starting point, mesh topology is performed on the N data points and the data points that the (i+1)th process needs topology, including: Insert the N data points in front of the first data point of the i+1th process to obtain the pending topological data points of the i+1th process; Based on the target topology starting point, calculating the theoretical topological order of the target to-be-topological data point, the target topology starting point is any one of the topology starting points, and the target to-be-topological data point is a to-be-topological data point characterized by a grid type of attribute; In the case where the attributes of the to-be-topological data points located in the theoretical topological order are all of the grid type, a topological structure generated based on the target topological starting point is obtained; in the case where there are to-be-topological data points located in the theoretical topological order whose attributes are not of the grid type, the target topological starting point is deleted from the topological starting points; A new target topology starting point is selected from the remaining topology starting points, and the step of calculating the theoretical topological order of the target topology data points based on the target topology starting point is repeated until there are no remaining topology starting points.
4. The hybrid grid topology method according to claim 3, characterized in that: After repeatedly executing the step of calculating the theoretical topological order of the target topological data points based on the target topological starting point until there are no remaining topological starting points, the method further includes: Obtain the number of topological structures generated by the i+1th process; When the number of topological structures generated by the (i+1)th process is equal to 1, the topological structure is used as the final topological structure of the (i+1)th process; When the number of topological structures generated by the i+1th process is greater than 1, based on the topological structure generated by the i+1th process and / or the topological structure generated by the i+2th process, the final topological structure of the i+1th process is determined from the multiple topological structures generated by the i+1th process.
5. The hybrid grid topology method according to claim 3, characterized in that: After repeatedly executing the step of calculating the theoretical topological order of the target topological data points based on the target topological starting point until there are no remaining topological starting points, the method further includes: Based on the obtained number of topological structures generated by the i+1th process, a pre-established topological quantity table is updated, where the topological quantity table is used to record the number of topological structures generated by the i-th process, the i+1th process, and the i+2th process; When the number of topological structures generated by the i+1th process recorded in the topological quantity table after the topological quantity table is updated is greater than 1, based on the obtained numbers of topological structures generated by the i+1th process and the i+2th process, the number of topological structures generated by the i+1th process recorded in the topological quantity table is updated; When the number of topological structures generated by the (i+1)th process recorded after the topological quantity table is updated is equal to 1, the number of topological structures generated by the (i+1)th process and the (i+2)th process is updated to 1.
6. The hybrid grid topology method according to claim 4, characterized in that: Determining a final topology structure of the i+1th process from a plurality of topology structures generated by the i+1th process based on the topology structure generated by the i-th process and / or the topology structure generated by the i+2th process comprises: When the number of topological structures generated by the i-th process is equal to 1, based on the end point of the topological structure generated by the i-th process, the correct topological starting point of the i+1-th process is obtained, and the topological structure whose target topological starting point is consistent with the correct topological starting point is determined as the final topological structure of the i+1-th process; In the case that the number of topological structures generated by the i-th process is greater than 1, based on the end points of the multiple topological structures generated by the i-th process, a possible topological starting point of the i+1-th process is obtained, and based on the topological starting point of the topological structure generated by the i+2-th process, a possible topological end point of the i+1-th process is obtained; based on the possible topological starting point and the possible topological end point of the i+1-th process, a target topological structure is determined from the multiple topological structures generated by the i+1-th process, and 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; in the case that the number of target topological structures is equal to 1, the target topological structure is determined to be the final topological structure of the i+1-th process, and in the case that 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 operations when the number of topological structures generated by the i-th process is equal to 1.
7. A hybrid grid topology device, characterized in that: include: A partitioning module, used to partition the data points included in the nodes in the grid file based on the number of processes used to generate the grid unit, and obtain the data points required for the topology of each process, wherein the attributes of the data points are the grid type to which the grid unit belongs and / or the vertices constituting the grid unit; The first acquisition module is used to obtain the latest N data points in topological order from the data points that the i-th process needs topology; The N is determined based on the number of vertices corresponding to the target mesh type, the target mesh type is the mesh type to which the mesh unit consisting of the largest number of vertices in the node belongs, and the i-th process is any one of the processes; A second acquisition module, used for acquiring a target data point whose attributes include the grid type from the N data points; A topology module is used to determine a topology starting point of the i+1th process based on the target data point and the data point that the i+1th process needs topology, and based on the topology starting point, perform grid topology on the N data points and the data point that the i+1th process needs topology; the topology starting point includes the target data point that fails to generate a grid unit among the N data points and / or the first data point among the data points that the i+1th process needs topology.
8. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Grid parallel reading method and device, terminal equipment and readable storage medium
CN116820772A
Fluid network topological structure self-identification method based on depth-first search
CN116822405A
Spatial topological relation verification method and device, electronic equipment and storage medium
CN117786163A
Apparatus & associated methodology of generating a multi-core communications topology
US20100235847A1