Analog simulation method of complex physical system based on multi-scale graph neural network
Through multi-scale graph neural network and adaptive messaging technology, the problems of high computational cost and limited message delivery range of traditional physical system simulation methods are solved, and more efficient and accurate physical system simulation is achieved.
Patent Information
- Application Number
- CN202411374859.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-27
AI Technical Summary
Traditional physical system simulation methods such as finite element method have high computational cost and long running time, and when physical constraints change, the entire simulation simulation process needs to be restarted, and the graph neural network has limited message delivery range on high-resolution grid diagrams. and oversmooth issue.
Adopting simulation method based on multi-scale graph neural network, the adaptive message delivery steps are designed by pre-generating multiple grid maps and demarcating molecular grid maps using the modified K-means algorithm, and the adaptive message delivery steps are designed through the encoder, processor and The decoder architecture generates embedded vectors and physical problem outputs, combining upsampling technology and adaptive messaging technology.
It improves the global information acquisition of graph neural networks in the early stages, alleviates the excessive smoothing problem caused by message delivery, improves the accuracy and efficiency of physical system simulation, and reduces computing overhead.
Smart Images

Figure CN119203770A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of simulation of complex physical systems. Background Art
[0002] The simulation of complex physical systems is important in many engineering fields, such as structural mechanics, aerodynamics, electromagnetism, and acoustics. Traditional physical system simulation relies on the numerical solution of partial differential equations (PDE). The widely used finite element method (FEM) discretizes the physical simulation input object into a finite element mesh G, which contains a number of mesh cells, each of which consists of a number of mesh nodes and mesh edges. The finite element method is based on the mesh G, and under certain physical constraints, it performs an iterative solution to obtain the physical simulation output at each node or cell. However, the finite element method has the problems of high computational cost and long running time, and when the physical constraints change, the entire simulation process needs to be restarted. For example, Figure 1 The input mesh G is a steering wheel. The physical constraints include: the steering column is fixed on the bottom plane; an external force F is applied to the spokes. The physical simulation output is the stress value of each node on the steering wheel. Summary of the invention
[0003] In order to solve the above problems, the present invention proposes a simulation method for complex physical systems based on a multi-scale graph neural network.
[0004] Technical solution of the present invention:
[0005] A simulation method for complex physical systems based on a multi-scale graph neural network includes the following steps:
[0006] Step 1: Generate R grid maps G R ,…,G 1 ; Among them, the grid graph G R The mesh with the highest resolution is equal to the finite element mesh G in the finite element method (FEM);
[0007] Step 2: Pre-generate sub-grid graphs: Use the modified K-means algorithm to pre-generate each grid graph G in step 1 r Divide the graph G into K sub-grids r,1 ,...,G r,K , R grid graphs G R ,…,G 1 Generate a total of R×K sub-grid graphs G 1,1 ,...,G 1 ,K ,...,GR,K ;
[0008] Step 3: Pre-generate the number of message passing steps: Design a step generation algorithm and use it to calculate the R×K sub-grid graph G obtained in step 2 1,1 ,...,G 1,K ,...,G R,K The number of message passing steps L 1,1 ,...,L 1,K ,...,L R ,K ;
[0009] Step 4 uses the encoder to generate an embedding vector: Use the encoder to transform the R×K sub-grid graph G in step 2 1,1 ,...,G 1,K ,...,G R,K The edge and node information is converted into an embedding vector;
[0010] Step 5: Update the embedding vector using the processor: Use the processor to update the embedding vector of each node and edge;
[0011] Step 6 Use the decoder to generate the physical problem output: The decoder converts G R The embedding vectors of each node are converted into the values of the physical problem with solution.
[0012] Beneficial effects:
[0013] Compared with the prior art, the upsampling technology of the present invention allows key nodes to enter the perception range of the model in the early stage of the graph neural network model, so that the model can obtain better global information; it alleviates the problem of over-smoothing caused by the propagation of messages on the fine grid graph in the early stage of the graph neural network. The adaptive message passing technology of the present invention improves the efficiency of message passing by setting different message passing steps; it overcomes the message loop on the grid graph and alleviates the problem of over-smoothing. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 Example of simulation results for a steering wheel, including (a) initial condition input: geometry and external forces; and (b) stress field calculated by the finite element solver.
[0015] Figure 2 This is an overview of the simulation method framework of the present invention.
[0016] Figure 3 Schematic diagram for estimating the number of message passing steps. DETAILED DESCRIPTION
[0017] In recent years, with the success of deep learning, many technologies have developed neural network models to simulate complex physical systems. Among them, the MeshGraphNets method [1] The input finite element mesh G is modeled as a graph structure of a graph neural network (hereinafter referred to as the mesh graph G). Then, through the encoder-processor-decoder architecture, a single-level graph neural network is used to learn the physical simulation process and output the physical simulation results of each node. However, the message transmission range of the graph neural network depends on the length of the mesh edge. The message transmission range of this method is limited and is affected by the over-smoothing problem of the graph neural network. [3-4] , the physical simulation error is higher on the grid map with higher resolution (shorter grid edges).
[0018] Improved method Multiscale-MeshGraphNet [2] The processor part is improved into a multi-level graph neural network, which contains two grid graphs with different resolutions: a fine grid graph G with higher resolution h , equal to the input grid map G; coarse grid map G with lower resolution (longer grid edges) l , obtained by the grid generator. This method is done by sequentially h → Downsampling → Coarse grid graph G l →Upsampling→fine grid map G h Message passing is performed on the coarse grid graph G l The longer mesh edges of the graph neural network are used to increase the message transmission range of the graph neural network. However, this method is still affected by the over-smoothing problem because there are a large number of loops on the grid graph (for example, each triangle in the triangular grid), which leads to a large number of message loops in the graph neural network, which in turn leads to the over-smoothing problem. Secondly, this method does not distinguish whether the node is a key node with physical constraints imposed on it. These nodes are not smoothed in the fine grid graph G. h The proportion in is very small. From the fine grid graph G h Initial message delivery will cause information from key nodes to be missed.
[0019] The technical solution provided by the present application will be further described below in conjunction with specific embodiments and accompanying drawings. The advantages and features of the present application will become more apparent with the following description.
[0020] The simulation method of complex physical systems based on multi-scale graph neural network includes the following steps:
[0021] Step 1 Pre-generate the grid map
[0022] Generate the R grid graphs G required by the algorithm R ,…,G 1 Among them, the grid graph GR The mesh with the highest resolution (smallest mesh element) is equal to the finite element mesh G in the finite element method (FEM).
[0023] 1.1 Input grid graph G R , using the Delaunay triangulation method (for example and not limitation) to triangulate the grid graph G R Coarsen the mesh elements on the geometric domain to generate a lower resolution mesh map G R-1 .
[0024] 1.2 Repeat step 1.1 to obtain a grid graph G with gradually decreasing resolution. R-2 ,…,G 1 , where the grid graph G 1 Corresponding to the grid map with the lowest resolution.
[0025] Step 2: Pre-generate sub-grid map
[0026] The modified K-means algorithm is further used to transform each grid graph G in step 1 r Divide the graph G into K sub-grids r,1 ,...,G r,K , R grid graphs G R ,…,G 1 Generate a total of R×K sub-grid graphs G 1,1 ,...,G 1,K ,...,G R,K , the modified K-means algorithm, the design steps are as follows:
[0027] 2.1 Input grid graph G 1 . Initialize K empty edge sets E 1 ,...,E K , and the corresponding K random direction vectors
[0028]
[0029] 2.2 For the grid graph G 1 Each directed edge E in ij , let its direction vector be Calculate the direction vector With K direction vectors The angle between is calculated according to the following formula:
[0030]
[0031] Where k = 1, 2, ..., K;
[0032] 2.3 Find the K angles θ obtained in 2.2 1 ,...,θ K The smallest angle θ k , the directed edge e ij Assigned to the corresponding edge set E k ;
[0033] 2.4 K direction vectors Update to K edge sets E respectively 1 ,...,E K The mean of the direction vectors of all edges in Where k = 1, 2, ..., K;
[0034] 2.5 Repeat 2.2 to 2.4, and the termination condition is K edge sets E 1 ,...,E K The edges in the are no longer changed (the termination condition is an example and not a limitation);
[0035] 2.6 The grid graph G 1 The node set V 1 , respectively with the K edge sets E obtained in 2.5 1 ,...,e K Form K new grid graphs G 1,1 ,...,G 1,K ;
[0036] 2.7 Repeat 2.1 to 2.6 and input G 1 ,...,G R , and finally output a total of R×K sub-grid graphs G 1,1 ,...,G 1,K ,...,G R,K .
[0037] Step 3: Pre-generate message delivery steps
[0038] The step number generation algorithm designed by the present invention is used to calculate the R×K sub-grid graphs G obtained in step 2 1,1 ,...,G 1,K ,...,G R,K The number of message passing steps L 1,1 ,...,L 1,K ,...,L R,K , the steps of the step number generation algorithm are designed as follows:
[0039] Among them, applicable to G 1 :
[0040] 3.1a Input G 1,1 For G 1,1For each connected component in , calculate its diameter separately. Among all the calculated diameters, find the maximum value and output it as L 1,1 .
[0041] The diameter of the connected component is defined as the maximum value of the length of the shortest path between all pairs of nodes on the connected component.
[0042] 3.2a Repeat 3.1a and input the remaining sub-grid graphs G with r=1 respectively 1,2 ,...,G 1,K , and finally output a total of K positive integers L 1,1 ,...,L 1,K .
[0043] Among them, applicable to G 2 ,...,G R , the following is G 2 Implementation steps:
[0044] 3.1b Input grid graph G with r=1 1 And the sub-grid graph G with r=2 2,1 For the grid graph G 1 Each grid cell in the subgrid graph G 2,1 Find the area contained by the grid cell, and calculate the diameter of each connected component in the area.
[0045] 3.2b Among all the calculated diameters, find the maximum value and output it as L 2,1 ;
[0046] The grid graph G 1 The area contained in the grid cell is defined as: sub-grid map G 2,1 The mid-space coordinates are within the region consisting of all nodes and edges within the grid unit.
[0047] The diameter of the connected component is defined as the maximum value of the length of the shortest path between all pairs of nodes on the connected component.
[0048] 3.3b Repeat 3.1b to 3.2b, and input the sub-grid graph G with r=2 respectively 2,1 ,...,G 2,K , and finally output a total of K positive integers L 2,1 ,...,L 2,K .
[0049] Step 4: Generate an embedding vector using the encoder
[0050] Use the encoder to transform the R×K sub-grid graph G in step 2 1,1 ,...,G 1,K ,...,G R,KThe edge and node information of each grid graph is converted into an embedding vector. The encoder of the embodiment uses a multi-layer perceptron (MLP), and uses the multi-layer perceptron (MLP) to input the edge features and node features of each grid graph and convert them into an embedding vector.
[0051] 4.1 Constructing edge features and node features
[0052] Given any undirected edge {v i ,v j}, can be viewed as two directed edges: directed edge e ij From Node v i To node v j and directed edge e ji From Node v j To node v i .
[0053] The input of each directed edge includes two features: ij , whose input includes the relative displacement vector v j -v i and a norm |v j -v i |, that is, the Euclidean distance between the two nodes associated with the edge; the directed edge e ji Same reason.
[0054] Among them, applicable to G R :Each node v i The input includes two features: a Boolean value I i Represents node v i Whether it is on the geometric boundary, as well as the initial conditions and boundary conditions related to the physical problem, such as the external force F related to static analysis in complex physical system scenarios.
[0055] Among them, applicable to G R-1 ,…,G 1 :Each node v i The input includes two features: a Boolean value I i Represents node v i Whether it is on the geometric boundary, and the original physical problem is usually only in the input graph G R = Node attributes are defined on G, so these attribute values need to be mapped to G through interpolation algorithms such as barycentric coordinates (for example and not limitation). R-1 ,…,G 1 on the node.
[0056] 4.2 Embedding Vectors
[0057] Using a Multi-Layer Perceptron (MLP), input the edge features and node features of each grid graph constructed in step 4.1, and transform them into embedding vectors.
[0058] Step 5 uses a processor to update the embedding vectors
[0059] The processor of the present invention is used to update the embedding vectors of each node and edge. Each neural network module f in the processor uses a Multi-Layer Perceptron (MLP) in this embodiment.
[0060] 5.1 Input K sub-grid graphs G of the r-th layer r,1 ,..., G r,K , and the corresponding message passing step L r,1 ,..., L r ,k ; 5.2 For each sub-grid graph G r,k , use a standard message passing-based GNN update mechanism to update the embedding vectors of nodes and edges. The formula is as follows:
[0061]
[0062] where k = 1…K and l = 0…L r,k -1, that is, for each sub-grid graph G r,k , the update mechanism is repeatedly executed L r,k times;
[0063] 5.3 Concatenate and fuse the embedding vectors of the nodes of the K sub-grid graphs G r,1 ,..., G r,K after 5.2 and assign them to the nodes of the grid graph G 1 , that is:
[0064]
[0065] 5.4 If r < R, perform an upsampling operation from the grid graph G r to the grid graph G r+1 . The process of the upsampling operation is as follows:
[0066] 5.4.1 For each node r+1 in the grid graph G , find the grid cell in the grid graph G 1 that contains this node, and then establish an edge from each vertex of this grid cell to ;
[0067] 5.4.2 Update the grid graph G r+1The embedding vectors of the nodes in :
[0068]
[0069] The grid unit contains a node defined as follows: the spatial coordinates of the node are located inside the grid unit.
[0070] 5.5 Repeat 5.1 to 5.4, input r=1,...,R respectively, and finally get the required G R The updated node embedding vector of .
[0071] Step 6: Use the decoder to generate the physical problem output
[0072] The decoder will G R The embedding vectors of each node are converted into the values with solutions for the physical problem, such as the stress value of each node in the static analysis problem in the complex physical system scenario. The decoder in this embodiment uses a multi-layer perceptron (MLP).
[0073] The above technical solution is based on the graph neural network with refined and anisotropic meshes (UA-MGN). In step 5, a multi-level graph neural network processor is designed, which includes two key technologies:
[0074] (1) Upsampling-only technique: Message passing is first performed on a coarse grid map, and then message passing is further performed on a fine grid map with higher resolution through upsampling until the desired output resolution grid map (i.e., the finite element grid map G) is obtained.
[0075] (2) Adaptive message passing technology: In view of the geometric characteristics of the grid graph, the adaptive message passing technology of the present invention first divides the edges of the grid graph into several groups according to their directions, and then sets different message passing steps for each group of edges, so that messages can be adaptively passed in different directions.
[0076] Based on the above two technologies, the present invention achieves the simulation accuracy of complex physical systems and reduces the simulation calculation overhead of complex physical systems.
[0077] The above description is only a description of the preferred embodiments of the present application, and is not intended to limit the scope of the present application. Any changes or modifications made by any person skilled in the art based on the above disclosed technical contents shall be deemed as equivalent effective embodiments and shall fall within the scope of protection of the technical solution of the present application.
[0078] References:
[0079] [1]T.Pfaff,M.Fortunato,A.Sanchez-Gonzalez,and P.W.Battaglia.Learningmesh-based
[0080] simulation with graph networks.In In 9th International Conference onLearning
[0081] Representations,ICLR’21,2021.
[0082] [2]M.Fortunato,T.Pfaff,P.Wirnsberger,A.Pritzel,andP.W.Battaglia.Multiscale
[0083] meshgraphnets.ArXiv,abs / 2210.00612,2022.
[0084] [3]D.Chen,Y.Lin,W.Li,P.Li,J.Zhou,and X.Sun.Measuring and relievingthe over-
[0085] smoothing problem for graph neural networks from the topologicalview.Proceedings ofthe AAAI Conference on Artificial Intelligence,34(04):3438–3445,Apr.2020.
[0086] [4]Q.Li,Z.Han,and X.-M.Wu.Deeper insights into graph convolutionalnetworks for
[0087] semi-supervised learning.In Proceedings of the Thirty-Second AAAIConference on
[0088] Artificial Intelligence and Thirtieth Innovative Applications ofArtificial Intelligence
[0089] Conference and Eighth AAAI Symposium on Educational Advances inArtificial
[0090] Intelligence,AAAI’18 / IAAI’18 / EAAI’18.AAAIPress,2018 。
Claims
1. A simulation method for complex physical systems based on multi-scale graph neural networks, characterized in that: Includes steps: Step 1: Generate R grid maps G R , ..., G 1 ; Among them, the grid graph G R The mesh with the highest resolution is equal to the finite element mesh G in the finite element method (FEM); Step 2: Pre-generate sub-grid graphs: Use the modified K-means algorithm to pre-generate each grid graph G in step 1 r Divide the graph G into K sub-grids r,1 , ..., G r,K , R grid graphs G R , ..., G 1 Generate a total of R×K sub-grid graphs G 1,1 , ..., G 1,K , ..., G R,K ; Step 3: Pre-generate the number of message passing steps: Design a step generation algorithm and use it to calculate the R×K sub-grid graph G obtained in step 2 1,1 , ..., G 1,K , ..., G R,K The number of message passing steps L 1,1 , ..., L 1,K , ..., L R,K ; Step 4 uses the encoder to generate an embedding vector: Use the encoder to transform the R×K sub-grid graph G in step 2 1,1 , ..., G 1 ,K , ..., G R,K The edge and node information is converted into an embedding vector; Step 5: Update the embedding vector using the processor: Use the processor to update the embedding vector of each node and edge; Step 6 Use the decoder to generate the physical problem output: The decoder converts G R The embedding vectors of each node are converted into the values of the physical problem with solution.
2. The method for simulating a complex physical system based on a multi-scale graph neural network according to claim 1, characterized in that: The step 1 comprises: 1.1 Input grid graph G R , use the Delaunay triangulation method to triangulate the grid graph G R Coarsening the mesh elements on the geometric domain to generate a lower resolution mesh map G R-1 ; 1.2 Repeat step 1.1 to obtain a grid graph G with gradually decreasing resolution. R-2 , ..., G 1 , where the grid graph G 1 Corresponding to the grid map with the lowest resolution.
3. The method for simulating a complex physical system based on a multi-scale graph neural network according to claim 1, characterized in that: The modified K-means algorithm described in step 2 is designed as follows: 2.1 Input grid graph G 1 ; Initialize K empty edge sets E 1 , ..., E K , and the corresponding K random direction vectors 2.2 For the grid graph G 1 Each directed edge e in ij , let its direction vector be Calculate the direction vector With K direction vectors The angle between is calculated according to the following formula: Where k = 1, 2, ..., K; 2.3 Find the K angles θ obtained in 2.2 1 , ..., θ K The smallest angle θ k , the directed edge e ij Assigned to the corresponding edge set E k ; 2.4 K direction vectors Update to K edge sets E respectively 1 , ..., E K The mean of the direction vectors of all edges in Where k = 1, 2, ..., K; 2.5 Repeat 2.2 to 2.4, and the termination condition is K edge sets E 1 , ..., E K The sides in the no longer change; 2.6 The grid graph G 1 The node set V 1 , respectively with the K edge sets E obtained in 2.5 1 , ..., E K Form K new grid graphs G 1 ,1 , ..., G 1,K ; 2.7 Repeat 2.1 to 2.6 and input G 1 , ..., G R , and finally output a total of R×K sub-grid graphs G 1,1 , ..., G 1 ,K , ..., G R,K .
4. The method for simulating a complex physical system based on a multi-scale graph neural network according to claim 1, characterized in that: In step 3, the steps of the step number generation algorithm are designed as follows: Among them, applicable to G 1 : 3.1a Input G 1,1 ; For G 1,1 For each connected component in the , calculate its diameter respectively; among all the calculated diameters, find the maximum value and output it as L 1,1 ; The diameter of the connected component is defined as: the maximum value of the length of the shortest path between all pairs of nodes on the connected component; 3.2a Repeat 3.1a and input the remaining sub-grid graphs G with r=1 respectively 1,2 , ..., G 1,K , and finally output a total of K positive integers L 1,1 , ..., L 1,K ; Among them, applicable to G 2 , ..., G R , the following is G 2 Implementation steps: 3.1b Input grid graph G with r = 1 1 And the sub-grid graph G with r=2 2,1 ; For the grid graph G 1 Each grid cell in the subgrid graph G 2,1 Find the area contained by the grid cell, and calculate the diameter of each connected component in the area; 3.2b Among all the calculated diameters, find the maximum value and output it as L 2,1 ; The grid graph G 1 The area contained in the grid cell is defined as: sub-grid map G 2,1 The region consisting of all nodes and edges whose mid-space coordinates are inside the grid unit; The diameter of the connected component is defined as: the maximum value of the length of the shortest path between all pairs of nodes on the connected component; 3.3b Repeat 3.1b to 3.2b, and input the sub-grid graph G with r=2 respectively 2,1 , ..., G 2,K , and finally output a total of K positive integers L 2,1 , ..., L 2,K .
5. The method for simulating a complex physical system based on a multi-scale graph neural network according to claim 1, characterized in that: Step 4: The encoder uses a multi-layer perceptron (MLP), uses the multi-layer perceptron (MLP), inputs edge features and node features of each grid graph, and converts the embedding vector; The steps include: 4.1 Constructing edge features and node features Given any undirected edge {v i , v j }, are considered as two directed edges: directed edge e ij From Node v i To node v j and directed edge e ji From Node v j To node v i ; The input of each directed edge includes two features: ij , whose input includes the relative displacement vector v j -v i and a norm |v j -v i |, that is, the Euclidean distance between the two nodes associated with the edge; the directed edge e ji Similarly; Among them, applicable to G R :Each node v i The input includes two features: a Boolean value I i Represents node v i Whether it is on a geometric boundary, and the initial and boundary conditions related to the physical problem; Among them, applicable to G R-1 , ..., G 1 :Each node v i The input includes two features: a Boolean value I i Represents node v i Is it on the geometric boundary, and the original physical problem is only in the input graph G R =Node attributes are defined on G, and these attribute values are mapped to G through interpolation algorithms such as barycentric coordinates R-1 , ..., G 1 On the node; 4.2 Embedding Vectors Use a multi-layer perceptron (MLP) to input the edge features and node features of each grid graph constructed in step 4.1 and convert them into embedding vectors.
6. The method for simulating a complex physical system based on a multi-scale graph neural network according to claim 1, characterized in that: In the step 5, each neural network module f in the processor uses a multi-layer perceptron (MLP); The steps include: 5.1 Input the K sub-grid graph G of the rth layer r,1 , ..., G r,K , and the corresponding message passing step L r,1 , ..., L r,K ; 5.2 For each subgrid graph G r,k , the standard GNN update mechanism based on message passing is used to update the embedding vectors of nodes and edges. The formula is as follows: Where k = 1...K and l = 0...L r,k -1, that is, for each subgrid graph G r,k , the update mechanism repeats L r,k Second-rate; 5.3 Put the K sub-grid graphs G after 5.2 r,1 , ..., G r,K The embedded vectors of the nodes are concatenated and fused, and assigned to the grid graph G 1 Nodes, namely: 5.4 If r < R, then perform upsampling operation on grid graph G r from grid graph G r+1 to grid graph G 5.5 Repeat 5.1 to 5.4, input r=1, ..., R respectively, and finally get the required G R The updated node embedding vector of .
7. The method for simulating a complex physical system based on a multi-scale graph neural network according to claim 6, characterized in that: The process of the upsampling operation is as follows: 5.4.1 For the grid graph G r+1 Each node in In the grid graph G 1 Find the grid cell containing the node, and then establish a connection from each vertex of the grid cell to The edge of 5.4.2 Update the grid graph G by the following formula r+1 The embedding vectors of the nodes in : The grid unit contains a node defined as follows: the spatial coordinates of the node are located inside the grid unit.
8. The method for simulating a complex physical system based on a multi-scale graph neural network according to claim 1, characterized in that: In the step 6, the decoder uses a multi-layer perceptron (MLP).
Citation Information
Patent Citations
MEMS membrane simulation method and system based on graphic neural network
CN117854643A
