Neural network based electromagnetic field simulation mesh self-adaptive generation method

By generating adaptive meshes through a dual-branch neural network, the problem of insufficient electromagnetic field gradient distribution and geometric boundary integrity in existing mesh optimization techniques for semiconductor device design is solved, achieving a significant improvement in simulation accuracy and computational efficiency.

CN121615573BActive Publication Date: 2026-06-23HANGZHOU DIANZI UNIV +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU DIANZI UNIV
Filing Date
2026-02-02
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing mesh optimization techniques struggle to simultaneously maintain electromagnetic field gradient distribution and geometric boundary integrity in semiconductor device design, resulting in insufficient simulation accuracy and high computational costs. In particular, poor mesh optimization performance is common in regions with drastic electric field changes and at sharp corners.

Method used

A method based on a dual-branch neural network is adopted. By constructing node features and an undirected graph, local feature extraction branches and global feature extraction branches are extracted in parallel. Combined with tangent direction correction and internal node out-of-bounds penalty, an adaptive mesh is generated to ensure the geometric constraints of boundary nodes and the integrity of the topology.

Benefits of technology

It significantly improves simulation accuracy and computational efficiency, maintains the geometric contours and topology of semiconductor devices, reduces the generation of illegal meshes, and lowers computational complexity, making it suitable for device design scenarios involving large-scale parameter scanning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121615573B_ABST
    Figure CN121615573B_ABST
Patent Text Reader

Abstract

The application discloses a neural network-based electromagnetic field simulation grid self-adaptive generation method. The application performs grid partitioning on a semiconductor device simulation model, obtains original partitioning data, and constructs node features; a non-directed graph is constructed, the graph nodes of which adopt the node features of the grid points, and the connecting edges adopt the Euclidean distances between the grid points and adjacent grid points; the non-directed graph is input into a double-branch neural network, and a predicted node position is output; each node of the original partitioning data is corrected by using the predicted node position obtained by the double-branch neural network, and new partitioning data is formed to perform electromagnetic field simulation. The method can not only efficiently adjust the node density by fusing physical field information, but also strictly maintain the geometric boundary and topological structure characteristics of the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electromagnetic simulation technology, and particularly relates to an adaptive generation method for electromagnetic field simulation mesh based on neural networks. Background Technology

[0002] In the design and manufacturing of semiconductor devices, computer-aided design (TCAD) plays a crucial role. The finite element method (FEM) is the core algorithm in TCAD for simulating electromagnetic fields, thermal fields, and stress, while high-quality mesh generation is the foundation for ensuring the accuracy and convergence of finite element simulations.

[0003] In electromagnetic field simulations, to improve computational accuracy, it is common practice to refine the mesh in regions where the electric field changes drastically (such as the depletion region of a PN junction or the gate edge), while using a sparse mesh in regions where the electric field changes gently, thus balancing computational accuracy and cost. This technique, which automatically adjusts the mesh node positions based on the physical field distribution, is called r-adaptivity mesh optimization.

[0004] Existing mesh optimization techniques can be mainly divided into geometric rule-based methods, physics-based optimization methods, and data-driven methods that have emerged in recent years.

[0005] Traditional geometrically based methods, such as Laplacian smoothing and its variants, improve mesh quality by moving nodes to the geometric center of their neighboring nodes. However, these methods primarily focus on the regularity of the mesh shape (e.g., the equilaterality of triangles), often neglecting the gradient distribution of physical fields such as electromagnetic fields. This results in the optimized mesh failing to accurately capture physical phenomena. Furthermore, Laplacian smoothing is prone to a "volume shrinkage" effect, causing the geometric boundaries of devices to collapse inward, thereby altering the original geometry of the simulation model and severely impacting simulation accuracy.

[0006] Methods based on variational principles or physical monitor functions: These methods move nodes by constructing an energy function (Monitor Function) containing physical field information and iteratively minimizing it. While these methods can adapt well to physical field distributions, their computation involves solving complex nonlinear equations, requiring numerous iterations and incurring huge computational costs, making them difficult to meet the rapid iteration requirements of semiconductor device design.

[0007] Deep Learning-Based Mesh Generation Methods: In recent years, Graph Neural Networks (GNNs) have been introduced into the field of mesh generation. Existing methods typically treat the mesh as a graph structure, directly regressing the coordinates of nodes using graph convolutional networks. However, existing GNN-based methods mainly suffer from the following drawbacks:

[0008] Lack of strict geometric constraints: Existing network models typically predict the absolute coordinates or free offsets of nodes directly, ignoring the geometric topological constraints of the mesh. This can easily lead to internal nodes "flying out" of the boundary (going out of bounds), or boundary nodes deviating from the original contours, thus disrupting the precise geometry of semiconductor devices.

[0009] Insufficient capture of local and global information: Simply using local operators such as edge convolution (EdgeConv) can only capture the local neighborhood features of nodes, making it difficult to perceive the macroscopic deformation trend of the entire mesh; while simply using fully connected layers loses topological structure information. The lack of a multi-scale feature fusion mechanism leads to poor mesh optimization results in large deformation regions.

[0010] Rough boundary treatment: Existing technologies often fail to differentiate between vertex, edge node, and internal node. Especially for semiconductor devices with sharp corners, if the corners are not fixed or specially constrained, the optimization process can easily "grind" the sharp corners, resulting in the loss of key geometric features.

[0011] Therefore, there is an urgent need for a mesh adaptive generation method that can both integrate physical field information to efficiently adjust node density and strictly maintain the geometric boundaries and topological characteristics of the device. Summary of the Invention

[0012] The purpose of this invention is to overcome the shortcomings of the prior art and provide an adaptive generation method for electromagnetic field simulation mesh based on neural networks.

[0013] The present invention is implemented as follows: Firstly, the present invention provides an adaptive generation method for electromagnetic field simulation mesh based on neural networks, the method comprising:

[0014] A semiconductor device simulation model is established, and the semiconductor device simulation model is meshed to obtain the original mesh data mesh1;

[0015] For the original mesh data mesh1, node features are constructed; wherein the node features include the first global normalized coordinate feature coord_normalized and the second global normalized coordinate feature global_coord, electric field intensity, and node type; the node type includes internal nodes, outer boundary nodes, outer vertices, inner boundary nodes, and inner vertices.

[0016] Construct an undirected graph whose nodes adopt the node characteristics of grid point i, and whose connecting edges adopt the Euclidean distance between grid point i and its adjacent grid points;

[0017] The undirected graph is input into a two-branch neural network, which outputs the predicted node positions.

[0018] The predicted node positions obtained by the dual-branch neural network are used to correct the nodes of the original mesh data mesh1, forming new mesh data for electromagnetic field simulation.

[0019] Preferably, the specific implementation process of constructing node features includes:

[0020] Calculate the electric field intensity at each point of the original mesh under electromagnetic field simulation;

[0021] By finely classifying the nodes, the node types of each original mesh point are obtained;

[0022] The coordinates of each original mesh point are double-normalized to obtain the first global normalized coordinate feature coord_normalized and the second global normalized coordinate feature global_coord.

[0023] coord_normalized = 2× (coord - coord_min) / (coord_max - coord_min +1e-8) - 1;

[0024] global_coord = (coord - coord_min) / (coord_max - coord_min + 1e-8)

[0025] Where coord_min represents the global minimum coordinate of the grid point, and coord_max represents the global maximum coordinate of the grid point;

[0026] The first global normalized coordinate feature coord_normalized, the second global normalized coordinate feature global_coord, the electric field strength, and the node type are concatenated into a vector, which is defined as the node feature.

[0027] More preferably, the step of obtaining the node type of each original mesh point through fine-grained node classification specifically includes:

[0028] Geometric location analysis is performed by distinguishing between the boundary and interior points marked in the original mesh data mesh1;

[0029] Based on the connection relationships between grid points marked in the original mesh data mesh1, n contours are generated for the boundary. These n contours include 1 outer contour and n-1 hole contours, where n≥1.

[0030] Perform inner and outer boundary analysis on the grid points on the contour and mark them as boundary nodes;

[0031] Arrange the boundary nodes in order;

[0032] Traverse each boundary node, calculate the curvature of each boundary node, and identify the node type;

[0033] Grid points at non-outline locations are marked as internal nodes;

[0034] Encode the node type using a five-dimensional one-hot vector;

[0035] More preferably, the specific implementation process of performing inner and outer boundary analysis on the mesh points on the contour and marking them as boundary nodes includes:

[0036] Generate polygons from all contours, determine the containment relationship between each polygon, and ensure that the polygon generated from the hole contour is contained within the polygon generated from the outer contour; mark the grid points on the outer contour as outer boundary nodes, and mark the grid points on the hole contour as inner boundary nodes.

[0037] More preferably, the specific implementation process of traversing each boundary node, calculating the curvature of each boundary node, and identifying the node type includes:

[0038] The boundary node is connected to two adjacent boundary nodes to form two line segments, and the curvature of the two line segments is calculated to obtain the first curvature k1 and the second curvature k2. If the difference between the first curvature k1 and the second curvature k2 is within the threshold range, the node type of the current boundary node is not changed. If the difference between the first curvature k1 and the second curvature k2 exceeds the threshold range, it is further determined whether the current boundary node is an outer boundary node. If it is, it is marked as an outer vertex; otherwise, it is marked as an inner vertex.

[0039] Preferably, the dual-branch neural network includes a local feature extraction branch, a global feature extraction branch, a feature fusion module, a boundary node prediction module, and a non-boundary node prediction module;

[0040] The local feature extraction branch performs linear operations and edge convolution (EdgeConv) on the undirected graph, then performs ReLU activation function processing, and finally performs linear operations and edge convolution (EdgeConv) again to output local features F_local.

[0041] The global feature extraction branch uses the graph attention network GATConv to process the undirected graph to obtain multi-head features, and then concatenates the multi-head features to output the global feature F_global.

[0042] The feature fusion module concatenates local and global features to obtain grid features;

[0043] The boundary node prediction module predicts boundary nodes based on mesh features, obtains the tangent direction and node displacement of the predicted boundary nodes, and corrects the tangent direction of the predicted boundary nodes; based on the corrected tangent direction and predicted node displacement, the position of the predicted boundary node is obtained; wherein the boundary nodes include outer boundary nodes and inner boundary nodes;

[0044] The non-boundary node prediction module predicts non-boundary nodes based on grid features, thus obtaining the predicted offset of the non-boundary nodes. This allows for the prediction of non-boundary node positions; where non-boundary nodes include inner vertices, outer vertices, and internal nodes.

[0045] The vertex correction module corrects the positions of the inner and outer vertices to restore them to their original partition positions.

[0046] Preferably, during training, the loss function L of the dual-branch neural network consists of the mean square error between the predicted node position and the target node position, the orientation similarity loss, and the penalty for internal node out-of-bounds errors. Specifically, L can be as follows:

[0047] L = λ1×L base + λ2 × L dir + λ3 × L sdf

[0048] Where L base L represents the mean square error between the predicted node position and the target node position. dir L represents the directional similarity loss. sdf λ1, λ2, and λ3 represent the penalty for out-of-bounds operations of internal nodes, and the weights represent the weights. The predicted node positions include the predicted positions of internal nodes, outer boundary nodes, outer vertices, inner boundary nodes, and inner vertices.

[0049] L base = MSE(P i , T i )

[0050] Where P i T represents the position of the i-th predicted node. i Indicates the position of the i-th node;

[0051] L dir =

[0052] in This represents the angle between the predicted tangent vector of the i-th node and the target tangent vector, where n is the number of grid points;

[0053] L sdf = q / n

[0054] Where q represents the number of out-of-bounds points, which are the predicted node positions that exceed the boundary range.

[0055] Secondly, the present invention provides an adaptive generation system for electromagnetic field simulation meshes, comprising:

[0056] The raw mesh data acquisition module is responsible for building a semiconductor device simulation model, performing mesh generation on the semiconductor device simulation model, and obtaining the raw mesh data mesh1.

[0057] The node feature extraction module is responsible for constructing node features for the original mesh1 subdivision data; wherein the node features include the first global normalized coordinate feature coord_normalized and the second global normalized coordinate feature global_coord, electric field strength, and node type; the node type includes internal nodes, outer boundary nodes, outer vertices, inner boundary nodes, and inner vertices.

[0058] The undirected graph construction module is responsible for constructing undirected graphs, whose graph nodes adopt the node characteristics of grid point i, and whose connecting edges adopt the Euclidean distance between grid point i and its adjacent grid points.

[0059] The module for predicting node positions is responsible for inputting the undirected graph into the dual-branch neural network and outputting the predicted node positions.

[0060] The node correction module is responsible for correcting each node of the original mesh data mesh1 using the predicted node positions obtained from the dual-branch neural network.

[0061] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method described thereon.

[0062] Fourthly, the present invention provides a computing device, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method described above.

[0063] The beneficial effects of the present invention include at least the following:

[0064] 1. This invention employs a boundary constraint mechanism based on tangent direction correction. By strictly restricting the movement of boundary nodes to the predicted tangent direction and forcibly fixing the vertex position, it effectively solves the common problems of "volume shrinkage" and "boundary collapse" in traditional methods. It can perfectly maintain the complex geometric contours of semiconductor devices (such as gate chamfers and channel edges), ensure the geometric consistency between the optimized mesh and the original model, ensure geometric fidelity, and avoid simulation errors caused by geometric deformation.

[0065] 2. The dual-branch neural network of this invention introduces an internal point out-of-bounds penalty L during the training phase. sdf And direction similarity loss L dir The composite geometric constraint function L significantly improves the success rate and robustness of mesh generation, especially when dealing with concave polygons or narrow channel structures, it significantly reduces the generation of illegal meshes.

[0066] 3. This invention constructs a dual-branch neural network with parallel local and global feature extraction branches. The local feature extraction branch effectively aggregates geometric details of the local neighborhood using dynamic graph convolution to capture subtle changes in physical field gradients, while the global feature extraction branch uses an attention mechanism to capture global topological information and understand the overall structure of the grid. This solves the problem that traditional graph neural networks can only capture local features while ignoring global features. Compared to a single network structure, the dual-branch feature fusion makes the model more coordinated when dealing with large deformation regions and can more rationally allocate grid density according to the global distribution of electric field intensity.

[0067] 4. This invention is a data-driven, non-iterative generation method. Once the model training is complete, for a new semiconductor device model, only one forward propagation (inference) is needed to output the optimized mesh coordinates. Unlike variational methods or physical monitoring function methods, it does not require complex iterative solutions of nonlinear equations. This reduces the time complexity of mesh optimization from minutes to milliseconds, greatly improving the efficiency of the TCAD process. It is particularly suitable for device design scenarios that require large-scale parameter scanning.

[0068] 5. This invention directly inputs physical quantities such as electric field strength as node features into the neural network. The network can automatically learn the mapping relationship between the physical field gradient and the mesh density. The generated mesh achieves true "on-demand allocation" and automatically gathers nodes in key locations such as the depletion region where the electric field changes drastically. Thus, without increasing the total number of nodes, the physical simulation accuracy of key areas is significantly improved. Attached Figure Description

[0069] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0070] Figure 1 This is a flowchart of the adaptive generation method for electromagnetic field simulation mesh provided in an embodiment of the present invention.

[0071] Figure 2 This is a flowchart of node type classification provided in an embodiment of the present invention.

[0072] Figure 3 This is a schematic diagram of node types provided in an embodiment of the present invention.

[0073] Figure 4 This is a schematic diagram of a dual-branch neural network structure provided in an embodiment of the present invention.

[0074] Figure 5 This is a schematic diagram comparing the frequency response of S-parameters in magnetic field simulation provided in an embodiment of the present invention.

[0075] Figure 6 This is the standard subdivision result provided by the embodiments of the present invention.

[0076] Figure 7 This is the adaptive mesh partitioning result obtained by the method of this invention.

[0077] Figure 8 These are partial images of mesh generation results using different methods, where (a) is the initial uniform mesh, (b) is the existing Laplacian smoothing method, and (c) is the method of this invention.

[0078] Figure 9 This is a comparison chart of model convergence. Detailed Implementation

[0079] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0080] like Figure 1 As shown, the adaptive generation method for electromagnetic field simulation mesh provided in this embodiment of the invention includes:

[0081] Step 1: Establish a semiconductor device simulation model. Use EDA software to mesh the semiconductor device simulation model to obtain the original mesh data mesh1. The original mesh data mesh1 is point cloud data.

[0082] Electronic Design Automation (EDA) simulation software is used to build models and perform electromagnetic simulations of semiconductor devices to be analyzed. Typical software includes, but is not limited to, UltraEM, ANSYS Electronics Desktop, ANSYS HFSS, CSTStudio Suite, or other equivalent software. This process includes: constructing a three-dimensional geometric model of the semiconductor device, including dielectric layers, metal traces, and via structures; setting material parameters and boundary conditions, including dielectric constant, conductivity, and port excitation; performing initial mesh generation using uniform or fixed-size mesh generation strategies provided by the software; and executing the simulation solver and outputting mesh structure and node coordinate information. After the simulation, the EDA software generates an original mesh (mesh1) containing node coordinates, element topology relationships, and simulation field distribution information.

[0083] Step 2: Reconstruct the original mesh data mesh1 sequentially to generate reconstructed mesh data mesh2.

[0084] Specifically, import the original mesh (mesh1) into the UltraEM software. Use the model data obtained in step 2.1 and the mesh1 data as input to load the UltraEM software. UltraEM supports importing meshes in multiple formats, including .msh, .geo, and .vtk.

[0085] Enable the adaptive partitioning function in the UltraEM software and select an optimization strategy that is an adaptive optimization strategy based on current density distribution.

[0086] The UltraEM software performs reconstruction operations on the nodes and elements in mesh1 according to the set adaptive strategy, including but not limited to: local mesh refinement in areas with large errors; regenerating irregular elements to meet the requirements of angle balance and reasonable side length ratio; and performing shape correction on areas containing abrupt structures.

[0087] After reconstruction, UltraEM outputs mesh data mesh2 after adaptive subdivision. Compared with mesh1, mesh2 has the following characteristics: the region with significant current density variation is refined; the internal node distribution is more uniform; the cell shape is more regular, which is beneficial to improving the accuracy of electromagnetic simulation; and it can be used as target label data for training neural network models.

[0088] Step 3: Construct node features for the original mesh data mesh1; specifically:

[0089] 3.1 Calculate the electric field intensity at each original mesh point under electromagnetic field simulation;

[0090] 3.2 Through fine-grained node classification, the node types of each original mesh point are obtained; the node types include internal nodes, outer boundary nodes, outer vertices, inner boundary nodes, and inner vertices, see Appendix. Figure 3 See appendix Figure 2 Specifically:

[0091] 3.2.1 Geometric location analysis, which distinguishes between the boundary and interior points marked in the original mesh data mesh1.

[0092] 3.2.2 Based on the connection relationships between grid points marked in the original mesh data mesh1, n contours are generated for the boundary. These n contours include one outer contour and n-1 hole contours. n≥1.

[0093] 3.2.3 Perform inner and outer boundary analysis on the mesh points on the contour and mark them as boundary nodes; specifically:

[0094] Generate polygons from all contours, and determine the containment relationship between the polygons. The polygon generated from the hole contour should be contained within the polygon generated from the outer contour. Mark the mesh points on the outer contour as outer boundary nodes, and mark the mesh points on the hole contour as inner boundary nodes.

[0095] 3.2.4 Arrange the boundary nodes in order.

[0096] 3.2.5 Traverse each boundary node, calculate the curvature of each boundary node, and identify the node type; specifically:

[0097] The boundary node is connected to two adjacent boundary nodes to form two line segments, and the curvature of the two line segments is calculated to obtain the first curvature k1 and the second curvature k2. If the difference between the first curvature k1 and the second curvature k2 is within the threshold range, the node type of the current boundary node is not changed. If the difference between the first curvature k1 and the second curvature k2 exceeds the threshold range, it is further determined whether the current boundary node is an outer boundary node. If it is, it is marked as an outer vertex; otherwise, it is marked as an inner vertex.

[0098] 3.2.6 Mark grid points at non-contour locations as internal nodes.

[0099] 3.2.7 Encode the node type using a five-dimensional one-hot vector.

[0100] 3.3 The coordinates of each original mesh point are double normalized to obtain the first global normalized coordinate feature coord_normalized and the second global normalized coordinate feature global_coord.

[0101] coord_normalized = 2 × (coord - coord_min) / (coord_max - coord_min+ 1e-8) - 1.

[0102] global_coord = (coord - coord_min) / (coord_max - coord_min + 1e-8)

[0103] Here, coord_mix represents the global minimum coordinate of the grid point, and coord_max represents the global maximum coordinate of the grid point.

[0104] 3.4 The first global normalized coordinate feature coord_normalized, the second global normalized coordinate feature global_coord, the electric field strength, and the node type are concatenated into a vector, which is defined as the node feature.

[0105] Step 4: Based on the original mesh1 and the reconstructed mesh2, label the undirected graph to form a dataset. The graph nodes of the undirected graph are represented by the node features of grid point i, and the connecting edges are represented by the Euclidean distance between grid point i and its adjacent grid points. Eight connecting edges are constructed for each graph node.

[0106] Treat each grid node in mesh1 as a vertex in the graph, and use the coordinate information of all nodes as the basis for spatial features. Construct adjacency relationships for each node:

[0107] 5.1 Constructing an undirected graph structure based on the original mesh1. Each grid node in mesh1 is considered a vertex in the graph, and the coordinate information of all nodes is used as the basis for spatial features. Adjacency relationships are constructed for each node using an eight-nearest neighbor (8-NN) strategy. For any node v in mesh1... i Calculate its Euclidean distance to all other nodes, and select the eight nodes closest to it:

[0108]

[0109] And in each pair (v i ,v jk Undirected edges are constructed between these nodes to form a graph structure that includes local geometric relationships. This eight-nearest neighbor strategy has the following advantages: it can stably capture local mesh topology; and the resulting graph structure is compatible with the dynamic neighborhood computation method of graph neural networks. The resulting graph can be represented as:

[0110]

[0111] Where V is the set of nodes and E is the set of eight nearest undirected edges.

[0112] 5.2 One-hot encoding of node types. To describe the geometric role of nodes in the mesh, the type of each node is encoded as a five-dimensional one-hot vector, which may include, but is not limited to: internal node, outer boundary node, inner boundary node, outer vertex, and inner vertex. If the node type is T, then the one-hot vector can be represented as:

[0113]

[0114] 5.3 Obtaining the electric field strength at each node. Using the results from the original mesh1 data, the electric field strength C of each node during the simulation can be obtained.i .

[0115] 5.4 Constructing Node Feature Vectors. Combining coordinates, node type, and electric field intensity, this invention constructs the input features:

[0116]

[0117] Each node consists of the following characteristics: Spatial location of the node; Node type (five-dimensional one-hot vector) Electric field strength.

[0118] 5.5 Calculating Node Displacement Labels Based on Mesh2 y). Mesh2 is an optimized mesh obtained by adaptively reconstructing mesh1 using UltraEM software. During the reconstruction process, the number of nodes remains consistent, and each node in mesh1 can be found in mesh2. Therefore, for the nodes of mesh1... and the corresponding nodes in mesh2 Its spatial displacement can be calculated directly:

[0119]

[0120]

[0121] This displacement is then used as the training target label (Ground Truth):

[0122] ]

[0123] 5.6 Final Composition of Graph Data Samples. In summary, the single graph data sample constructed by this invention comprises:

[0124] Graph node feature matrix:

[0125]

[0126] Graph edge set:

[0127]

[0128] Grid type information : Internal node, outer boundary node, inner boundary node, outer vertex, inner vertex.

[0129] Nodal electric field strength

[0130] Target label (displacement from mesh1 to mesh2)

[0131]

[0132] 5.7 Final Structure of Graph Data Samples. The above content is encapsulated into a graph object (using PyTorch Geometric's Data structure), denoted as:

[0133]

[0134] Step 6: Train the dual-branch neural network using the dataset described above.

[0135] See appendix Figure 4 The dual-branch neural network includes a local feature extraction branch, a global feature extraction branch, a feature fusion module, a boundary node prediction module, and a non-boundary node prediction module.

[0136] The local feature extraction branch performs Linear operation and EdgeConv operation on the undirected graph, then performs ReLU activation function processing, and finally performs Linear operation and EdgeConv operation again to output local features F_local, which is used to capture field gradient changes and improve boundary layer accuracy.

[0137] The global feature extraction branch uses the graph attention network GATConv to process the undirected graph to obtain multi-head features. The multi-head features are then concatenated to output the global feature F_global, which is used for topological long-range dependencies and improves medium interface optimization.

[0138] The feature fusion module combines local and global features to obtain grid features.

[0139] The boundary node prediction module predicts boundary nodes based on mesh features, obtains the tangent direction and node displacement of the predicted boundary nodes, and corrects the tangent direction of the predicted boundary nodes; based on the corrected tangent direction and predicted node displacement, the position of the predicted boundary node is obtained; the boundary nodes include outer boundary nodes and inner boundary nodes;

[0140] The non-boundary node prediction module predicts non-boundary nodes based on grid features, thus obtaining the predicted offset of the non-boundary nodes. This allows us to obtain the positions of non-boundary nodes; non-boundary nodes include internal vertices, external vertices, and internal nodes.

[0141] The vertex correction module restores the positions of inner and outer vertices to their original mesh positions.

[0142] Specifically, the input processing procedure of a dual-branch neural network is as follows:

[0143] 6.1 Preprocessing of graph data samples and construction of module input.

[0144] Before feeding the graph data samples into the dual-branch neural network, the system performs the following standardization processing on the data:

[0145] 6.1.1 Node Feature Normalization

[0146] For the coordinate and current change values, a uniform normalization is performed to obtain the normalized features:

[0147]

[0148] 6.1.2 Tensorization of Edge Connectivity

[0149] Transform the undirected edge set E into an edge index matrix usable by a graph neural network for sampling the adjacency relationship between EdgeConv and GATConv:

[0150]

[0151] 6.1.3 Node Type Decoding Flags

[0152] One-hot vector based on node type Automatic decoding yields the integer category marker:

[0153]

[0154] And construct the boundary node mask:

[0155]

[0156] Non-boundary node mask:

[0157]

[0158] in This represents the inverse function.

[0159] Boundary direction vector preparation: For node i belonging to the boundary node, pre-calculate the boundary tangent direction from the dataset, which is used as the orientation constraint for the boundary node prediction module.

[0160]

[0161] 6.2 Flowchart of Graph Data Input to Node Prediction Module The core neural network structure in this embodiment is MeshOptimizer, which includes: a boundary node prediction module (direction + amplitude mode) and a non-boundary node prediction module (free 2D regression mode). Its complete execution flow is as follows:

[0162] 6.2.1 Extract fusion features without distinguishing regions.

[0163] Execute uniformly on all nodes:

[0164] Local EdgeConv feature extraction. This feature describes: the geometry of the local neighborhood, changes in edge length, changes in angle, and the differences and relationships between nodes and their neighbors.

[0165]

[0166] Global GATConv feature extraction. This feature describes: the node's position in the overall mesh, long-range dependencies, global topology, and the influence of distant nodes on the current node.

[0167]

[0168] Feature fusion construction. The two feature vectors above are concatenated to obtain the fused node features:

[0169]

[0170] 6.3 Automatic Module Selection Mechanism. Based on the node type mask, nodes are automatically assigned to different prediction modules: if... = 1 Input boundary node prediction module, if = 1 Input non-boundary node prediction module.

[0171] 6.3.1 The boundary node prediction module receives data.

[0172] enter:

[0173] { , , }

[0174] Output after model processing:

[0175]

[0176] in : Corrected tangent direction; : Predicted distance to travel; : Displacement vector along the tangent.

[0177] 6.3.2 The non-boundary node prediction module receives data.

[0178] enter

[0179] { , }

[0180] Output

[0181]

[0182] in : Two-dimensional offset vector for free movement of internal nodes

[0183] 6.4 Combination and Output of Prediction Results

[0184] The outputs of the two submodules are merged into a unified displacement tensor based on the mask:

[0185]

[0186] Forcing specific settings (internal and external vertices):

[0187]

[0188] in The set representing the indices of the inner and outer vertices;

[0189] Finally, the predicted new positions of all nodes are obtained:

[0190]

[0191] During training, the loss function L of the dual-branch neural network is as follows:

[0192] L = λ1×L base + λ2 × L dir + λ3 ×L sdf

[0193] Where L base L represents the mean square error between the predicted node position and the target node position. dir L represents the directional similarity loss. sdf λ1, λ2, and λ3 represent the penalty for out-of-bounds points within the boundary, and λ3 represent the weights. The predicted node positions include the predicted positions of internal nodes, outer boundary nodes, outer vertices, inner boundary nodes, and inner vertices.

[0194] L base = MSE(P i , T i )

[0195] Where P i T represents the position of the i-th predicted node. i Indicates the position of the i-th node;

[0196] L dir =

[0197] in This represents the angle between the predicted tangent vector of the i-th node and the target tangent vector, where n is the number of grid points;

[0198] L sdf = q / n

[0199] Where q represents the number of out-of-bounds points, which are the predicted node positions that exceed the boundary range.

[0200] Step 7: During testing, acquire the original mesh data mesh1 of the semiconductor device simulation model and construct node features; construct an undirected graph based on the node features; input the undirected graph into a trained bi-branch neural network and output the predicted node positions; use the predicted node positions obtained by the bi-branch neural network to correct each node of the original mesh data mesh1, and construct a new mesh data mesh3 for electromagnetic field simulation.

[0201] like Figure 5 It can be seen that the simulation curve generated by the method of this invention exhibits extremely high consistency with the standard reference curve across the entire test frequency band from 5 GHz to 8 GHz, with the two curves almost completely overlapping. This indicates that the adaptive mesh generated using the dual-branch neural network described in this invention can achieve computational accuracy comparable to a high-density standard mesh with a smaller number of nodes. At the resonant frequency point near 6.5 GHz (i.e., the trough of the curve), the simulation results accurately reproduce the profound resonant characteristics. This is due to the physical field sensing mechanism in the model of this invention (the input features include electric field strength), which allows the mesh to automatically refine locally in the resonant region where electric field energy is concentrated, thereby accurately capturing drastic changes in the electromagnetic field. Common mesh smoothing algorithms in the prior art (such as Laplace smoothing) often lead to shrinkage of device geometric boundaries, thus causing drift in the resonant frequency. Figure 5 As can be seen, the resonant frequency of the results obtained in this invention is completely aligned with the standard value. This strongly demonstrates that the boundary constraint strategy based on the tangent direction and the vertex fixing mechanism introduced in this invention effectively maintain the geometric contour and topology of the device, avoiding simulation errors caused by geometric deformation.

[0202] Figure 6 The initial mesh generation results of the semiconductor device simulation model are shown. The mesh structure exhibits a uniform distribution overall; the mesh cell size remains largely consistent across both critical regions with drastic electric field changes and regions with gentler electric field variations. While this uniform mesh strategy is simple to implement in electromagnetic field simulations, it typically requires a high mesh density across the entire region to maintain accuracy due to the lack of optimization based on the physical field distribution, leading to significant computational costs.

[0203] Figure 7The adaptive mesh optimized by the dual-branch neural network of this invention is demonstrated, and this structure clearly achieves adaptive characteristics. The mesh generated by this method is allocated on demand according to the physical field gradient. In denser regions, the mesh automatically clusters more nodes in areas with drastic changes in electric field intensity. This verifies that the method of this invention can input physical quantities such as electric field intensity as node features into the neural network, automatically learning the mapping relationship between the physical field gradient and the mesh density. In sparse regions, the mesh cell size is significantly increased and the node density is reduced in regions with gentle changes in electric field. This optimization significantly improves the physical simulation accuracy in key areas without increasing the total number of nodes, effectively balancing computational accuracy and computational cost. More importantly, Figure 7 The perfect preservation of the geometric contour proves that the boundary constraint mechanism and vertex fixing mechanism based on tangent direction correction adopted in this invention solve the common problems of "boundary collapse" or "corner grinding" in traditional methods.

[0204] right Figure 8 In (a), the initial uniform mesh is meshed using the existing Laplacian smoothing method and the method of the present invention. The existing Laplacian smoothing method results in mesh boundary shrinkage and corner grinding problems after meshing, while the method of the present invention perfectly preserves the geometric features of the mesh boundary after meshing.

[0205] Figure 9 This is a comparison chart of model convergence performance, which intuitively shows the changes in geometric constraint loss (Loss) during training between the method of this invention (local + global feature fusion) and the baseline model that only uses local features.

[0206] As shown in the figure, the method of this invention (solid black line) exhibits a significantly faster loss reduction rate than the baseline model (dashed line) in the early training phase (0-20 epochs), demonstrating stronger convergence capability. This invention constructs a dual-branch neural network with parallel local and global feature extraction branches, solving the problem that traditional graph neural networks can only capture local features while ignoring global features. The global feature extraction branch utilizes an attention mechanism to capture global topological information, making the model more coordinated when handling large deformation regions and enabling more reasonable allocation of grid density based on the global distribution of electric field intensity. Ultimately, the geometric constraint loss value converged by the method of this invention is far lower than that of the baseline model using only local features, indicating that the model incorporating global features has higher robustness and a higher success rate in grid generation.

[0207] This embodiment also provides an adaptive generation system for electromagnetic field simulation mesh based on the above method, including:

[0208] The raw mesh data acquisition module is responsible for building a semiconductor device simulation model, performing mesh generation on the semiconductor device simulation model, and obtaining the raw mesh data mesh1.

[0209] The node feature extraction module is responsible for constructing node features for the original mesh1 subdivision data; wherein the node features include the first global normalized coordinate feature coord_normalized and the second global normalized coordinate feature global_coord, electric field strength, and node type; the node type includes internal nodes, outer boundary nodes, outer vertices, inner boundary nodes, and inner vertices.

[0210] The undirected graph construction module is responsible for constructing undirected graphs, whose graph nodes adopt the node characteristics of grid point i, and whose connecting edges adopt the Euclidean distance between grid point i and its adjacent grid points.

[0211] The module for predicting node positions is responsible for inputting the undirected graph into the dual-branch neural network and outputting the predicted node positions.

[0212] The node correction module is responsible for correcting each node of the original mesh data mesh1 using the predicted node positions obtained from the dual-branch neural network.

[0213] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A neural network-based adaptive mesh generation method for electromagnetic field simulation, characterized in that, The method includes: Establish a semiconductor device simulation model, perform mesh generation on the semiconductor device simulation model, and obtain the original mesh generation data; For the original partitioned data, node features are constructed; wherein the node features include a first global normalized coordinate feature, a second global normalized coordinate feature, electric field intensity, and node type; the node type includes internal nodes, outer boundary nodes, outer vertices, inner boundary nodes, and inner vertices. Construct an undirected graph in which the graph nodes adopt the node characteristics of grid points and the connecting edges adopt the Euclidean distance between grid points and adjacent grid points. The undirected graph is input into a two-branch neural network, which outputs the predicted node positions. The nodes of the original subdivided data are corrected by using the predicted node positions to form new subdivided data for electromagnetic field simulation. The dual-branch neural network includes a local feature extraction branch, a global feature extraction branch, a feature fusion module, a boundary node prediction module, a non-boundary node prediction module, and a vertex correction module. The local feature extraction branch performs linear operations and edge convolution operations on the undirected graph, then applies the ReLU activation function, and finally performs linear operations and edge convolution operations again to output local features. The global feature extraction branch uses a graph attention network to process the undirected graph to obtain multi-head features, and then concatenates the multi-head features to output global features. The feature fusion module concatenates local and global features to obtain grid features; The boundary node prediction module predicts boundary nodes based on mesh features, obtains the tangent direction and node displacement of the predicted boundary nodes, and corrects the tangent direction of the predicted boundary nodes; based on the corrected tangent direction and predicted node displacement, the position of the predicted boundary node is obtained; wherein the boundary nodes include outer boundary nodes and inner boundary nodes; The non-boundary node prediction module predicts non-boundary nodes based on grid features, obtains the offset of the predicted non-boundary nodes, and then obtains the position of the predicted non-boundary nodes; wherein the non-boundary nodes include inner vertices, outer vertices, and internal nodes. The vertex correction module corrects the positions of the inner and outer vertices to restore them to their original partition positions.

2. The method according to claim 1, characterized in that, The specific implementation process of constructing node features includes: Calculate the electric field intensity at each point of the original mesh under electromagnetic field simulation; By finely classifying the nodes, the node types of each original mesh point are obtained; The coordinates of each original mesh point are double-normalized to obtain the first global normalized coordinate features and the second global normalized coordinate features; The first globally normalized coordinate feature, the second globally normalized coordinate feature, the electric field strength, and the node type are concatenated into a vector, which is defined as the node feature.

3. The method according to claim 2, characterized in that, The process of obtaining the node type of each original mesh point through fine-grained node classification includes: Geometric location analysis distinguishes data by identifying the boundaries and interior points marked in the original mesh data; Based on the connection relationships between grid points marked in the original mesh data, n contours are generated for the boundary. These n contours include 1 outer contour and n-1 hole contours, where n≥1. Perform inner and outer boundary analysis on the grid points on the contour and mark them as boundary nodes; Arrange the boundary nodes in order; Traverse each boundary node, calculate the curvature of each boundary node, and identify the node type; Grid points at non-outline locations are marked as internal nodes; The node type is encoded using a five-dimensional one-hot vector.

4. The method according to claim 3, characterized in that, The specific implementation process of performing inner and outer boundary analysis on the grid points on the contour and marking them as boundary nodes includes: Generate polygons from all contours, determine the inclusion relationship between each polygon, and ensure that the polygon generated from the hole contour is contained within the polygon generated from the outer contour; mark the grid points on the outer contour as outer boundary nodes, and mark the grid points on the hole contour as inner boundary nodes.

5. The method according to claim 3, characterized in that, The specific implementation process of traversing each boundary node, calculating the curvature of each boundary node, and identifying the node type includes: The boundary node is connected to two adjacent boundary nodes to form two line segments, and the curvature of the two line segments is calculated to obtain the first curvature k1 and the second curvature k2. If the difference between the first curvature k1 and the second curvature k2 is within the threshold range, the node type of the current boundary node is not changed. If the difference between the first curvature k1 and the second curvature k2 exceeds the threshold range, it is further determined whether the current boundary node is an outer boundary node. If it is, it is marked as an outer vertex; otherwise, it is marked as an inner vertex.

6. The method according to claim 1, characterized in that, During training, the loss function of the dual-branch neural network consists of the mean square error between the predicted node position and the target node position, the orientation similarity loss, and the penalty for internal node out-of-bounds errors.

7. An adaptive generation system for electromagnetic field simulation meshes that implements the method of any one of claims 1-6, characterized in that, include: The raw mesh data acquisition module is responsible for building a semiconductor device simulation model, performing mesh generation on the semiconductor device simulation model, and obtaining raw mesh data. The node feature extraction module is responsible for constructing node features from the original segmented data; The node features include a first globally normalized coordinate feature, a second globally normalized coordinate feature, electric field strength, and node type; the node type includes internal nodes, outer boundary nodes, outer vertices, inner boundary nodes, and inner vertices. The undirected graph construction module is responsible for constructing undirected graphs, whose graph nodes adopt the node characteristics of grid points, and whose connecting edges adopt the Euclidean distance between grid points and adjacent grid points. The module for predicting node positions is responsible for inputting the undirected graph into the dual-branch neural network and outputting the predicted node positions. The node correction module is responsible for correcting each node of the original subdivided data using the predicted node positions obtained from the dual-branch neural network.

8. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-6.

9. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-6.