A GNN-based preconditional iterative solution method and system for electromagnetic simulation

CN122221701BActive Publication Date: 2026-08-14SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-19
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

然而,这些传统预条件方法在大规模电磁仿真问题中,往往难以同时兼顾预处理质量与计算开销

Benefits of technology

[0078]1、显著提升了复杂电磁仿真问题的收敛速度与求解效率:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122221701B_ABST
    Figure CN122221701B_ABST
Patent Text Reader

Abstract

This invention relates to a method and system for solving a system of linear equations using a GNN preconditioning for electromagnetic simulation. The method includes: constructing an electromagnetic simulation model; establishing a system of linear equations to be solved using the finite element method; preprocessing the coefficient matrix of the linear equations to obtain initial decomposition factors; mapping the numerical features of the initial decomposition factors to a graph structure and constructing multidimensional enhanced edge feature vectors; obtaining graph data objects based on the multidimensional enhanced edge feature vectors and the graph structure; using a pre-trained graph neural network model to infer the graph data objects and predict the numerical correction amount for the initial decomposition factors; dividing the electromagnetic simulation model into topological sub-regions based on spatial features; weighting the numerical correction amount by different adjustment coefficients for each region and superimposing it onto the initial decomposition factors to obtain enhanced preconditioners; and loading the enhanced preconditioners into an iterative solver to complete the solution of the linear equations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a GNN preconditional iterative solution method and system for electromagnetic simulation, belonging to the fields of high-performance computing and artificial intelligence. Background Technology

[0002] With the continuous growth in demand for electromagnetic field analysis and engineering calculations, electromagnetic simulation technology has become an important technical tool in engineering design and analysis. Electromagnetic simulation is usually based on Maxwell's equations to establish an analytical model, and the finite element method is used for discretization and solution to obtain numerical results of the electromagnetic field distribution.

[0003] In the finite element method (FEM) discretization process, the electromagnetic simulation model ultimately forms a large-scale sparse linear system of equations to be solved. The coefficient matrix of this system not only exhibits significant sparsity but also possesses an extremely high condition number. To alleviate the performance pressure on the iterative solver, traditional methods typically introduce preconditioning techniques, constructing preconditioners to improve the spectral distribution characteristics of the original coefficient matrix. Common preconditioning methods include incomplete Cholesky decomposition (IC), incomplete LU decomposition (ILU), and Jacobi preconditioning. However, in large-scale electromagnetic simulation problems, these traditional preconditioning methods often struggle to simultaneously balance preconditioning quality and computational cost.

[0004] Graph Neural Networks (GNNs), with their efficient processing capabilities for non-Euclidean space data, offer a novel approach to extracting characteristics from sparse matrices. Introducing the topology-aware capabilities of GNNs into traditional numerical computation systems, leveraging their efficient parallel inference to correct the accuracy limitations of traditional preconditioners, is considered an ideal solution. Therefore, effectively constructing such a fusion mechanism to significantly reduce computational overhead and improve convergence speed while ensuring solution stability, thereby overcoming the performance bottleneck of large-scale electromagnetic simulations, has become a critical issue urgently needing to be addressed in this field. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a GNN preconditioning iterative solution method and system for electromagnetic simulation. The aim is to mine the implicit algebraic structure features of matrices through graph neural network technology and use the efficient reasoning capability of graph neural networks to correct the accuracy of traditional preconditioners. This significantly improves the convergence speed of the iterative solver in ill-conditioned electromagnetic problems while significantly reducing storage and computational burden.

[0006] The technical solution of the present invention is as follows:

[0007] One aspect of the present invention provides a GNN preconditional iterative solution method for electromagnetic simulation, comprising:

[0008] Step 1: Construct an electromagnetic simulation calculation model, establish the linear equation system to be solved using the finite element method, and preprocess the coefficient matrix in the linear equation system to obtain the initial decomposition factor;

[0009] Step 2: Map the numerical features of the initial decomposition factors to a graph structure and construct a multidimensional enhanced edge feature vector. Based on the multidimensional enhanced edge feature vector and the graph structure, obtain the graph data object.

[0010] Step 3: Construct a pre-trained graph neural network model and introduce a learnable coefficient vector during pre-training to obtain the adjustment coefficient; use the pre-trained graph neural network model to infer graph data objects and predict the numerical correction amount for the initial decomposition factor.

[0011] The pre-trained graph neural network model includes an encoder layer, multiple message passing layers, and a decoder layer.

[0012] The encoder layer maps the low-dimensional physical space node features of graph data objects to a high-dimensional latent feature space.

[0013] By aggregating neighborhood information through multiple message passing layers, the implicit characteristics of nodes are updated;

[0014] The numerical correction amount is output through the decoder layer;

[0015] Step 4: Divide the topological sub-regions according to the spatial characteristics of the electromagnetic simulation calculation model, use different adjustment coefficients to weight the numerical correction amount in different regions, and superimpose them on the initial decomposition factor to obtain the enhanced preconditioner.

[0016] Step 5: Load the enhanced preconditioner into the iterative solver to solve the linear equations, and perform electromagnetic simulation calculations based on the solution results.

[0017] According to a preferred embodiment of the present invention, the specific implementation process of step 1 includes:

[0018] Mathematical modeling is performed based on the geometric shape, material parameters, and excitation conditions of the electromagnetic simulation object to construct an electromagnetic simulation calculation model. The computational domain is then discretized using the finite element method to form a large-scale sparse linear equation system to be solved. ;

[0019] Wherein, the coefficient matrix This represents the coefficient matrix and vector formed by discretizing the electromagnetic simulation model using the finite element method. This represents the vector of right-hand side terms formed by external excitation conditions. This represents the vector of degrees of freedom of the electromagnetic field to be solved;

[0020] Using the incomplete Cholesky decomposition algorithm on the coefficient matrix Preprocessing is performed to obtain the initial decomposition factors. .

[0021] According to a preferred embodiment of the present invention, step 2 includes the following specific implementation process:

[0022] In generating initial decomposition factors Then, the initial decomposition factors are extracted. The row and column indices of non-zero elements are used as a set of nodes to construct a directed graph topology representing electromagnetic spatial coupling relationships. ;in, Represents a set of nodes. Represents the set of edges;

[0023] Constructing a multidimensional enhanced edge feature vector includes: adjusting the initial decomposition factors. Each non-zero element value in Normalization is performed to obtain feature attributes. ;

[0024] In the node set, the nodes Sending degree and node The received degree is normalized to the maximum degree of the entire graph, that is, the maximum degree of the entire graph is divided by the node. Sending degree and node The normalized transmission score is obtained from the received score. and normalized receptivity ;

[0025] Through the non-zero element values ​​of the off-diagonal elements The absolute value of the corresponding main diagonal element The ratio of their absolute values ​​yields the relative coupling strength. ,in As shown below:

[0026] ;

[0027] feature attributes Normalized transmission degree Normalized reception degree and relative coupling strength By concatenating the features, we obtain the multidimensional enhanced edge feature vector. The expression is:

[0028] ;

[0029] The multidimensional enhanced edge feature vectors corresponding to all directed edges. Constructing an edge feature set The expression is:

[0030] ;

[0031] in, Let i represent the edge pointing from node i to node j; initialize the input features of each node to a constant 1 to obtain the node feature set. :

[0032] ;

[0033] in, Represents a node Node characteristics, Represents a node ;

[0034] Ultimately, this will result in a directed graph topology. Edge feature set and node feature set Combined together, graph data objects are constructed. .

[0035] According to a preferred embodiment of the present invention, a learnable coefficient vector is introduced during pre-training to obtain the adjustment coefficient; including:

[0036] During the pre-training of a graph neural network model, a learnable coefficient vector is introduced that is simultaneously optimized during training. , The total number of vectors, vector Each component is set to 0 during the initial training phase of the graph neural network model;

[0037] Let the training objective function be denoted as . ,in, This represents the parameters of the graph neural network model; during training iterations, the adjustment coefficients are updated using the following formula:

[0038] ;

[0039] in, Indicates the first During the nth iteration One adjustment coefficient , Indicates the learning rate. Indicates the first During the nth iteration One adjustment coefficient; after training convergence, the adjustment coefficients are obtained. .

[0040] According to a preferred embodiment of the present invention, a pre-trained graph neural network model is used to infer graph data objects and predict the numerical correction amount for the initial decomposition factor; including:

[0041] graph data objects As input data, it is fed into the encoder layer of a pre-trained graph neural network model;

[0042] The encoder layer includes linear transformation operations and nonlinear activation operations. The encoder layer receives... Multidimensional enhanced edge feature vectors It performs learnable linear transformation operations and nonlinear activation operations, and the calculation process is as follows:

[0043] ;

[0044] in, Let be the initial embedding vector of the edge in the latent space. This represents the weight matrix of the encoder layer. For multidimensional enhanced edge feature vectors, This represents the bias vector. Represents a nonlinear activation function;

[0045] The initial embedding vector is processed through multiple message passing layers. The update process is performed, with each message passing layer including node feature update operations and edge feature update operations.

[0046] For the Any node in the message passing layer The node feature update operation updates the node representation by aggregating information from neighboring nodes. The update process is represented as follows:

[0047] ;

[0048] in, Represents a node In the The feature vector of the layer, and ; Represents a node In the The feature vector of the layer, and , Indicates the connection node and Edge features, The weight matrix is ​​a learnable matrix. Represents a node The set of adjacent nodes, It is an aggregate function. It is a non-linear activation function;

[0049] After the node feature update operation, the edge feature update operation is performed. The update process is represented as follows:

[0050] ;

[0051] in, Indicates the first Edge features updated by layer; and Representing nodes respectively With nodes In the The layer completes the feature vector update; This is the learnable weight matrix for the edge update phase; Indicates feature splicing or combination operations; Represents a nonlinear mapping function;

[0052] Finally, after After iterative propagation through the message-passing layer, the final edge features are obtained. ;

[0053] edge features The input is a decoder layer, which is a multilayer perceptron network. This network predicts the positions of non-zero elements in the sparse matrix. The numerical correction at that point, the prediction process is expressed as:

[0054] ;

[0055] in, The multilayer perceptron network is represented. Indicates position The numerical correction amount at that location.

[0056] According to a preferred embodiment of the present invention, step 4 specifically includes the following steps:

[0057] Based on the non-uniformity of different physical media or geometric distributions in the electromagnetic simulation model, the topological adjacency space of the computational domain nodes, i.e., the graph node set, is pre-divided into... Each connected subregion, with adjustment coefficient The coefficient vector is selected as the adjustment coefficient for the numerical correction. The predicted numerical correction is then subjected to regionally differentiated weighted scaling and superimposed on the initial decomposition factor, as shown below:

[0058] ;

[0059] in, Indicates the location The lower triangular matrix element at that position, Represents the coefficient vector The first in One portion, ;

[0060] All matrix elements After weighted scaling, a lower triangular matrix is ​​formed. Based on the lower triangular matrix Obtain the enhanced preconditioner .

[0061] According to a preferred embodiment of the present invention, step 5 includes the following specific implementation process:

[0062] The BiCGSTAB method, which uses a Krylov subspace iterative solver to stabilize the biconjugate gradient method, generates enhanced preconditioners. Loaded into BiCGSTAB as a left preconditioning operator;

[0063] In each step of the iterative solution, the solver, BiCGSTAB, solves the preprocessed equations. ;

[0064] When the iterative residual decreases to a preset convergence threshold, the solution is considered converged, and the final unknown vector is output. That is, the numerical solution of the electromagnetic field distribution required for electromagnetic simulation, and the electromagnetic simulation calculation is completed based on the numerical solution of the electromagnetic field distribution.

[0065] A computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of a GNN preconditional iterative solution method for electromagnetic simulation.

[0066] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of a GNN preconditioned iterative solution method for electromagnetic simulation.

[0067] A second aspect of the present invention provides a GNN preconditional iterative solution system for electromagnetic simulation, comprising:

[0068] The preprocessing module is configured to: construct an electromagnetic simulation calculation model, establish the linear equation system to be solved using the finite element method, and preprocess the coefficient matrix in the linear equation system to obtain the initial decomposition factor;

[0069] The graph data object construction module is configured to: map the numerical features of the initial decomposition factors to a graph structure, construct multidimensional enhanced edge feature vectors, and obtain graph data objects based on the multidimensional enhanced edge feature vectors and the graph structure;

[0070] The numerical correction prediction module is configured to: construct a pre-trained graph neural network model and introduce a learnable coefficient vector during pre-training to obtain the adjustment coefficient; use the pre-trained graph neural network model to infer the graph data object and predict the numerical correction for the initial decomposition factor.

[0071] The pre-trained graph neural network model includes an encoder layer, multiple message passing layers, and a decoder layer.

[0072] The encoder layer maps the low-dimensional physical space node features of graph data objects to a high-dimensional latent feature space.

[0073] By aggregating neighborhood information through multiple message passing layers, the implicit characteristics of nodes are updated;

[0074] The numerical correction amount is output through the decoder layer;

[0075] The region weighting module is configured to: divide the topological sub-regions according to the spatial characteristics of the electromagnetic simulation calculation model, use different learnable adjustable coefficients to perform regional weighting of the numerical correction amount, and superimpose it on the initial decomposition factor to obtain the enhanced preconditioner;

[0076] The solver module is configured to: load enhanced preconditioners into the iterative solver, solve the linear equation system, and perform electromagnetic simulation calculations based on the solution results.

[0077] The beneficial effects of this invention are as follows:

[0078] 1. Significantly improves the convergence speed and solution efficiency of complex electromagnetic simulation problems:

[0079] This invention introduces a multi-dimensional enhanced edge feature mechanism, incorporating normalized element values, the connectivity degree of sending and receiving nodes, and relative coupling strength into the edge feature representation process. This enhances the graph neural network's ability to perceive local topological structures and off-diagonal algebraic coupling relationships. Compared to techniques that only employ a single scalar edge feature, this invention can more accurately predict the numerical correction of the initial decomposition factor, thereby improving the construction quality of the preconditioner.

[0080] 2. Fully guarantees regional adaptive correction capability in complex multi-medium electromagnetic environments:

[0081] This invention introduces a region-differentiated learnable adjustment coefficient based on topological sub-region partitioning, enabling the numerical correction amount output by the neural network to be adaptively weighted according to the matrix characteristics of different medium or geometric regions. This mechanism sets the adjustment coefficients of each region to zero during the initial training phase, which facilitates a smooth start for the model from an uncorrected, incomplete Cholesky decomposition state. While maintaining the overall stability of traditional numerical methods, it improves the ability to finely correct locally ill-conditioned regions.

[0082] 3. Effectively enhances the model's generalization robustness and reduces inference overhead:

[0083] This invention employs a lightweight graph structure mapping and multi-dimensional edge feature enhancement method, which improves the model's adaptability to problems with different grid sizes, media distributions, and ill-conditioned degrees, while effectively reducing the additional computational overhead in the model inference process. Thus, while ensuring solution accuracy and convergence performance, it further enhances the overall engineering application value of the method. Attached Figure Description

[0084] Figure 1 This is a schematic diagram illustrating the application environment of the GNN preconditional iterative solution method for electromagnetic simulation based on the present invention.

[0085] Figure 2 This is a flowchart of the GNN preconditional iterative solution method for electromagnetic simulation according to the present invention.

[0086] Figure 3 This is a schematic diagram of the encoding-message passing-decoding architecture of the graph neural network of the present invention;

[0087] Figure 4 This is a system structure diagram of the GNN preconditional iterative solution of equations for electromagnetic simulation according to the present invention;

[0088] Figure 5 This is a comparison chart of the solution time of two preconditioning methods under different grid sizes according to the present invention. Detailed Implementation

[0089] The present invention will be further described below with reference to the embodiments and accompanying drawings, but is not limited thereto.

[0090] Example 1

[0091] Terminology Explanation:

[0092] 1. Incomplete Cholesky Decomposition Algorithm: The incomplete Cholesky decomposition algorithm is a commonly used preprocessing technique for solving symmetric positive definite sparse linear equation systems. This algorithm approximates the Cholesky decomposition of the original coefficient matrix while preserving the sparse structure of the matrix, obtaining decomposition factors in the form of lower triangular matrices. These factors are used to construct preconditioners, thereby improving the numerical properties of the linear equation system and accelerating the iterative solution process.

[0093] 2. Stable Biconjugate Gradient Method (BiCGSTAB) for Krylov Subspace Iterative Solvers: The Stable Biconjugate Gradient Method (BiCGSTAB) is an iterative solution algorithm based on the Krylov subspace. This method introduces a stabilization strategy on top of the Biconjugate Gradient Method (BiCG), approximating the solution to the system of equations by progressively expanding the Krylov subspace, thereby improving the stability and convergence performance of the solution process. It is widely used in engineering numerical computation.

[0094] A GNN preconditional iterative solution method for electromagnetic simulation, such as Figure 1-4 As shown, it includes:

[0095] Step 1: Construct an electromagnetic simulation calculation model, establish the linear equation system to be solved using the finite element method, and preprocess the coefficient matrix in the linear equation system to obtain the initial decomposition factor;

[0096] Step 2: Map the numerical features of the initial decomposition factors to a graph structure and construct a multidimensional enhanced edge feature vector. Based on the multidimensional enhanced edge feature vector and the graph structure, obtain the graph data object.

[0097] Step 3: Construct a pre-trained graph neural network model and introduce a learnable coefficient vector during pre-training to obtain the adjustment coefficient; use the pre-trained graph neural network model to infer graph data objects and predict the numerical correction amount for the initial decomposition factor.

[0098] The pre-trained graph neural network model includes an encoder layer, multiple message passing layers, and a decoder layer.

[0099] The encoder layer maps the low-dimensional physical space node features of graph data objects to a high-dimensional latent feature space.

[0100] By aggregating neighborhood information through multiple message passing layers, the implicit characteristics of nodes are updated;

[0101] The numerical correction amount is output through the decoder layer;

[0102] Step 4: Divide the topological sub-regions according to the spatial characteristics of the electromagnetic simulation calculation model, use different adjustment coefficients to weight the numerical correction amount in different regions, and superimpose them on the initial decomposition factor to obtain the enhanced preconditioner.

[0103] Step 5: Load the enhanced preconditioner into the iterative solver to solve the linear equations, and perform electromagnetic simulation calculations based on the solution results.

[0104] Example 2

[0105] The method for solving a system of equations using GNN preconditions for electromagnetic simulation as described in Example 1 differs in that it includes:

[0106] The specific implementation process of step 1 includes:

[0107] Modeling is performed based on the geometric structure, material parameters, and excitation conditions of the electromagnetic simulation object. An electromagnetic simulation calculation model based on Maxwell's equations is constructed. This electromagnetic simulation calculation model is a partial differential equation model for numerical solution. The computational domain is discretized using the finite element method to form a large-scale sparse linear equation system to be solved. ;

[0108] Wherein, the coefficient matrix This represents the parameters and structural information of the simulation region (such as dielectric constant). magnetic permeability and conductivity The coefficient matrix and vector formed by discretization (etc.) The vector represents the electromagnetic source vector (current density source and magnetic flux density source, etc.) under external excitation conditions, and the vector x represents the physical quantity of the electromagnetic field distribution to be solved (the degree of freedom component of the electric field intensity at each grid node in the calculation region).

[0109] Using the incomplete Cholesky decomposition algorithm on the coefficient matrix Preprocessing is performed to obtain the initial decomposition factors. It is used to approximate the numerical structure characteristics of the original system of equations.

[0110] The specific implementation process of step 2 includes:

[0111] In generating initial decomposition factors Then, the initial decomposition factors are extracted. The row and column indices of non-zero elements are used as a set of nodes to construct a directed graph topology representing electromagnetic spatial coupling relationships. ;in, Represents a set of nodes. Represents a set of edges (row and column pairs of non-zero elements);

[0112] To enhance the model's ability to perceive the coupling strength between local graph topology and non-main diagonal elements of the matrix, for any directed edge... Extracting multidimensional enhanced edge feature vectors Constructing a multidimensional enhanced edge feature vector includes: adjusting the initial decomposition factors. Each non-zero element value in Normalization is performed to obtain feature attributes. ;

[0113] In the node set, the nodes Outgoing degree and node The in-degrees of each node are normalized to the maximum degree of the entire graph, i.e., the maximum degree of the entire graph is divided by the node. Sending degree and node The normalized transmission score is obtained from the received score. and normalized receptivity ;

[0114] Through the non-zero element values ​​of the off-diagonal elements The absolute value of the corresponding main diagonal element The ratio of their absolute values ​​yields the relative coupling strength. ,in As shown below:

[0115] ;

[0116] feature attributes Normalized transmission degree Normalized reception degree and relative coupling strength By concatenating the features, we obtain the multidimensional enhanced edge feature vector. The expression is:

[0117] ;

[0118] The multidimensional enhanced edge feature vectors corresponding to all directed edges. (one side) The multidimensional enhanced edge feature vectors extracted above are used to construct an edge feature set. The expression is:

[0119] ;

[0120] in, This represents the edge pointing from node i to node j. To accelerate neural network convergence and mitigate the numerical scale differences caused by different electromagnetic medium parameters, the input features of each node are uniformly initialized to a constant 1, resulting in the node feature set. :

[0121] ;

[0122] in, Represents a node Node characteristics, Represents a node This generates standardized model input features that are independent of specific stimulus sources;

[0123] Ultimately, this will result in a directed graph topology. Edge feature set and node feature set Combined together, graph data objects are constructed. .

[0124] During pre-training, a learnable coefficient vector is introduced to obtain the adjustment coefficient; including:

[0125] During the pre-training of the graph neural network model, the pre-training dataset is constructed as follows: A finite element mesh size, material parameter range, and excitation conditions are preset to generate electromagnetic simulation training samples; for each electromagnetic simulation training sample, an electromagnetic simulation calculation model based on Maxwell's equations is constructed according to the aforementioned method, and the computational domain is discretized using the finite element method to form the corresponding sparse linear equation system Ax=b; the corresponding reference solution x is obtained through numerical solution, and the coefficient matrix A, the right-hand side term vector b, and the reference solution x are used as components of the pre-training dataset;

[0126] During the pre-training of a graph neural network model, a learnable coefficient vector is introduced that is simultaneously optimized during training. , The total number of vectors (e.g.) ),vector Each component is set to 0 in the initial stage of training the graph neural network model to ensure that the training process evolves smoothly from the standard linear algebra decomposition logic.

[0127] To obtain the adjustment coefficients corresponding to each topological sub-region, the training objective function is denoted as... ,in, This represents the parameters of the graph neural network model; during training iterations, the adjustment coefficients are updated using the following formula:

[0128] ;

[0129] in, Indicates the first During the nth iteration One adjustment coefficient , Indicates the learning rate. Indicates the first During the nth iteration One adjustment coefficient; after training convergence, the adjustment coefficients are obtained. .

[0130] Using a pre-trained graph neural network model to infer from graph data objects, the system predicts numerical corrections for initial factorization; including:

[0131] graph data objects As input data, it is fed into the encoder layer of a pre-trained graph neural network model;

[0132] The encoder layer includes linear transformation operations and nonlinear activation operations. The encoder layer receives... Multidimensional enhanced edge feature vectors It performs learnable linear transformation operations and nonlinear activation operations, and the calculation process is as follows:

[0133] ;

[0134] in, Let be the initial embedding vector of the edge in the latent space. This represents the weight matrix of the encoder layer. For multidimensional enhanced edge feature vectors, This represents the bias vector. Represents a nonlinear activation function (such as...) );

[0135] The initial embedding vector is processed through multiple message passing layers. The update process is performed, with each message passing layer including node feature update operations and edge feature update operations.

[0136] For the Any node in the message passing layer The node feature update operation updates the node representation by aggregating information from neighboring nodes. The update process is represented as follows:

[0137] ;

[0138] in, Represents a node In the The feature vector of the layer, and ; Represents a node In the The feature vector of the layer, and , Indicates the connection node and Edge features, The weight matrix is ​​a learnable matrix. Represents a node The set of adjacent nodes, For aggregate functions (such as the maximum value function) Summation function or minimum value function ), For nonlinear activation functions (such as modified linear unit functions) or function);

[0139] After the node feature update operation, the edge feature update operation is performed. The update process is represented as follows:

[0140] ;

[0141] in, Indicates the first Edge features updated by layer; and Representing nodes respectively With nodes In the The layer completes the feature vector update; This is the learnable weight matrix for the edge update phase; This indicates a feature concatenation or combination operation; Represents nonlinear mapping functions (such as modified linear unit functions) or function);

[0142] Finally, after After iterative propagation through the message-passing layer, the final edge features are obtained. ;

[0143] edge features The input is a decoder layer, which is a multilayer perceptron network. This network predicts the positions of non-zero elements in the sparse matrix. Numerical corrections at the initial decomposition factor; due to the use of incomplete Cholesky decomposition, the model only needs to predict the initial decomposition factor. Correction amount The prediction process is represented as follows:

[0144] ;

[0145] in, The multilayer perceptron network is represented. Indicates position The numerical correction amount at this point; this step only applies to... The non-zero element positions are calculated, and the corresponding residual correction value is directly output.

[0146] Step 4 includes the following specific implementation process:

[0147] Based on the non-uniformity of different physical media or geometric distributions in the electromagnetic simulation model, the topological adjacency space of the computational domain nodes, i.e., the graph node set, is pre-divided into... Each connected subregion, with adjustment coefficient The coefficient vector is selected as the adjustment coefficient for the numerical correction. The predicted numerical correction is then subjected to regionally differentiated weighted scaling and superimposed on the initial decomposition factor, as shown below:

[0148] ;

[0149] in, Indicates the location The lower triangular matrix element at that position, Represents the coefficient vector The first in One portion, Through the aforementioned regional mapping relationship, the numerical correction amount within different sub-regions can be adjusted by the corresponding adjustment coefficients. Separate control;

[0150] All matrix elements After weighted scaling, a lower triangular matrix is ​​formed. Based on the lower triangular matrix Obtain the enhanced preconditioner .

[0151] This step organically integrates the correction amount with the initial factor, which not only preserves the stability of the traditional algorithm, but also incorporates the prediction accuracy of the neural network.

[0152] The specific implementation process of step 5 includes:

[0153] The BiCGSTAB method, which uses a Krylov subspace iterative solver to stabilize the biconjugate gradient method, generates enhanced preconditioners. Loaded into BiCGSTAB as a left preconditioning operator;

[0154] In each step of the iterative solution, the solver, BiCGSTAB, solves the preprocessed equations. ;

[0155] Solve for the form in each iteration as follows The auxiliary equation, because It has been decomposed into and This auxiliary equation can be solved quickly by two trigonometric back substitutions;

[0156] When the iterative residual decreases to the preset convergence threshold ( Determine if the solution converges, and output the final vector of unknowns. That is, the numerical solution of the electromagnetic field distribution required for electromagnetic simulation, and the electromagnetic simulation calculation is completed based on the numerical solution of the electromagnetic field distribution.

[0157] To further verify the effectiveness of the proposed method in actual numerical simulation, a standardized simulation test environment was constructed, and a comparative experiment was conducted with the incomplete decomposition preconditioning technique commonly used in traditional methods.

[0158] In this embodiment, the hardware environment includes an Intel Core i5-12490F CPU and an NVIDIA RTX 4060 GPU, the software environment includes a Linux operating system and Python 3.9, and sparse matrix operations and model inference are performed using relevant scientific computing libraries.

[0159] To simulate the non-uniform medium distribution and its ill-conditioned characteristics commonly found in electromagnetic simulations of actual engineering projects, a non-uniform medium parameter field is generated based on Gaussian random fields, and a corresponding electromagnetic simulation calculation model is established based on Maxwell's equations. The calculation domain is discretized using the finite element method to generate sparse linear equations of different scales.

[0160] The experiment set up three sets of stress tests with different grid sizes, and the grid dimensions were as follows: , and The number of unknowns in the corresponding linear equation system increased from 9,216 to 16,384.

[0161] For each grid size, the traditional incomplete Cholesky decomposition method and the GNN method proposed in this invention are used as preconditions, respectively. The iterative solver is the stable biconjugate gradient method (BiCGSTAB), and the convergence criterion is set to a relative residual of less than 10. -6 The maximum number of iterations is set to 1000.

[0162] Figure 5 The diagram shows a comparison of the solution times of two preconditioning methods under different grid sizes in embodiments of the present invention. The horizontal axis represents the grid size, and the vertical axis represents the average solution time (in seconds). Dark gray bars represent the incomplete Cholesky decomposition method, and light gray bars represent the GNN method proposed in this invention.

[0163] In terms of computation time, the solution time of the traditional incomplete Cholesky decomposition method shows a significant increasing trend. Especially... On large-scale grids, the incomplete Cholesky decomposition method averages 20.22 seconds. In contrast, while the method of this invention introduces a small amount of graph neural network inference overhead, it achieves extremely high convergence efficiency. The total solution time under grid conditions is only 9.93 seconds. Compared with traditional techniques, the method in this application achieves approximately 2 times the computational speedup for large-scale problems.

[0164] Experimental results show that, while ensuring convergence accuracy, the method of this invention can effectively reduce the number of iterations and the total solution time, thereby improving the solution efficiency of large-scale ill-conditioned sparse linear equation systems. Compared with the traditional incomplete Cholesky decomposition technique, the enhanced preconditioner constructed in this invention significantly reduces the computational overhead in complex electromagnetic simulation scenarios while ensuring convergence accuracy.

[0165] Furthermore, the specific architecture of the graph neural network is not limited to the encoder-message-decoder structure described in the embodiments. Variations such as graph attention network (GAT) or graph isomorphic network (GIN) can also be used to learn algebraic residuals. All these obvious changes made in accordance with the technical concept of the present invention are within the protection scope of the present invention.

[0166] Example 3

[0167] A computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the GNN preconditional iterative solution method for electromagnetic simulation described in Embodiment 1 or 2.

[0168] Example 4

[0169] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the GNN preconditioned iterative solution method for electromagnetic simulation as described in Embodiment 1 or 2.

[0170] Example 5

[0171] A GNN preconditional iterative solution system for electromagnetic simulation includes:

[0172] The preprocessing module is configured to: construct an electromagnetic simulation calculation model, establish the linear equation system to be solved using the finite element method, and preprocess the coefficient matrix in the linear equation system to obtain the initial decomposition factor;

[0173] The graph data object construction module is configured to: map the numerical features of the initial decomposition factors to a graph structure, construct multidimensional enhanced edge feature vectors, and obtain graph data objects based on the multidimensional enhanced edge feature vectors and the graph structure;

[0174] The numerical correction prediction module is configured to: construct a pre-trained graph neural network model and introduce a learnable coefficient vector during pre-training to obtain the adjustment coefficient; use the pre-trained graph neural network model to infer the graph data object and predict the numerical correction for the initial decomposition factor.

[0175] The pre-trained graph neural network model includes an encoder layer, multiple message passing layers, and a decoder layer.

[0176] The encoder layer maps the low-dimensional physical space node features of graph data objects to a high-dimensional latent feature space.

[0177] By aggregating neighborhood information through multiple message passing layers, the implicit characteristics of nodes are updated;

[0178] The numerical correction amount is output through the decoder layer;

[0179] The region weighting module is configured to: divide the topological sub-regions according to the spatial characteristics of the electromagnetic simulation calculation model, use different learnable adjustable coefficients to perform regional weighting of the numerical correction amount, and superimpose it on the initial decomposition factor to obtain the enhanced preconditioner;

[0180] The solver module is configured to: load enhanced preconditioners into the iterative solver, solve the linear equation system, and perform electromagnetic simulation calculations based on the solution results.

Claims

1. A GNN preconditional iterative solution method for electromagnetic simulation, characterized in that, include: Step 1: Construct an electromagnetic simulation model, establish the system of linear equations to be solved using the finite element method, and preprocess the coefficient matrix of the linear equations to obtain the initial decomposition factors; including: Mathematical modeling is performed based on the geometric shape, material parameters, and excitation conditions of the electromagnetic simulation object to construct an electromagnetic simulation calculation model. The computational domain is then discretized using the finite element method to form a large-scale sparse linear equation system to be solved. ; Wherein, the coefficient matrix This represents the coefficient matrix and vector formed by discretizing the electromagnetic simulation model using the finite element method. This represents the vector of right-hand side terms formed by external excitation conditions. This represents the vector of degrees of freedom of the electromagnetic field to be solved; Using the incomplete Cholesky decomposition algorithm on the coefficient matrix Preprocessing is performed to obtain the initial decomposition factors. ; Step 2: Map the numerical features of the initial decomposition factors to a graph structure and construct a multidimensional enhanced edge feature vector. Based on the multidimensional enhanced edge feature vector and the graph structure, obtain the graph data object. Step 3: Construct a pre-trained graph neural network model and introduce a learnable coefficient vector during pre-training to obtain the adjustment coefficient; use the pre-trained graph neural network model to infer graph data objects and predict the numerical correction amount for the initial decomposition factor. The pre-trained graph neural network model includes an encoder layer, multiple message passing layers, and a decoder layer. The encoder layer maps the low-dimensional physical space node features of graph data objects to a high-dimensional latent feature space. By aggregating neighborhood information through multiple message passing layers, the implicit characteristics of nodes are updated; The numerical correction amount is output through the decoder layer; Step 4: Divide the topological sub-regions according to the non-uniform characteristics of different physical media or geometric distributions in the electromagnetic simulation calculation model, use different adjustment coefficients to weight the numerical correction amount in different regions, and superimpose them on the initial decomposition factor to obtain the enhanced preconditioner. Step 5: Load the enhanced preconditioner into the iterative solver to solve the linear equations, and perform electromagnetic simulation calculations based on the solution results.

2. The GNN preconditional iterative solution method for electromagnetic simulation according to claim 1, characterized in that, The specific implementation process of step 2 includes: In generating initial decomposition factors Then, the initial decomposition factors are extracted. The row and column indices of non-zero elements are used as a set of nodes to construct a directed graph topology representing electromagnetic spatial coupling relationships. ;in, Represents a set of nodes. Represents the set of edges; Constructing a multidimensional enhanced edge feature vector includes: adjusting the initial decomposition factors. Each non-zero element value in Normalization is performed to obtain feature attributes. ; In the node set, the nodes Sending degree and node The received degree is normalized to the maximum degree of the entire graph, that is, the maximum degree of the entire graph is divided by the node. Sending degree and node The normalized transmission score is obtained from the received score. and normalized receptivity ; Through the non-zero element values ​​of the off-diagonal elements The absolute value of the corresponding main diagonal element The ratio of their absolute values ​​yields the relative coupling strength. ,in As shown below: ; feature attributes Normalized transmission degree Normalized reception degree and relative coupling strength By concatenating the features, we obtain the multidimensional enhanced edge feature vector. The expression is: ; The multidimensional enhanced edge feature vectors corresponding to all directed edges. Constructing an edge feature set The expression is: ; in, Let i represent the edge pointing from node i to node j; initialize the input features of each node to a constant 1 to obtain the node feature set. : ; in, Represents a node Node characteristics, Represents a node ; Ultimately, this will result in a directed graph topology. Edge feature set and node feature set Combined together, graph data objects are constructed. .

3. The method for solving a system of equations using GNN preconditions for electromagnetic simulation according to claim 2, characterized in that, During pre-training, a learnable coefficient vector is introduced to obtain the adjustment coefficient; including: During the pre-training of a graph neural network model, a learnable coefficient vector is introduced that is simultaneously optimized during training. , The total number of vectors, vector Each component is set to 0 during the initial training phase of the graph neural network model; Let the training objective function be denoted as . ,in, This represents the parameters of the graph neural network model; during training iterations, the adjustment coefficients are updated using the following formula: ; in, Indicates the first During the nth iteration One adjustment coefficient , Indicates the learning rate. Indicates the first During the nth iteration One adjustment coefficient; after training convergence, the adjustment coefficients are obtained. .

4. The GNN preconditional iterative solution method for electromagnetic simulation according to claim 3, characterized in that, Using a pre-trained graph neural network model to infer from graph data objects, the system predicts numerical corrections for initial factorization; including: graph data objects As input data, it is fed into the encoder layer of a pre-trained graph neural network model; The encoder layer includes linear transformation operations and nonlinear activation operations. The encoder layer receives... Multidimensional enhanced edge feature vectors It performs learnable linear transformation operations and nonlinear activation operations, and the calculation process is as follows: ; in, Let be the initial embedding vector of the edge in the latent space. This represents the weight matrix of the encoder layer. For multidimensional enhanced edge feature vectors, This represents the bias vector. Represents a nonlinear activation function; The initial embedding vector is processed through multiple message passing layers. The update process is performed, with each message passing layer including node feature update operations and edge feature update operations. For the Any node in the message passing layer The node feature update operation updates the node representation by aggregating information from neighboring nodes. The update process is represented as follows: ; in, Represents a node In the The feature vector of the layer, and ; Represents a node In the The feature vector of the layer, and , Indicates the connection node and edge features, The weight matrix is ​​a learnable matrix. Represents a node The set of adjacent nodes, For aggregate functions, It is a non-linear activation function; After the node feature update operation, the edge feature update operation is performed. The update process is represented as follows: ; in, Indicates the first Edge features updated by layer; and Representing nodes respectively With nodes In the The layer completes the feature vector update; This is the learnable weight matrix for the edge update phase; Indicates feature splicing or combination operations; Represents a nonlinear mapping function; Finally, after After iterative propagation through the message-passing layer, the final edge features are obtained. ; edge features The input is a decoder layer, which is a multilayer perceptron network. This network predicts the positions of non-zero elements in the sparse matrix. The numerical correction at the location; the prediction process is expressed as: ; in, The multilayer perceptron network is represented. Indicates position The numerical correction amount at that location.

5. The GNN preconditional iterative solution method for electromagnetic simulation according to claim 4, characterized in that, Step 4 includes the following specific implementation process: Based on the non-uniformity of different physical media or geometric distributions in the electromagnetic simulation calculation model, the topological adjacency space of the computational domain nodes, i.e., the graph node set, is pre-divided into... Each connected subregion, with adjustment coefficient The coefficient vector is selected as the adjustment coefficient for the numerical correction. The predicted numerical correction is then subjected to regionally differentiated weighted scaling and superimposed on the initial decomposition factor, as shown below: ; in, Indicates the location The lower triangular matrix element at that position, Represents the coefficient vector The first in One portion, ; All matrix elements After weighted scaling, a lower triangular matrix is ​​formed. Based on the lower triangular matrix Obtain the enhanced preconditioner .

6. The GNN preconditional iterative solution method for electromagnetic simulation according to claim 5, characterized in that, The specific implementation process of step 5 includes: The BiCGSTAB method, which uses a Krylov subspace iterative solver to stabilize the biconjugate gradient method, generates enhanced preconditioners. Loaded into BiCGSTAB as a left preconditioning operator; In each step of the iterative solution, the solver, BiCGSTAB, solves the preprocessed equations. ; When the iterative residual decreases to a preset convergence threshold, the solution is considered converged, and the final unknown vector is output. That is, the numerical solution of the electromagnetic field distribution required for electromagnetic simulation, and the electromagnetic simulation calculation is completed based on the numerical solution of the electromagnetic field distribution.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the GNN preconditional iterative solution method for electromagnetic simulation as described in any one of claims 1-6.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When a computer program is executed by a processor, it implements the steps of the GNN preconditioned iterative solution method for electromagnetic simulation as described in any one of claims 1-6.

9. A GNN preconditional iterative solution system for electromagnetic simulation, characterized in that, include: The preprocessing module is configured to: construct an electromagnetic simulation model, establish the system of linear equations to be solved using the finite element method, and preprocess the coefficient matrix of the system of linear equations to obtain initial decomposition factors; including: Mathematical modeling is performed based on the geometric shape, material parameters, and excitation conditions of the electromagnetic simulation object to construct an electromagnetic simulation calculation model. The computational domain is then discretized using the finite element method to form a large-scale sparse linear equation system to be solved. ; Wherein, the coefficient matrix This represents the coefficient matrix and vector formed by discretizing the electromagnetic simulation model using the finite element method. This represents the vector of right-hand side terms formed by external excitation conditions. This represents the vector of degrees of freedom of the electromagnetic field to be solved; Using the incomplete Cholesky decomposition algorithm on the coefficient matrix Preprocessing is performed to obtain the initial decomposition factors. ; The graph data object construction module is configured to: map the numerical features of the initial decomposition factors to a graph structure, construct multidimensional enhanced edge feature vectors, and obtain graph data objects based on the multidimensional enhanced edge feature vectors and the graph structure; The numerical correction prediction module is configured to: construct a pre-trained graph neural network model and introduce a learnable coefficient vector during pre-training to obtain the adjustment coefficient; use the pre-trained graph neural network model to infer the graph data object and predict the numerical correction for the initial decomposition factor. The pre-trained graph neural network model includes an encoder layer, multiple message passing layers, and a decoder layer. The encoder layer maps the low-dimensional physical space node features of graph data objects to a high-dimensional latent feature space. By aggregating neighborhood information through multiple message passing layers, the implicit characteristics of nodes are updated; The numerical correction amount is output through the decoder layer; The region weighting module is configured to: divide the topological sub-regions according to the spatial characteristics of the electromagnetic simulation calculation model, use different learnable adjustable coefficients to perform regional weighting of the numerical correction amount, and superimpose it on the initial decomposition factor to obtain the enhanced preconditioner; The solver module is configured to: load enhanced preconditioners into the iterative solver, solve the linear equation system, and perform electromagnetic simulation calculations based on the solution results.

Citation Information

Patent Citations

  • DGMRES double-iteration high-dimensional electromagnetic simulation method and system based on ADMM preconditions

    CN114329981A

  • Electromagnetic field simulation optimization method and system based on deep learning

    CN120449606A