CN119440802B - Topology method, device, equipment, storage medium and product of hybrid grid - Google Patents

Topology method, device, equipment, storage medium and product of hybrid grid

Info

Publication number
CN119440802B
CN119440802B CN202411328026.9A CN202411328026A CN119440802B CN 119440802 B CN119440802 B CN 119440802B CN 202411328026 A CN202411328026 A CN 202411328026A CN 119440802 B CN119440802 B CN 119440802B
Authority
CN
China
Prior art keywords
topology
topological
data points
grid
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202411328026.9A
Other languages
Chinese (zh)
Other versions
CN119440802A (en
Inventor
葛笑言
高浩卜
李义进
王潘
付强
温泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Aero Engine Research Institute
Original Assignee
China Aero Engine Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Aero Engine Research Institute filed Critical China Aero Engine Research Institute
Priority to CN202411328026.9A priority Critical patent/CN119440802B/en
Publication of CN119440802A publication Critical patent/CN119440802A/en
Application granted granted Critical
Publication of CN119440802B publication Critical patent/CN119440802B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/18Network design, e.g. design based on topological or interconnect aspects of utility systems, piping, heating ventilation air conditioning [HVAC] or cabling
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/28Design optimisation, verification or simulation using fluid dynamics, e.g. using Navier-Stokes equations or computational fluid dynamics [CFD]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2113/00Details relating to the application field
    • G06F2113/08Fluids
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2119/00Details relating to the type or aim of the analysis or the optimisation
    • G06F2119/14Force analysis or force optimisation, e.g. static or dynamic forces

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Geometry (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Analysis (AREA)
  • Software Systems (AREA)
  • Algebra (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computing Systems (AREA)
  • Fluid Mechanics (AREA)
  • Mathematical Physics (AREA)
  • Computational Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present disclosure relates to the technical field of computational fluid mechanics, and more particularly, to a topology method, apparatus, device, storage medium and product of a hybrid grid, where the method includes dividing data points included in nodes in a grid file based on a number of processes for generating grid cells to obtain data points requiring topology for each process; the method comprises the steps of obtaining N data points with latest topological sequence from data points with the ith process needing topology, obtaining target data points with attributes comprising grid types from the N data points, determining the topological starting point of the ith+1th process based on the target data points and the data points with the ith+1th process needing topology, and carrying out grid topology on the N data points and the data points with the ith+1th process needing topology based on the topological starting point. By dividing the data points under the nodes into a plurality of processes, the processes are processed in parallel, and the grid topology is carried out on the data points, so that the topology efficiency and the processing speed are improved.

Description

Topology method, device, equipment, storage medium and product of hybrid grid
Technical Field
The present disclosure relates to the field of computational fluid dynamics, and in particular, to a hybrid mesh topology method, apparatus, device, storage medium, and product.
Background
In the field of engineering simulation, a generated CGNS (CFD GENERAL notification System) grid file typically includes a plurality of nodes, each node contains millions or even hundreds of millions of data points, and the size of grid cells formed by the data point topology is usually huge. Along with the improvement of the simulation precision requirement, the scale of the grid unit is continuously expanded, and extremely high requirements are put on the topology speed and the reading efficiency of the grid unit.
In the traditional numerical simulation, the topology of data points of CGNS grid files is usually processed in a single-process serial manner, which causes remarkable time consumption when facing large-scale data points, especially in the field of aeroengines, as the grid units are large in scale and the same node is mixed with a plurality of different types of grid units, the requirement of efficient simulation cannot be met by a single-process topology method for the mixed grid.
Disclosure of Invention
The present disclosure has been made in view of the above-mentioned problems, and provides a topology method, apparatus, device, storage medium, and product of a hybrid grid.
According to one aspect of the present disclosure, there is provided a topology method of a hybrid mesh, comprising:
dividing data points included by nodes in a grid file based on the number of processes for generating the grid unit to obtain data points needing topology for each process, wherein the attribute of the data points is the grid type of the grid unit and/or the vertex forming the grid unit;
N data points with the latest topological sequence are obtained from data points which need topology in the ith process, wherein N is determined based on the number of vertexes corresponding to a target grid type, the target grid type is a grid type which is formed by the maximum number of vertexes in the node and belongs to a grid unit, and the ith process is any process;
acquiring target data points with attributes comprising the grid type from the N data points;
Determining a topological starting point of the (i+1) -th process based on the target data point and the data point of the (i+1) -th process needing topology, and carrying out grid topology on the N data points and the data point of the (i+1) -th process needing topology based on the topological starting point, wherein the topological starting point comprises a first data point in the N data points, wherein the target data point of a grid unit and/or the data point of the (i+1) -th process needing topology cannot be generated.
Furthermore, a topology method of a hybrid mesh according to an aspect of the present disclosure, further includes:
determining a topology starting point of the (i+1) -th process based on the target data point and a data point of the (i+1) -th process requiring topology, including:
Acquiring the number of the remaining data points with the topological order later than that of the current target data point based on the topological order of the current target data point in the N data points, acquiring the number of the vertexes corresponding to the current target data point based on the grid type indicated by the current target data point, wherein the current target data point is any one target data point, and acquiring the attribute of the first data point in the data points with the (i+1) th process needing topology based on the data points with the (i+1) th process needing topology;
Determining the current target data point as the topology starting point under the condition that the number of the remaining data points is smaller than the number of the vertexes corresponding to the current target data point;
And determining the first data point as the topology starting point in the case that the attribute of the first data point comprises the grid type.
Furthermore, a topology method of a hybrid mesh according to an aspect of the present disclosure, further includes:
Based on the topology starting point, performing grid topology on the N data points and the data points of which the i+1th process needs topology, wherein the grid topology comprises:
Inserting the N data points in front of the first data point of the (i+1) th process to obtain a data point to be topologically of the (i+1) th process;
Calculating a theoretical topological sequence of target to-be-topological data points based on a target topological starting point, wherein the target topological starting point is any one topological starting point, and the target to-be-topological data points are to-be-topological data points with attribute characterization as grid types;
Acquiring a topological structure generated based on the target topological starting point under the condition that the attributes of the data points to be topological positioned in the theoretical topological sequence are all grid types;
And selecting a new target topology starting point from the rest topology starting points, and repeatedly executing the steps of calculating the theoretical topology sequence of the target data points to be topologically based on the target topology starting point until the rest topology starting point does not exist.
Furthermore, a topology method of a hybrid mesh according to an aspect of the present disclosure, further includes:
After repeatedly executing the step of calculating the theoretical topological order of the target data points to be topologically based on the target topological starting point until no residual topological starting point exists, the method further comprises:
acquiring the number of topological structures generated by the (i+1) th process;
taking the topological structure as the final topological structure of the (i+1) th process under the condition that the number of topological structures generated by the (i+1) th process is equal to 1;
And determining the final topological structure of the (i+1) -th process from a plurality of topological structures generated by the (i+1) -th process based on the topological structure generated by the (i+1) -th process and/or the topological structure generated by the (i+2) -th process under the condition that the number of the topological structures generated by the (i+1) -th process is larger than 1.
Furthermore, a topology method of a hybrid mesh according to an aspect of the present disclosure, further includes:
After repeatedly executing the step of calculating the theoretical topological order of the target data points to be topologically based on the target topological starting point until no residual topological starting point exists, the method further comprises:
Updating a pre-established topology quantity table based on the number of the obtained topological structures generated by the (i+1) th process, wherein the topology quantity table is used for recording the number of the topological structures generated by the (i) th process, the (i+1) th process and the (i+2) th process;
Updating the number of the topological structures generated by the (i+1) th process recorded by the topological quantity table based on the acquired number of the topological structures generated by the (i+2) th process and the (i+1) th process under the condition that the number of the topological structures generated by the (i+1) th process recorded by the updated topological quantity table is larger than 1;
And under the condition that the number of the topological structures generated by the (i+1) th process recorded after the topology quantity table is updated is equal to 1, updating the number of the topological structures generated by the (i+2) th process and the (i+2) th process to 1.
Furthermore, a topology method of a hybrid mesh according to an aspect of the present disclosure, further includes:
Based on the topology structure generated by the ith 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 a plurality of topology structures generated by the (i+1) th process, wherein the determining comprises the following steps:
under the condition that the number of the topological structures generated by the ith process is equal to 1, based on the end point of the topological structure generated by the ith process, obtaining a correct topological starting point of the (i+1) th process, and determining a topological structure of which the target topological starting point is consistent with the correct topological starting point as a final topological structure of the (i+1) th process;
And determining a target topology structure from a plurality of topological structures generated by the (i+1) th process based on the possible topological start points and the possible topological end points of the (i+1) th process, obtaining the possible topological end points of the (i+1) th process based on the possible topological start points and the possible topological end points of the (i+1) th process, determining the target topology structure by taking the possible topological start points as topological start points and the possible topological end points as topological end points, determining the target topology structure as a final topological structure of the (i+1) th process in the case that the number of the target topology structure is equal to 1, waiting for the number of the (i+1) th process to be updated to 1 in the case that the number of the target topology structure is greater than 1, and executing the operation in the case that the number of the (i+1) th process is equal to 1.
According to another aspect of the present disclosure, there is provided a topology apparatus of a hybrid mesh, comprising:
The dividing module is used for dividing data points included in nodes in a grid file based on the number of processes for generating the grid units to obtain data points needing topology for each process, wherein the attributes of the data points are grid types to which the grid units belong and/or vertexes forming the grid units;
The system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring N data points with the latest topological sequence from data points with the topological requirement of the ith process, the N is determined based on the number of vertexes corresponding to a target grid type, the target grid type is the grid type of a grid unit formed by the maximum number of vertexes in the node, and the ith process is any process;
a second acquisition module, configured to acquire a target data point whose attribute includes the grid type from the N data points;
The topology module is used for determining a topology starting point of the (i+1) th process based on the target data point and the data point of the (i+1) th process needing topology, and carrying out grid topology on the N data points and the data point of the (i+1) th process needing topology based on the topology starting point, wherein the topology starting point comprises a first data point in the N data points, wherein the target data point of a grid unit cannot be generated and/or the data point of the (i+1) th process needing topology cannot be generated.
According to yet another aspect of the present disclosure, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory, the processor executing the computer program to implement the method of one of the above aspects.
According to yet another aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of one of the above aspects.
According to yet another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of one of the above aspects.
As will be described in detail below, according to the topology method, device, equipment, storage medium and product of the hybrid grid of the embodiment of the present disclosure, by dividing a data point under a node into a plurality of processes, and processing the plurality of processes in parallel, performing grid topology on the data point, not only topology efficiency and processing speed are improved, but also multi-core processing capability of a modern computer can be fully utilized, data point topology tasks are allocated to different processes to process, and utilization rate of computing resources is improved, on the other hand, in order to avoid a situation that data points forming the same grid unit are divided into two processes, a target data point and a data point allocated to an i+1th process need topology are used for determining a topology starting point of the i+1th process, and missing of grid units needing topology between adjacent processes caused by data point loss is avoided.
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 claimed.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in more detail embodiments thereof with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of embodiments of the disclosure, and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure, without limitation to the disclosure. In the drawings, like reference numerals generally refer to like parts or steps.
Fig. 1 is a flowchart illustrating a topology method of applying a hybrid mesh according to an embodiment of the present disclosure.
Fig. 2 is yet another flowchart illustrating a topology method of applying a hybrid mesh according to an embodiment of the present disclosure.
FIG. 3 is a table illustrating the number of possible topologies for applying processes 0-2 in accordance with an embodiment of the disclosure.
FIG. 4 is a table illustrating the number of possible topologies for applying processes 3-5 according to an embodiment of the disclosure.
Fig. 5 is a structural schematic diagram illustrating a topology device of a hybrid mesh according to an embodiment of the present disclosure.
Fig. 6 is a schematic structural diagram illustrating a computer device according to an embodiment of the present disclosure.
Fig. 7 is a schematic diagram illustrating a computer program product according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more apparent, exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present disclosure and not all of the embodiments of the present disclosure, and that the present disclosure is not limited by the example embodiments described herein.
In the field of engineering simulation, a generated CGNS (CFD GENERAL notification System) grid file typically includes a plurality of nodes, each node contains millions or even hundreds of millions of data points, and the size of grid cells formed by the data point topology is usually huge. Along with the improvement of the simulation precision requirement, the scale of the grid unit is continuously expanded, and extremely high requirements are put on the topology speed and the reading efficiency of the grid unit.
In the traditional numerical simulation, the topology of data points of CGNS grid files is usually processed in a single-process serial manner, which causes remarkable time consumption when facing large-scale data points, especially in the field of aeroengines, as the grid units are large in scale and the same node is mixed with a plurality of different types of grid units, the requirement of efficient simulation cannot be met by a single-process topology method for the mixed grid.
In the above, the topology method, the device, the equipment, the storage medium and the product of the hybrid grid according to the embodiments of the present disclosure are described with reference to the accompanying drawings, by dividing the data points under the nodes into a plurality of processes, and the plurality of processes process in parallel to perform grid topology on the data points, not only the topology efficiency and the processing speed are improved, but also the multi-core processing capability of the modern computer can be fully utilized, the data point topology tasks are allocated to different processes for processing, and the utilization rate of computing resources is improved.
In addition, in order to avoid the situation that the data points forming the same grid unit are divided into adjacent processes, the topological starting point of the (i+1) th process is determined through the target data points and the data points which are distributed to the (i+1) th process and need topology, so that the topological starting point can be ensured to be determined for the (i+1) th process, and the situation that the grid unit task cannot be completed correctly due to the loss of the data points is avoided.
On the other hand, a topology quantity table centering on each process is established, and the unique and correct topology structure of the (i+1) th process can be determined by communicating between the topology quantity tables of the adjacent processes and receiving and transmitting the topology structures and the quantity of the adjacent processes, so that the improvement of the accuracy of the topology is facilitated.
For the sake of understanding the present embodiment, first, a detailed description will be given of a topology method of a hybrid grid disclosed in the present embodiment, where an execution subject of the topology method of the hybrid grid provided in the present embodiment is generally a computer device with a certain computing capability, and the computer device includes, for example, a terminal device or a server or other processing device, and the terminal device may be a User Equipment (UE), a mobile device, a User 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, or the like. In some possible implementations, the topology of the hybrid grid may be implemented by way of a processor invoking computer readable instructions stored in a memory.
As shown in fig. 1, a flowchart of a topology method of a hybrid mesh according to an embodiment of the disclosure is provided, where the method includes S101-S104:
S101, dividing data points included in nodes in a grid file based on the number of processes for generating grid cells, and obtaining data points requiring topology for each process.
The grid file is CGNS grid file generated during engineering simulation, the grid file comprises a plurality of nodes, and each node comprises a plurality of data points which are arranged according to numbers (namely, topological order).
The attribute of the data point is the grid type of the grid unit and/or the vertexes forming the grid unit, specifically, a supported grid type code table is constructed in advance according to all supported grid types and codes provided by CGNS grid files, for example, the grid type represented by code 10 is a tetrahedron grid, 4 vertexes are needed, the grid type represented by 14 is a hexahedral grid, 6 vertexes are needed, and the grid type represented by 15 is an octahedral grid, and 8 vertexes are needed. The data point is assumed to have a value of 8 (which is a code that does not exist in the code table of the grid type) and represents that the attribute of the data point is a vertex, and is only used as a vertex constituting a certain grid unit in the following topology process, and the data point is assumed to have a value of 10 and represents that the attribute of the data point can be a grid type (tetrahedral grid) or a vertex, and is also used as a starting point constituting a certain grid unit in the following topology process, and the real attribute can be verified in the following topology process.
Specifically, the processes are used for generating grid cells by using grid topology for data points, dividing the data points included in the nodes into each process, and assuming that the nodes include 160 data points and the number of the processes is 4, distributing 40 data points needing topology for the processes 0-3 on average.
Assuming that the number of data points of the topology required by the process 0 is 10,1,2,3,4,14,5,6,7,8 (ordered by number), since "10" is 1 st in the topological order of the process 0, and the attribute of "10" is a grid type, namely, a tetrahedron grid, "10" is necessarily the topological starting point of the process 0, "1,2,3,4" behind "10" is the vertex constituting the tetrahedron grid, "10,1,2,3,4" is one grid unit generated by the topology, and "14" is the starting point of the next grid unit.
S102, acquiring N data points with the latest topological sequence from data points with the topological requirement of the ith process.
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 a mesh type to which a mesh unit formed by the maximum number of vertices in the nodes belongs, the target mesh type under the node of this embodiment is assumed to be an octahedral mesh denoted by reference numeral 15, and since 9 data points are required for generating the octahedral mesh unit by topology, n=9, it can be ensured that at least one data point with a mesh type attribute exists in the N data points, and assuming that the i-th process is process 1, the last 9 data points of the process 1 are acquired, and the 9 data points are stored separately for determining the topology starting point of the process 2 in the subsequent steps.
S103, acquiring target data points with attributes including grid types from N data points.
Specifically, the values of N data points are obtained, and if the value of a data point is a code number existing in the grid type code number table, the attribute of the data point is confirmed to include the grid type. For example, if a data point has a value of 14, the attribute of the data point may be a grid type, or may be a vertex constituting a grid unit, and cannot be determined at present, the data point is considered as a target data point, and the true attribute of the target data point can be verified in the subsequent grid topology process.
S104, determining a topological starting point of the (i+1) th process based on the target data point and the data point of the (i+1) th process needing topology, and carrying out grid topology on the N data points and the data point of the (i+1) th process needing topology based on the topological starting point.
Wherein the topology starting point includes a first data point of the target data points of the N data points which fail to generate the grid unit and/or the data points of the i+1th process needing topology, and specifically, the step S104 includes the following steps 11-17:
Step 11, based on the topology sequence of the current target data point in N data points, acquiring the number of the remaining data points with the topology sequence later than the current target data point, acquiring the number of the vertexes corresponding to the current target data point based on the grid type indicated by the current target data point, and acquiring the attribute of the first data point in the data points of which the i+1th process needs topology based on the data points of which the i+1th process needs topology.
The current target data point is any one target data point, assuming that N data points are 9 data points, and the values are 14,8,9,10,11,12,13,10,14 according to the topological order, and then the target data points are the 1 st (14), 4 th (10), 8 th (10) and 9 th data points (14). Example 1 the current target data point is the 1 st data point (14), the number of remaining data points that are topologically later than the current target data point 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 8 th data point (10), the number of remaining data points with topological order later than the current target data point is 1, and the number of vertices corresponding to the current target data point is 4.
And step 12, determining the current target data point as a topology starting point under the condition that the number of the remaining data points is smaller than the number of the vertexes corresponding to the current target data point, and determining the first data point as the topology starting point under the condition that the attribute of the first data point comprises a grid type.
Specifically, the 1 st data point (14) and the 4 th data point (10) cannot be used as a topology starting point, taking the 1 st data point (14) as an example, assuming that the attribute of the 1 st data point (14) is a grid type, the grid cell formed by taking the 1 st data point (14) as a starting point must already be generated in the process i, so that the 1 st data point (14) cannot be used as a topology starting point in order to avoid the process i+1 repeatedly generating the same grid cell. Of the 9 data points, the 8 th data point (10) and the 9 th data point (14) are topological starting points of the (i+1) th process.
Assuming that the value of the first data point in the data points of the i+1th process needing topology is 11, the attribute representing the first data point cannot be a grid type, the first data point cannot be used as a topology starting point, and the true topology starting point of the i+1th process is the 8 th data point (10) or the 9 th data point (14), which specifically needs to be verified in the subsequent grid topology process. However, assuming that the value of the first data point in the data points of the i+1th process required topology is 15, the attribute representing the first data point includes a grid type, the first data point is also a topology starting point, and the true topology starting point of the i+1th process is the 8 th data point (10), the 9 th data point (14) or the first data point, which specifically needs to be verified in the subsequent grid topology process.
In this embodiment, special situations may occur, for example, the data points forming a certain grid unit are not truncated by the process i and the process i+1, and the first data point in the data points of the process i+1 requiring topology is the true topology starting point of the process i+1. Therefore, the topology starting point of the process i+1 is found from the N data points and the first data point of the process i+1, so that the true topology starting point of the process i+1 can be ensured to exist in the N+1 data points, and the grid cells needing topology are prevented from being omitted between adjacent processes due to the loss of the data points.
Step 13, inserting N data points in front of the first data point of the (i+1) th process to obtain the data point to be topologically of the (i+1) th process.
Specifically, assuming that the number of data points of the i+1th process requiring topology is 40, n=9, 9 data points are inserted before the first data point of the i+1th process, and the number of data points to be topologically of the i+1th process is 49.
And 14, calculating the theoretical topological sequence of the target data points to be topological based on the target topological starting point.
The target topology starting point is any one topology starting point, and the target data point to be topologically represented as a grid type. Taking the target topology starting point as the 8 th data point (10) as an example, the 8 th data point (10) has the topology sequence of 1 in the (i+1) th process, because the number 10 represents a tetrahedral grid, the data points to be topologically processed with the topology sequence of 1-5 form a tetrahedral grid unit, the starting point of the next grid unit is the target data point to be topologically processed, namely the data point to be topologically processed with the topology sequence of 6, and the subsequent confirmation mode of the target data point to be topologically processed is analogized, which is not repeated in the embodiment.
And step 15, acquiring a topological structure generated based on the target topological starting point under the condition that the attributes of the data points to be topological in the theoretical topological sequence are all grid types, and deleting the target topological starting point from the topological starting point under the condition that the attributes of the data points to be topological in the theoretical topological sequence are not grid types.
Specifically, assuming that the 8 th data point (10) is the true topological starting point of the i+1th process, then in theory, the attribute of the data point to be topologically ordered as 6 th (i.e., theoretical topological order) should be the grid type, i.e., the numerical value of the data point to be topologically ordered as 6 th should exist in the grid type code table. If the numerical value of each data point to be topologically arranged in the theoretical topological order exists in the grid type code table in the (i+1) th process, the (i+1) th process can generate a complete topological structure by taking the 8 th data point (10) as a topological starting point, and the topological structure is stored. If the numerical value of at least one data point to be topologically arranged in the theoretical topological order does not exist in the grid type code table, the 8 th data point (10) is not the true topological starting point of the (i+1) th process, a complete topological structure cannot be generated, and the target topological starting point is deleted from the topological starting points.
Step 16, selecting a new target topology starting point from the rest topology starting points, and repeatedly executing step 14 until no rest topology starting point exists.
The topology starting points are assumed to be the 8 th data point (10), the 9 th data point (14) and the first data point of the i+1th process. If the number of the data points to be topologically processed in each theoretical topological order exists in the grid type code table in the (i+1) th process, after the topological structure is saved, a new target topological starting point is selected from the rest topological starting points, for example, the new target topological starting point is the 9 th data point (14), and then the step 14 is repeatedly executed. If the 8 th data point (10) is not the true topological starting point of the i+1th process, deleting the 8 th data point (10) from the topological starting points, and then selecting a new target topological starting point from the rest topological starting points, for example, the new target topological starting point is the 9 th data point (14), and repeating the step 14.
Step 17, obtaining the number of topological structures generated by the (i+1) th process;
And taking the topological structure as the final topological structure of the (i+1) th process under the condition that the number of topological structures generated by the (i+1) th process is equal to 1. For example, only the 9 th data point (14) is the true topological starting point of the i+1th process, and the only correct final topology generated by the i+1th process can be generated by taking the 9 th data point (14) as the target topological starting point.
And under the condition that the number of the topological structures generated by the (i+1) th process is larger than 1, determining the final topological structure of the (i+1) th process from a plurality of topological structures generated by the (i+1) th process based on the topological structure generated by the (i+2) th process and/or the topological structure generated by the (i+2) th process. For example, a complete topology can be generated with the 9 th data point (14) and the first data point of the i+1th process as target topology starting points, but each process can only generate a unique correct topology, and among the 9 th data point (14) and the first data point of the i+1th process, only one data point is the true topology starting point of the i+1th process, in which case the final topology of the i+1th process needs to be determined by the topology generated by the i-th process and/or the i+2th process. Specifically, the present embodiment is explained in the following two cases:
Case 1-in case the number of topologies generated by the ith process equals 1:
Based on the end point of the topological structure generated by the ith process, obtaining the correct topological starting point of the (i+1) th process, and determining the topological structure of which the target topological starting point is consistent with the correct topological starting point as the final topological structure of the (i+1) th process.
Specifically, the number of topologies generated by the ith process is equal to 1, which means that the ith process has generated the only correct final topology, and the endpoint of the topology of the ith process is also unique. Based on the end point of the topological structure generated by the ith process, the number of the last data point of the topological structure generated by the ith process is obtained, and the data point with the specification number of 39 is the correct topological starting point of the ith+1th process, and the target topological starting point with the specification number of 39 is the final topological structure of the ith+1th process.
Case 2-in case the number of topology structures generated by the ith process is greater than 1, comprising the steps of:
1) The method comprises the steps of obtaining possible topology starting points of an ith process based on a plurality of topological structure end points generated by the ith process, and obtaining possible topology end points of the ith+1 process based on the topology starting points of the topological structures generated by the ith+2 process.
Specifically, assuming that the ith process generates 2 topologies, the ith process has not yet determined a unique final topology, at which point the ith process has 2 endpoints. Assuming that the i+2 process generates 1 topology, i.e., the correct topology starting point of the i+2 process is determined, the possible topology end point of the i+1 process can be determined according to the correct topology starting point of the i+2 process. It should be noted that, in the case where the number of topologies generated by the i+1th process is greater than 1 (assuming that the number is equal to 2), the possible topology end points of the topologies generated by the i+1th process may overlap, and in this case, although the possible topology end points of the i+1th process are determined, the correct topology start point of the i+1th process cannot be determined.
2) A target topology is determined from the plurality of topologies generated by the i+1th process based on the possible topology starting point and the possible topology ending point of the i+1th process.
Specifically, the target topology takes a possible topology starting point as a topology starting point and a possible topology ending point as a topology ending point. Assuming that possible topology starting points of the (i+1) th process are A and B, possible topology end points are C, if a topology structure taking A as the topology starting point and C as the topology end point exists in a plurality of topology structures generated by the (i+1) th process, the topology structure is a target topology structure, and if a topology structure taking B as the topology starting point and C as the topology end point exists in a plurality of topology structures generated by the (i+1) th process, the topology structure is also a target topology structure.
3) And under the condition that the number of the target topological structures is equal to 1, determining that the target topological structure is the final topological structure of the (i+1) th process, and under the condition that the number of the target topological structures is greater than 1, waiting for the number of the topological structures generated by the (i) th process to be updated to 1, and executing the operation of the situation 1.
Specifically, if only the topology structure using a as the topology starting point and C as the topology ending point exists in the multiple topologies generated by the i+1th process, the target topology structure is the final topology structure of the i+1th process. If the number of the target topological structures is greater than 1, the final topological structure of the (i+1) th process cannot be determined at present, after the final topological structure of the (i) th process needs to be determined, the correct topological starting point of the (i+1) th process is determined according to the final topological structure of the (i) th process, and then the final topological structure of the (i+1) th process is determined.
Preferably, in this embodiment of the present disclosure, a topology quantity table mainly including each process is pre-constructed, where the topology quantity table records the number of topology structures generated by the ith process, the (i+1) th process, and the (i+2) th process, and is used for communication among the ith process, the (i+1) th process, and the (i+2) th process to determine a final topology structure of the (i+1) th process, and this embodiment will be explained by taking the topology quantity table constructed by the (i+1) th process (hereinafter abbreviated as the (i+1) th topology quantity table) as an example, and specifically includes the following steps 18 to 19:
And 18, updating a pre-established i+1th topological quantity table based on the number of topological structures generated by the acquired i+1th process.
The 1 st bit of the i+1st topological quantity table is used for recording the quantity of topological structures generated by the i process, the 2 nd bit is used for recording the quantity of topological structures generated by the i+1th process, and the 3 rd bit is used for recording the quantity of topological structures generated by the i+2th process. The initial data recorded in the i+1th topological quantity table is 0 or null value, and it is to be noted that, when the i+1th process is the 1 st process or the last 1 st process, taking the i+1th process as the last 1 st process as an example, the number of topological structures generated by the i+2th process recorded in the i+1th topological quantity table is "-1", that is, null.
After the number of topological structures generated by the (i+1) th process is obtained, assuming that the number of topological structures generated by the (i+1) th process is 1, the (2) nd bit recorded in the (i+1) th topological number table is updated to 1. In this embodiment, preferably, the number of topology structures generated by the ith process and sent by the topology quantity table constructed by the ith process is received, the number of topology structures generated by the (i+2) th process and sent by the (i+2) th process is received, and the 1 st bit and the 3 rd bit recorded in the (i+1) th topology quantity table are updated.
And step 19, in the first case, under the condition that the number of the topological structures generated by the (i+1) th process recorded after the (i+1) th topological number table is updated is equal to 1, the number of the topological structures generated by the (i+2) th process and the (i+1) th process is updated to 1.
Specifically, after the number of the topology structures generated by the (i+1) th process is sent to the topology number table constructed by taking the (i) th process as a main component by the (i+1) th topology number table, whether the (i) th process can determine the final topology structure or not, the number recorded in the (1) th bit in the (i+1) th topology number table is updated to 1, which means that the (i+1) th topology number table does not need to send the number information to the topology number table constructed by taking the (i) th process as a main component. Similarly, after the i+1th topology quantity table sends the quantity of the topology structures generated by the i+1th process to the topology quantity table mainly constructed by the i+2th process, the i+2th process can determine the final topology structure according to the final topology structure of the i+1th process, so that the value recorded in the 3 rd bit of the i+1th topology quantity table can be updated to 1, which means that the i+1th topology quantity table does not need to send quantity information to the topology quantity table mainly constructed by the i+2th process.
And in the second case, under the condition that the number of the topological structures generated by the (i+1) th process recorded after the update of the topological quantity table is larger than 1, updating the number of the topological structures generated by the (i+1) th process recorded by the topological quantity table based on the acquired number of the topological structures generated by the (i+2) th process and the obtained number of the topological structures generated by the (i+2) th process.
Specifically, based on the obtained number of topological structures generated by the ith process and the (i+2) th process, the number of topological structures generated by the (i+1) th process recorded in the updated topological number table may refer to the specific manner described in the above case 2.
As shown in fig. 2, a further flowchart of a topology method of a hybrid mesh according to an embodiment of the disclosure is provided, where the method includes S201-S204:
and S201, calculating the upper limit and the lower limit of the number of the data points to be read in by each process according to the number of the data points of the nodes of the CGNS grid file, and respectively reading the data points between the upper limit and the lower limit of each process.
Unlike the reading of a single grid type, the embodiment of the disclosure does not consider the number of grid units and the grid type possibly contained during the reading, but calculates the number of data points needed to be topological by each process according to the number of data points by an equipartition principle, so as to ensure the consistency of the number of processing of each process to the maximum extent, and the parallel processing of multiple processes and improve the reading efficiency.
Specifically, S201 includes the following steps:
S2011, opening CGNS a grid file, scanning information of data points of the current CGNS grid file, determining that a node comprises two or more grid types (namely a mixed grid), and acquiring the total number of the data points of the node by each process.
And 2012, setting the size of the communication domain of each process in the MPI according to the number of the processes. And calculating the number of data points to be read by each process and the upper and lower limits of the numbers according to the size of the communication domain.
For example, the total number of data points is 20, the number of processes is 2 (process 0 and process 1), then the number of data points to be read by process 0 is 10, the lower limit of the number is 1, the upper limit of the number is 10 (i.e., the data points numbered 1-10), the number of data points to be read by process 1 is 10, the lower limit of the number is 11, and the upper limit of the number is 20 (i.e., the data points numbered 11-20).
S202, information of last N data points of the last process is sent to the next process based on an inter-process communication mechanism of the MPI.
Wherein, the last process does not communicate, N is determined based on the number of vertices corresponding to the target mesh type, where the target mesh type is the mesh type to which the mesh unit formed by the maximum number of vertices in the nodes belongs, and assuming that the target mesh type under the nodes of the embodiment is a hexahedral mesh denoted by reference numeral 14, since 7 data points are required for topology generation of the hexahedral mesh unit in total, n=7. Specifically, S202 includes the following steps:
s2021, the current process obtains the last N data points from the last process by communication. Assuming that n=7, 7 data points are individually saved, and a possible start point boolean array and a possible end point boolean array are created according to the number (length) of N data points, the length of the possible start point boolean array and the possible end point boolean array of the present embodiment is 7+1=8, and the initial value of the default boolean array is-1 (false). The possible starting point boolean array represents 7 data points and data points in the first data point of the current process that may become the topology starting point of the current process, among which there must be the only correct topology starting point, and the possible ending point boolean array represents 7 data points and data points in the first data point of the current process that may become the topology ending point of the current process, among which there must be the only correct topology ending point.
S2022, constructing a supported grid type code table according to all supported grid types and code numbers thereof provided by CGNS grid files.
Specifically, the type of mesh supported depends on the solver itself, and this embodiment is exemplified by a tetrahedron denoted by reference numeral 10 and a hexahedron denoted by reference numeral 14.
S2023 inserts 7 data points before the first data point of the current process, determines 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 updates the value of the position corresponding to the 3 rd data point in the boolean array of possible starting points to 1 (true) assuming that the value of the 3 rd data point in the 7 data points is 10.
S2024, randomly selecting one target data point from the data points with the value of 1 recorded by the Boolean array of the possible starting points, acquiring the number of the remaining data points with the topological order later than that of the target data points based on the topological order of the target data points in 7 data points, acquiring the number of the vertexes corresponding to the target data points based on the grid type indicated by the target data points, and determining the target data point as the possible topological starting point under the condition that the number of the remaining data points is smaller than the number of the vertexes corresponding to the target data points.
If the number of the remaining data points is greater than or equal to the number of the vertices corresponding to the target data points, the mesh unit can be generated completely in the last process, and in order to avoid repeated generation, the value of the mesh unit at the position corresponding to the boolean array of the possible starting point is updated to be-1. And by analogy, screening all data points with values of 1 recorded by the boolean array of the possible starting points to determine the final possible topology starting points.
And S203, starting to perform grid topology on the data points of the current process based on the starting points of the topologies in turn.
Specifically, in the grid topology process, illegal data points are screened, wherein the screening logic is that in the grid topology process, in the position of the data point with the attribute of the grid type, the data point with the numerical value which does not exist in the grid type code table appears, then the data point is illegal, the current topology starting point is not the correct topology starting point of the current process, the current topology starting point is directly skipped, the grid topology is started to be carried out on the current process based on the next topology starting point, and the step of repeating is repeated until all the topology starting points are traversed. Therefore, even if the topology starting point is inaccurate, the current process can find the correct topology starting point through multiple attempts, and meanwhile, the time for confirming the final topology structure is greatly shortened.
Specifically, S203 includes the following steps:
s2031, cycling all topology starting points to generate a grid topology.
If illegal data points appear, the current topology starting point is considered to be wrong, and the current topology starting point is directly skipped. If the grid topology is able to go to the last data point of the current process, then this topology is temporarily saved.
S2032, creating a table of possible topology quantities.
The possible topology quantity table maintains the virtual states of the current process and the adjacent process, the length of the quantity table is 3, the 1 st bit represents the number of the topology structures generated by the last process, the 2 nd bit represents the number of the topology structures generated by the current process, and the 3 rd bit represents the number of the topology structures generated by the next process.
Wherein a virtual state is a state that exists to further reduce communication between processes, and first, the number of topologies (or virtual states thereof) generated by adjacent processes is recorded in a possible topology number table. In order to reduce communication as much as possible and avoid wasting resources, the number of adjacent processes in the possible topology number table can be directly marked as 1 (virtual state) after the current process sends a unique topology structure to the adjacent processes. The reason for this is that if the current process sends to its neighboring process a unique topology, no matter whether the neighboring process can find the final topology, it is not necessary to continue to receive the data of the current process (since the data of the current process is not updated any more, and repeated sending is not meaningful).
And S2033, updating the 2 nd bit of the possible topology quantity table after each topology structure is generated by the current process.
S2034, if the current process generates a topology structure, determining the topology structure as the final topology structure of the current process, and if the current process generates a plurality of topology structures, determining the final topology structure of the current process according to the topology structures of the adjacent processes.
S204, communicating the known information between the processes to the adjacent processes through specific communication logic, and finding the final topological structure of each process on the basis of meeting the minimum communication times and communication traffic.
After all processes generate the topological structure, judging whether inter-process communication is needed to determine which process generates the final topological structure according to the number of topological structures generated by each process. If a process does have multiple possible topologies, the process will ensure the correct topology that is ultimately selected by further communication.
Specifically, S204 includes the following steps:
s2041, communicating the possible topology starting point of each process to the previous process and the possible topology ending point to the next process.
The purpose of this communication is to obtain the topology starting point of the next process or the topology end point of the previous process, and determine which processes need to accept information and which processes need to send information in the subsequent topology process.
And S2042, updating a possible topology quantity table according to the received topology starting point and the topology ending point of the adjacent process. The former process updates bit 1 and the latter process updates bit 3, defaulting to-1 (null) if the current process has no preceding or following process.
S2043, calculating whether the current process can determine the final topology according to the data of the possible topology quantity table.
And according to the information (the topological starting point and the topological end point of the adjacent process) received by the S2042 or the S2046, the communicated information and the topological structure of the current process are subjected to cross comparison. The next data point of the topology end point of the previous process may be the topology start point of the current process, and the topology start point of the next process may be the topology end point of the current process.
S2044, determining whether the current process transmits data to the adjacent process according to the updated possible topology quantity table. Each process needs to decide whether to continue to acquire and send data to the previous process or the next process according to the table of possible topology quantities.
S2045, judging whether the processes need to continue communication.
If the number of topologies of the current process is 1, then no information needs to be accepted from the neighboring process. If the number of topology structures of the neighboring process is 1, the current process does not need to send information to the neighboring process. If the number of topologies of the previous process is not 1 (bit 1 in the table of possible topology numbers is not 1) or the number of topologies of the next process is not 1 (bit 3 in the table of possible topology numbers is not 1), the current process needs to send the possible starting point boolean array to the previous process and the possible ending point boolean array to the next process.
S2046, when the current process meets the sending or receiving condition, firstly receiving the information sent by the previous process, and then receiving the information sent by the next process.
If the current process meets the requirement of receiving data, continuously acquiring the topology end point of the previous process and the topology starting point of the next process. In each communication cycle, the previous and subsequent processes may succeed in finding the final topology or reduce the number of topologies. Therefore, the information acquired by 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 current process topologies is reduced to 1, then the table of possible topology numbers is updated synchronously.
In order to further reduce the number of communication times, the communication after sending the final topology structure can be specially processed, and if the current process sends the current process to the topology starting point and the topology end point corresponding to the final topology structure of the adjacent process, no matter whether the adjacent process can find the final topology structure or not, the information of the current process does not need to be continuously received. If the adjacent process can find the unique final topology structure (or reduce the number of topology structures) through the final topology structure sent by the current process, the sent information will not be different in the next communication cycle, and the next communication has no help to find the final topology structure for the adjacent process except for increasing the communication pressure. Otherwise, if the last process still cannot find the final topology (or cannot reduce the number of topologies) after the current process sends the topology starting point and the topology ending point corresponding to the final topology, the current process sends the same information in the next communication cycle without any help.
Specifically, as shown in fig. 3, the number of possible topologies of the process 0-2 is shown, wherein the number of topologies included in the process 0 is 1, that is, the unique topology (final topology) is found, the number of topologies included in the process 1 and the process 2 is 2, and the adjacent processes of the process 0-2 are marked as-1 (null).
According to S2041, a first communication is performed, each process communicates a topology start point and a topology end point to the front-to-back process, and according to S2042, the 3 possible topology quantity tables are updated (from-1 to 2). According to S2043, since the number of processes 0 is 1, process 1 can find the correct topology starting point according to the topology end point of process 0, and then change bit 2 of the number table of process 1 to 1. In the process 0 number table, because the unique topology is sent to the process 1, which represents that the number of the process 0 will not be updated continuously, it is no longer necessary to send information to the process 1, and the 3 rd bit in the process 0 number table is changed to 1 (marked as a virtual state). After receiving the information of the process 0, the process 1 successfully finds the final topology structure, and the 2 nd bit in the quantity table of the process 1 is changed into 1.
In the process 2, the number of topological structures cannot be reduced after calculation, and then loop communication is performed. According to S2044-S2045, process 2 finds that process 1 still needs to communicate with process 1, and after the second communication, process 2 finds that the number of processes 1 in this communication is 1. According to S2046, the number of recorded processes 1 in process 2 is updated to 1, and after process 1 has transmitted the unique topology to process 2, process 1 will no longer transmit information to process 2, and bit 3 of the number table of process 1 is changed to 1 (marked as virtual state). According to S2043, it is found that the correct topology starting point of process 2 can be calculated from the information of process 1, and at this time, all processes find the final topology structure, and can exit the loop without communication.
As shown in FIG. 4, a table of possible topology numbers for process 3-5 is provided, wherein process 3-5 includes a topology number of 2, and the neighboring process of process 3-5 is denoted as-1 (null), assuming process 5 is the last process.
The first communication is performed according to S2041-S2042 and the table of possible topology numbers for processes 3-5 is updated. Here, according to S2043, it is assumed that the final topology of the process 4 can be determined, and the number of topologies of the process 4 is changed to 1. The second communication is performed to communicate the topology start point and the topology end point of the process 4 to the process 3 and the process 5 while updating the 1 st bit and the 3 rd bit of the number table of the process 4 to 1 (1 changed to the virtual state). The process 5 successfully finds the final topology structure after receiving the information of the process 4, and changes the 2 nd bit in the number table of the process 5 into 1. Process 3 is a back-to-front communication, and if the final topology cannot be found, the number of processes 3 is still 2, and the final topology cannot be determined according to process 4. However, since the data of the process 4 will not continue to be updated, and no information need to be transmitted to the process 3, bit 1 of the possible topology quantity table of the process 4 is changed to 1 (marked as a virtual state), which represents that the process 4 does not send information to the process 3 any more. Meanwhile, bit 3 of the process 3 is updated to be 1, the process 3 needs to record that the final topology structure is accepted from the process 4 once, the information of the process 4 is not received any more in the next communication cycle, and the process 3 can only rely on the process 2 to determine the final topology structure.
According to another aspect of an embodiment of the present disclosure, there is provided a topology apparatus of a hybrid mesh, as shown in fig. 5, the apparatus including:
The partitioning module 101 is configured to partition data points included in nodes in a grid file based on the number of processes for generating a grid unit, to obtain data points that need topology for each process, where an attribute of the data points is a grid type to which the grid unit belongs and/or vertices that form the grid unit.
The first obtaining module 102 is configured to obtain N data points with the latest topological order from data points that need topology in an ith process, where N is determined based on the number of vertices corresponding to a target mesh type, where the target mesh type is a mesh type to which a mesh unit formed by the maximum number of vertices in the node belongs, and the ith process is any one of the processes.
A second obtaining module 103, configured to obtain a target data point whose attribute includes the grid type from the N data points.
A topology module 104, configured to determine a topology starting point of the (i+1) -th process based on the target data point and the data point of the (i+1) -th process that needs topology, and perform a grid topology on the N data points and the data point of the (i+1) -th process that needs topology based on the topology starting point, where the topology starting point includes a first data point of the N data points that fails to generate a target data point of a grid unit and/or the data point of the (i+1) -th process that needs topology.
In one or more embodiments, topology module 104 is to:
Acquiring the number of the remaining data points with the topological order later than that of the current target data point based on the topological order of the current target data point in the N data points, acquiring the number of the vertexes corresponding to the current target data point based on the grid type indicated by the current target data point, wherein the current target data point is any one target data point, and acquiring the attribute of the first data point in the data points with the (i+1) th process needing topology based on the data points with the (i+1) th process needing topology;
Determining the current target data point as the topology starting point under the condition that the number of the remaining data points is smaller than the number of the vertexes corresponding to the current target data point;
And determining the first data point as the topology starting point in the case that the attribute of the first data point comprises the grid type.
In one or more embodiments, topology module 104 is to:
Inserting the N data points in front of the first data point of the (i+1) th process to obtain a data point to be topologically of the (i+1) th process;
Calculating a theoretical topological sequence of target to-be-topological data points based on a target topological starting point, wherein the target topological starting point is any one topological starting point, and the target to-be-topological data points are to-be-topological data points with attribute characterization as grid types;
Acquiring a topological structure generated based on the target topological starting point under the condition that the attributes of the data points to be topological positioned in the theoretical topological sequence are all grid types;
And selecting a new target topology starting point from the rest topology starting points, and repeatedly executing the steps of calculating the theoretical topology sequence of the target data points to be topologically based on the target topology starting point until the rest topology starting point does not exist.
In one or more embodiments, after repeatedly performing the step of calculating a theoretical topological order of target data points to be topologically based on target topological starting points until there are no remaining topological starting points, comprising:
acquiring the number of topological structures generated by the (i+1) th process;
taking the topological structure as the final topological structure of the (i+1) th process under the condition that the number of topological structures generated by the (i+1) th process is equal to 1;
And determining the final topological structure of the (i+1) -th process from a plurality of topological structures generated by the (i+1) -th process based on the topological structure generated by the (i+1) -th process and/or the topological structure generated by the (i+2) -th process under the condition that the number of the topological structures generated by the (i+1) -th process is larger than 1.
In one or more embodiments, after repeatedly performing the step of calculating a theoretical topological order of target data points to be topologically based on target topological starting points until there are no remaining topological starting points, comprising:
Updating a pre-established topology quantity table based on the number of the obtained topological structures generated by the (i+1) th process, wherein the topology quantity table is used for recording the number of the topological structures generated by the (i) th process, the (i+1) th process and the (i+2) th process;
Updating the number of the topological structures generated by the (i+1) th process recorded by the topological quantity table based on the acquired number of the topological structures generated by the (i+2) th process and the (i+1) th process under the condition that the number of the topological structures generated by the (i+1) th process recorded by the updated topological quantity table is larger than 1;
And under the condition that the number of the topological structures generated by the (i+1) th process recorded after the topology quantity table is updated is equal to 1, updating the number of the topological structures generated by the (i+2) th process and the (i+2) th process to 1.
In one or more embodiments, determining a final topology of an i+1th process from among a plurality of topologies generated by the i+1th process based on a topology generated by the i process and/or a topology generated by the i+2th process, includes:
under the condition that the number of the topological structures generated by the ith process is equal to 1, based on the end point of the topological structure generated by the ith process, obtaining a correct topological starting point of the (i+1) th process, and determining a topological structure of which the target topological starting point is consistent with the correct topological starting point as a final topological structure of the (i+1) th process;
And determining a target topology structure from a plurality of topological structures generated by the (i+1) th process based on the possible topological start points and the possible topological end points of the (i+1) th process, obtaining the possible topological end points of the (i+1) th process based on the possible topological start points and the possible topological end points of the (i+1) th process, determining the target topology structure by taking the possible topological start points as topological start points and the possible topological end points as topological end points, determining the target topology structure as a final topological structure of the (i+1) th process in the case that the number of the target topology structure is equal to 1, waiting for the number of the (i+1) th process to be updated to 1 in the case that the number of the target topology structure is greater than 1, and executing the operation in the case that the number of the (i+1) th process is equal to 1.
The topology device of the hybrid grid provided by the embodiment of the present disclosure and the topology method of the hybrid grid provided by the embodiment of the present disclosure are the same inventive concept, and have the same beneficial effects as the method adopted, operated or implemented by the same.
The embodiment of the disclosure also provides a computer device for executing the topological method of the hybrid grid. Referring to fig. 6, a schematic diagram of a computer device according to some embodiments of the present disclosure is shown. As shown in fig. 6, the computer device 8 includes a processor 800, a memory 801, a bus 802 and a communication interface 803, where the processor 800, the communication interface 803 and the memory 801 are connected through the bus 802, and the memory 801 stores a computer program that can be run on the processor 800, where the processor 800 executes the topology method of the hybrid grid provided in any of the foregoing embodiments of the disclosure when the computer program is run.
The memory 801 may include a high-speed random access memory (RAM: random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. The communication connection between the device network element and the at least one other network element is achieved through at least one communication interface 803 (which may be wired or wireless), the internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
Bus 802 may be an ISA bus, a PCI bus, or an EISA bus, among others. The buses may be classified as address buses, data buses, control buses, etc. The memory 801 is configured to store a program, and the processor 800 executes the program after receiving an execution instruction, where the topology method of the hybrid grid disclosed in any of the foregoing embodiments of the disclosure may be applied to the processor 800 or implemented by the processor 800.
The processor 800 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the methods described above may be performed by integrated logic circuitry in hardware or instructions in software in processor 800. The processor 800 may be a general-purpose processor including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc., or may be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPTA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps and logic blocks of the disclosure in the embodiments of the disclosure may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present disclosure may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 801, and the processor 800 reads information in the memory 801 and performs the steps of the above method in combination with its hardware.
The computer device provided by the embodiments of the present disclosure and the topology method of the hybrid grid provided by the embodiments of the present disclosure are the same inventive concept, and have the same beneficial effects as the method adopted, operated or implemented by the same.
The disclosed embodiments also provide a computer readable storage medium corresponding to the hybrid grid topology method provided in the foregoing embodiments, where the computer readable storage medium is an optical disc, and a computer program (i.e., a computer program product) is stored thereon, and when the computer program is executed by a processor, the computer program performs the hybrid grid topology method provided in any of the foregoing embodiments.
It should be noted that examples of the computer readable storage medium may also include, but are not limited to, a phase change memory (PRAM), a Static Random Access Memory (SRAM), a Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a flash memory, or other optical or magnetic storage medium, which will not be described in detail herein.
The computer-readable storage medium provided by the above-described embodiments of the present disclosure has the same advantageous effects as the method adopted, operated or implemented by the application program stored therein, for the same inventive concept as the topology method of the hybrid grid provided by the embodiments of the present disclosure.
Referring to fig. 7, the computer program product 600 carries a program code, that is, a computer program 601, where the computer program 601 includes instructions for executing the steps of the hybrid mesh topology method described in the above method embodiment, and the detailed description of the method embodiment will be omitted.
Wherein the above-mentioned computer program product may be realized in particular by means of hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied as a computer storage medium, and in another alternative embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), or the like.
The basic principles of the present disclosure have been described above in connection with specific embodiments, but it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are merely examples and not limiting, and these advantages, benefits, effects, etc. are not to be considered as necessarily possessed by the various embodiments of the present disclosure. Furthermore, the specific details disclosed herein are for purposes of illustration and understanding only, and are not intended to be limiting, since the disclosure is not necessarily limited to practice with the specific details described.
The block diagrams of the devices, apparatuses, devices, systems referred to in this disclosure are merely illustrative examples and are not intended to require or imply that the connections, arrangements, configurations must be made in the manner shown in the block diagrams. As will be appreciated by one of skill in the art, the devices, apparatuses, devices, systems may be connected, arranged, configured in any manner. Words such as "including," "comprising," "having," and the like are words of openness and mean "including but not limited to," and are used interchangeably therewith. The terms "or" and "as used herein refer to and are used interchangeably with the term" and/or "unless the context clearly indicates otherwise. The term "such as" as used herein refers to, and is used interchangeably with, the phrase "such as, but not limited to.
In addition, as used herein, the use of "or" in the recitation of items beginning with "at least one" indicates a separate recitation, such that recitation 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), for example. Furthermore, the term "exemplary" does not mean that the described example is preferred or better than other examples.
It is also noted that in the systems and methods of the present disclosure, components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered equivalent to the present disclosure.
Various changes, substitutions, and alterations are possible to the techniques described herein without departing from the teachings of the techniques defined by the appended claims. Furthermore, the scope of the claims of the present disclosure is not limited to the particular aspects of the process, machine, manufacture, composition of matter, means, methods and acts described above. The processes, machines, manufacture, compositions of matter, means, methods, or acts, presently existing or later to be developed that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein may be utilized. Accordingly, the appended claims are intended to include within their scope such processes, machines, manufacture, compositions of matter, means, methods, or acts.
The previous 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 generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the disclosure to the form disclosed herein. Although a number of example aspects and embodiments have been discussed above, a person of ordinary skill in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.

Claims (8)

1. A method of topology of a hybrid mesh, comprising:
dividing data points included by nodes in a grid file based on the number of processes for generating the grid unit to obtain data points needing topology for each process, wherein the attribute of the data points is the grid type of the grid unit and/or the vertex forming the grid unit;
N data points with the latest topological sequence are obtained from data points which need topology in the ith process, wherein N is determined based on the number of vertexes corresponding to a target grid type, the target grid type is a grid type which is formed by the maximum number of vertexes in the node and belongs to a grid unit, and the ith process is any process;
acquiring target data points with attributes comprising the grid type from the N data points;
Determining a topological starting point of the (i+1) -th process based on the target data point and the data point of the (i+1) -th process needing topology, and carrying out grid topology on the N data points and the data point of the (i+1) -th process needing topology based on the topological starting point, wherein the topological starting point comprises a first data point in the N data points, wherein the first data point in the N data points is a target data point of which a grid unit cannot be generated and/or the data point of the (i+1) -th process needing topology;
determining a topology starting point of the (i+1) -th process based on the target data point and a data point of the (i+1) -th process requiring topology, including:
Acquiring the number of the remaining data points with the topological order later than that of the current target data point based on the topological order of the current target data point in the N data points, acquiring the number of the vertexes corresponding to the current target data point based on the grid type indicated by the current target data point, wherein the current target data point is any one target data point, and acquiring the attribute of the first data point in the data points with the (i+1) th process needing topology based on the data points with the (i+1) th process needing topology;
Determining the current target data point as the topology starting point under the condition that the number of the remaining data points is smaller than the number of the vertexes corresponding to the current target data point;
Determining the first data point as the topology starting point in the case that the attribute of the first data point comprises the grid type;
Based on the topology starting point, performing grid topology on the N data points and the data points of which the i+1th process needs topology, wherein the grid topology comprises:
Inserting the N data points in front of the first data point of the (i+1) th process to obtain a data point to be topologically of the (i+1) th process;
Calculating a theoretical topological sequence of target to-be-topological data points based on a target topological starting point, wherein the target topological starting point is any one topological starting point, and the target to-be-topological data points are to-be-topological data points with attribute characterization as grid types;
Acquiring a topological structure generated based on the target topological starting point under the condition that the attributes of the data points to be topological positioned in the theoretical topological sequence are all grid types;
And selecting a new target topology starting point from the rest topology starting points, and repeatedly executing the steps of calculating the theoretical topology sequence of the target data points to be topologically based on the target topology starting point until the rest topology starting point does not exist.
2. The method of topology of a hybrid grid of claim 1, wherein after repeatedly performing the step of calculating a theoretical topological order of target data points to be topologically based on target topological starting points until there are no remaining topological starting points, further comprising:
acquiring the number of topological structures generated by the (i+1) th process;
taking the topological structure as the final topological structure of the (i+1) th process under the condition that the number of topological structures generated by the (i+1) th process is equal to 1;
And determining the final topological structure of the (i+1) -th process from a plurality of topological structures generated by the (i+1) -th process based on the topological structure generated by the (i+1) -th process and/or the topological structure generated by the (i+2) -th process under the condition that the number of the topological structures generated by the (i+1) -th process is larger than 1.
3. The method of topology of a hybrid grid of claim 1, wherein after repeatedly performing the step of calculating a theoretical topological order of target data points to be topologically based on target topological starting points until there are no remaining topological starting points, further comprising:
Updating a pre-established topology quantity table based on the number of the obtained topological structures generated by the (i+1) th process, wherein the topology quantity table is used for recording the number of the topological structures generated by the (i) th process, the (i+1) th process and the (i+2) th process;
Updating the number of the topological structures generated by the (i+1) th process recorded by the topological quantity table based on the acquired number of the topological structures generated by the (i+2) th process and the (i+1) th process under the condition that the number of the topological structures generated by the (i+1) th process recorded by the updated topological quantity table is larger than 1;
And under the condition that the number of the topological structures generated by the (i+1) th process recorded after the topology quantity table is updated is equal to 1, updating the number of the topological structures generated by the (i+2) th process and the (i+2) th process to 1.
4. The method of topology of a hybrid grid of claim 2, wherein determining a final topology of an i+1th process from among a plurality of topologies generated by the i+1th process based on a topology generated by the i process and/or a topology generated by the i+2th process, comprises:
under the condition that the number of the topological structures generated by the ith process is equal to 1, based on the end point of the topological structure generated by the ith process, obtaining a correct topological starting point of the (i+1) th process, and determining a topological structure of which the target topological starting point is consistent with the correct topological starting point as a final topological structure of the (i+1) th process;
And determining a target topology structure from a plurality of topological structures generated by the (i+1) th process based on the possible topological start points and the possible topological end points of the (i+1) th process, obtaining the possible topological end points of the (i+1) th process based on the possible topological start points and the possible topological end points of the (i+1) th process, determining the target topology structure by taking the possible topological start points as topological start points and the possible topological end points as topological end points, determining the target topology structure as a final topological structure of the (i+1) th process in the case that the number of the target topology structure is equal to 1, waiting for the number of the (i+1) th process to be updated to 1 in the case that the number of the target topology structure is greater than 1, and executing the operation in the case that the number of the (i+1) th process is equal to 1.
5. A topology apparatus of a hybrid mesh, comprising:
The dividing module is used for dividing data points included in nodes in a grid file based on the number of processes for generating the grid units to obtain data points needing topology for each process, wherein the attributes of the data points are grid types to which the grid units belong and/or vertexes forming the grid units;
The system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring N data points with the latest topological sequence from data points with the topological requirement of the ith process, the N is determined based on the number of vertexes corresponding to a target grid type, the target grid type is the grid type of a grid unit formed by the maximum number of vertexes in the node, and the ith process is any process;
a second acquisition module, configured to acquire a target data point whose attribute includes the grid type from the N data points;
the topology module is used for determining a topology starting point of the (i+1) th process based on the target data point and the data point of the (i+1) th process needing topology, and carrying out grid topology on the N data points and the data point of the (i+1) th process needing topology based on the topology starting point, wherein the topology starting point comprises a first data point in the N data points, which cannot generate a target data point of a grid unit and/or the data point of the (i+1) th process needing topology;
determining a topology starting point of the (i+1) -th process based on the target data point and a data point of the (i+1) -th process requiring topology, including:
Acquiring the number of the remaining data points with the topological order later than that of the current target data point based on the topological order of the current target data point in the N data points, acquiring the number of the vertexes corresponding to the current target data point based on the grid type indicated by the current target data point, wherein the current target data point is any one target data point, and acquiring the attribute of the first data point in the data points with the (i+1) th process needing topology based on the data points with the (i+1) th process needing topology;
Determining the current target data point as the topology starting point under the condition that the number of the remaining data points is smaller than the number of the vertexes corresponding to the current target data point;
Determining the first data point as the topology starting point in the case that the attribute of the first data point comprises the grid type;
Based on the topology starting point, performing grid topology on the N data points and the data points of which the i+1th process needs topology, wherein the grid topology comprises:
Inserting the N data points in front of the first data point of the (i+1) th process to obtain a data point to be topologically of the (i+1) th process;
Calculating a theoretical topological sequence of target to-be-topological data points based on a target topological starting point, wherein the target topological starting point is any one topological starting point, and the target to-be-topological data points are to-be-topological data points with attribute characterization as grid types;
Acquiring a topological structure generated based on the target topological starting point under the condition that the attributes of the data points to be topological positioned in the theoretical topological sequence are all grid types;
And selecting a new target topology starting point from the rest topology starting points, and repeatedly executing the steps of calculating the theoretical topology sequence of the target data points to be topologically based on the target topology starting point until the rest topology starting point does not exist.
6. A computer device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the method of any of claims 1-4.
7. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any of claims 1-4.
8.A computer program product comprising a computer program, which, when executed by a processor, implements the method of any one of claims 1-4.
CN202411328026.9A 2024-09-23 2024-09-23 Topology method, device, equipment, storage medium and product of hybrid grid Active CN119440802B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411328026.9A CN119440802B (en) 2024-09-23 2024-09-23 Topology method, device, equipment, storage medium and product of hybrid grid

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411328026.9A CN119440802B (en) 2024-09-23 2024-09-23 Topology method, device, equipment, storage medium and product of hybrid grid

Publications (2)

Publication Number Publication Date
CN119440802A CN119440802A (en) 2025-02-14
CN119440802B true CN119440802B (en) 2025-07-15

Family

ID=94523083

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411328026.9A Active CN119440802B (en) 2024-09-23 2024-09-23 Topology method, device, equipment, storage medium and product of hybrid grid

Country Status (1)

Country Link
CN (1) CN119440802B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116820772A (en) * 2023-07-03 2023-09-29 中山大学 Grid parallel reading method, device, terminal equipment and readable storage medium
CN117786163A (en) * 2023-12-22 2024-03-29 杭州数梦工场科技有限公司 Spatial topological relationship verification method, device, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9250973B2 (en) * 2009-03-12 2016-02-02 Polycore Software, Inc. Apparatus and associated methodology of generating a multi-core communications topology
CN116822405A (en) * 2023-06-07 2023-09-29 南京航空航天大学 Fluid network topology structure self-identification method based on depth-first search

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116820772A (en) * 2023-07-03 2023-09-29 中山大学 Grid parallel reading method, device, terminal equipment and readable storage medium
CN117786163A (en) * 2023-12-22 2024-03-29 杭州数梦工场科技有限公司 Spatial topological relationship verification method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN119440802A (en) 2025-02-14

Similar Documents

Publication Publication Date Title
CN114281521B (en) Optimize deep learning heterogeneous resource communication efficiency methods, systems, equipment and media
CN116962438B (en) Gradient data synchronization method, system, electronic equipment and readable storage medium
CN110659284A (en) Block sequencing method and system based on tree graph structure and data processing terminal
CN111158680A (en) Page construction method, device, equipment and storage medium
CN109902056A (en) A method, apparatus, device and computer-readable storage medium for serial transmission
Yeh et al. Macro-star networks: efficient low-degree alternatives to star graphs
CN115310614B (en) Quantum circuit construction method, device and quantum computer operating system
Forster et al. The laplacian paradigm in the broadcast congested clique
CN119440802B (en) Topology method, device, equipment, storage medium and product of hybrid grid
CN118504609A (en) A distributed full-graph training computing method, system, device and storage medium for graph neural network
CN119203641B (en) A parallel reading method based on CGNS hybrid grid
CN117852803A (en) Distribution network construction resource scheduling method, device, computer equipment and storage medium
US20240119110A1 (en) Method, apparatus, electronic device and computer-readablestorage medium for computational flow graph schedulingscheme generation
US20240338213A1 (en) Quantum computing platform adaptation method and apparatus, and quantum computer operating system
CN113051297A (en) Transaction data query method and device, computer equipment and storage medium
CN110888892A (en) Block synchronization method, device and storage medium
Alam et al. GPU-based parallel algorithm for generating massive scale-free networks using the preferential attachment model
CN113591280B (en) Modelica model calculation method, device, equipment and storage medium
CN118118504A (en) Unified access configuration method, device, equipment and storage medium for Internet of things equipment
Pullan A population based hybrid metaheuristic for the p-median problem
CN112395272B (en) Communication algorithm database construction method, distributed machine device and storage medium
CN114118811A (en) Service code generation, execution method, apparatus, device and storage medium
CN115310613B (en) Quantum computing platform adaptation method and device and quantum computer operating system
CN120407240B (en) A data hashing method, apparatus, electronic device and storage medium
Boonma et al. Model-driven performance engineering for wireless sensor networks with feature modeling and event calculus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant