Electromagnetic simulation isosurface extraction method based on spatial rearrangement and deep learning prediction
By employing spatial rearrangement and deep learning prediction methods, the problems of wasted computational resources and insufficient real-time performance in isosurface extraction during electromagnetic simulation are solved, achieving efficient and accurate isosurface generation, which is suitable for rapid rendering and analysis of electromagnetic simulation data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNIV OF ELECTRONICS SCI & TECH OF CHINA
- Filing Date
- 2026-01-14
- Publication Date
- 2026-05-12
AI Technical Summary
Existing isosurface extraction methods suffer from problems such as wasted computational resources, memory access bottlenecks due to unstructured meshes, and insufficient real-time performance when processing large-scale electromagnetic simulation data, failing to meet the real-time rendering requirements in electromagnetic simulations.
A spatial rearrangement and deep learning prediction method is adopted. The grid data is rearranged in memory through Merton coding, a fully connected neural network is constructed for probability prediction, an active cell candidate table is generated, and an isosurface grid is generated through geometric interpolation.
It significantly improves computational efficiency, reduces invalid computation areas, and enhances geometric and visualization accuracy. It is suitable for modern graphics processors and multi-core CPU architectures, meeting the diverse needs of electromagnetic simulation from qualitative observation to quantitative analysis.
Smart Images

Figure CN121525525B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computational electromagnetics and relates to a method for rapidly extracting isosurfaces from large-scale unstructured grid data in post-processing of electromagnetic field simulation. Specifically, it provides an electromagnetic simulation isosurface extraction method based on spatial rearrangement and deep learning prediction. Background Technology
[0002] In computational electromagnetics (CEM), the finite element method (FEM) or finite volume method (FVM) is often used to solve Maxwell's equations, generating massive amounts of three-dimensional unstructured mesh data. Engineers need to extract isosurfaces (such as electric field intensity isosurfaces and magnetic flux density isosurfaces) to analyze antenna radiation patterns, radar cross sections (RCS), or electromagnetic compatibility (EMC) issues.
[0003] However, existing isosurface extraction methods still face many challenges when processing large-scale electromagnetic simulation data. First, there is computational waste due to sparsity. Electromagnetic field data often exhibits strong spatial locality. For example, high field strength regions are concentrated only at the feed or gaps. Traditional moving cubes / tetrahedra algorithms employ a full traversal strategy, wasting more than 90% of the computation time in background regions with flat or near-zero field strength values in data with tens of millions of grid cells. Second, there is the memory bottleneck of unstructured meshes. Electromagnetic simulations often use tetrahedral adaptive meshes to fit complex geometric boundaries. The storage order of such meshes in memory is usually random, resulting in extremely low cache hit rates for CPUs / GPUs during field value interpolation, severely limiting the interactive frame rate of post-processing software. Third, there is insufficient real-time performance. Existing acceleration structures (such as octrees) have long construction times and cannot meet the real-time rendering requirements of parametric sweep or transient field analysis in electromagnetic simulations. To address these issues, this invention proposes a method for extracting isosurfaces from electromagnetic simulations based on spatial rearrangement and deep learning prediction. Summary of the Invention
[0004] The purpose of this invention is to provide an isosurface extraction method that combines spatial reordering and deep neural network prediction (DNN prediction) to solve problems such as wasted computing resources, memory access bottlenecks of unstructured grids, and insufficient real-time performance in existing technologies.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A method for extracting isosurfaces from electromagnetic simulations based on spatial rearrangement and deep learning prediction includes the following steps:
[0007] Step 1: Obtain the three-dimensional unstructured mesh data and corresponding electromagnetic field scalar values generated by electromagnetic simulation, and use Morton coding to rearrange the mesh data in memory to complete the spatial rearrangement;
[0008] Step 2: Construct a fully connected neural network and complete the training to obtain a prediction model; the input of the prediction model is the field scalar value of all vertices of the grid cell and the corresponding target isosurface, and the prediction model outputs the active probability that the grid cell contains isosurfaces.
[0009] Step 3: Input the spatially rearranged grid data into the prediction model in batches for probability prediction, set a probability threshold, and retain all grid cells whose probability prediction value is greater than the probability threshold to form an active cell candidate table.
[0010] Step 4: Perform geometric interpolation on the grid cells in the active cell candidate table to generate an isosurface grid.
[0011] Furthermore, the specific process of step 1 is as follows:
[0012] Step 1.1: For each mesh cell in the 3D unstructured mesh data generated by electromagnetic simulation, calculate the centroid coordinates of the mesh cell;
[0013] Step 1.2: Quantize the three-axis coordinates of the centroid coordinates of each grid cell into integers, and generate Morton codes using the bit-crossing algorithm;
[0014] Step 1.3: Sort the grid cells and their corresponding electromagnetic field data in ascending order using Morton code as the index.
[0015] Furthermore, in step 1.2, the quantization process employs integer centroid quantization.
[0016] Furthermore, in step 2, the field scalar values include: electric field magnitude or magnetic field magnitude.
[0017] Furthermore, in step 2, the fully connected neural network consists of an input layer, two hidden layers, and an output layer connected together. The input layer receives the input data. , Represents the first grid cell The field scalar value at each vertex, This represents the total number of vertices in the grid cells. The target is equal to the target; the number of neurons in the two hidden layers are 128 and 64 respectively, and the activation function is a linear rectified function; the output layer uses the Softmax function to output the binary classification probability, outputting the active probability and the idle probability.
[0018] Furthermore, in step 3, the threshold value ranges from 0.01.
[0019] Furthermore, in step 4, the geometric interpolation uses the moving tetrahedron algorithm.
[0020] Based on the above technical solution, the beneficial effect of this invention is to provide a method for extracting isosurfaces from electromagnetic simulations based on spatial rearrangement and deep learning prediction. First, the unstructured grid data output from the electromagnetic simulation is rearranged in memory using the Z-order curve (also known as Morton code), forcing geometrically adjacent field points to be continuous in physical memory, thereby transforming random memory access into streaming memory access and significantly improving bandwidth utilization. Then, a lightweight fully connected neural network is constructed, inputting the field scalar values (such as electric field magnitudes) of the grid cell vertices. or magnetic field magnitude The algorithm calculates the probability of a grid cell crossing the isosurface and outputs the probability of the grid cell crossing the isosurface. It then uses a trained network model to perform fast batch inference on the rearranged grid data, eliminating most of the background spatial domain with extremely low computational cost and generating a candidate list of active cells. Finally, it performs precise geometric interpolation on the selected active cells to generate a high-quality isosurface grid.
[0021] In summary, the present invention has the following advantages:
[0022] 1) Improved computational efficiency: This invention can skip about 90.9% of the invalid computation region, i.e. the background spatial domain, which significantly shortens the post-processing waiting time for large-scale electromagnetic field data;
[0023] 2) Controllable geometric precision: This invention can control the geometric precision through probability thresholds ( The dynamic adjustment of the threshold can flexibly balance rendering speed and geometric accuracy. The threshold can be increased in the coarse preview mode to achieve ultra-fast rendering, or the threshold can be decreased in the fine analysis mode to ensure that all minute features are captured, thereby meeting the different needs of electromagnetic simulation from qualitative observation to quantitative analysis.
[0024] 3) High visualization accuracy: The geometric integrity of key electromagnetic field features (such as lobes and nulls) is ensured through a fully connected neural network model, and the Hausdorff distance error is controlled within the order of grid size;
[0025] 4) Good hardware compatibility: Memory rearrangement significantly reduces cache misses, making it particularly suitable for modern graphics processing unit (GPU) and many-core central processing unit (CPU) architectures. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating the electromagnetic simulation isosurface extraction method based on spatial rearrangement and deep learning prediction provided by the present invention.
[0027] Figure 2 This is a memory access index distribution diagram of unstructured grid data after spatial rearrangement in this invention.
[0028] Figure 3 This is a distribution diagram of memory access indexes for unstructured grid data in existing technologies.
[0029] Figure 4 A comparison of the computational load of the electromagnetic simulation isosurface extraction method based on spatial rearrangement and deep learning prediction provided by this invention with traditional methods.
[0030] Figure 5 The sampling distribution map is provided by the electromagnetic simulation isosurface extraction method based on spatial rearrangement and deep learning prediction provided by the present invention.
[0031] Figure 6 This is a sampling distribution diagram of traditional methods in the existing technology.
[0032] Figure 7 The geometric similarity analysis results of the electromagnetic simulation isosurface extraction method based on spatial rearrangement and deep learning prediction provided by this invention are shown in the figure.
[0033] Figure 8 This is a diagram showing the geometric similarity analysis results of traditional methods in the existing technology. Detailed Implementation
[0034] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0035] This embodiment provides a method for extracting isosurfaces from electromagnetic simulations based on spatial rearrangement and deep learning prediction, such as... Figure 1 As shown, the specific steps include:
[0036] Step 1: Obtain the three-dimensional unstructured mesh data and corresponding electromagnetic field scalar values generated by electromagnetic simulation, and use Morton coding to rearrange the mesh data in memory to complete the spatial rearrangement so that adjacent mesh cells are continuous in memory address.
[0037] Step 1.1: For each mesh cell (e.g., a tetrahedral mesh) in the unstructured mesh data output from the electromagnetic simulation, calculate the centroid coordinates of each mesh cell. ;
[0038] Step 1.2: Set the centroid coordinates of each grid cell. of The coordinates are quantized into integers, and a 64-bit Morton code is generated using a bit-interleaving algorithm. The quantization process uses integer centroid quantization.
[0039] Step 1.3: Sort the grid cells and corresponding electromagnetic field data in ascending order using Morton code as the index;
[0040] Figure 2 shows the memory access pattern of unstructured grid data after spatial rearrangement in this embodiment. For comparison, as shown... Figure 3 The figure shows the access pattern of unstructured mesh data in the traditional method (moving cube / tetrahedron algorithm). As can be seen from the figure, Figure 3 During random access, the indexes of data access are discretely distributed. However, after spatial rearrangement in this embodiment, the indexes of data access exhibit spatial locality aggregation and are arranged in a Z-order curve. That is, the index stride is significantly reduced and the cache locality is greatly improved.
[0041] Step 2: Construct a fully connected neural network and complete its training to obtain a prediction model; the input to the prediction model is the field scalar value (such as the electric field magnitude) of all vertices of the grid cell. or magnetic field magnitude The model outputs the probability that the grid cell contains an isosurface, which is equivalent to the corresponding target.
[0042] The fully connected neural network consists of an input layer, two hidden layers, and an output layer connected together. The input layer receives input data. , Represents the first grid cell The field scalar value at each vertex, This represents the total number of vertices in the grid cells. The target is equal to the target; the number of neurons in the two hidden layers are 128 and 64 respectively, and the activation function for both is the Rectified Linear Activated Function (ReLU); the output layer uses the Softmax function to output the binary classification probability, outputting the active probability and the idle probability;
[0043] During the training process of the fully connected neural network, training samples are generated using typical antenna radiation field or waveguide transmission field data, and the labels are automatically generated by the geometric intersection detection algorithm.
[0044] Step 3: Input the spatially rearranged grid data into the prediction model in batches for probability prediction, and set the probability threshold ( ), retain all grid cells whose probability prediction value is greater than the probability threshold, and form an active cell candidate table;
[0045] Step 4: Perform geometric interpolation on the grid cells in the active cell candidate table to generate an isosurface grid; the geometric interpolation uses the Marching Tetrahedra algorithm to generate a triangular grid.
[0046] like Figure 4 The figure shows a comparison of the computational load of this embodiment and the traditional method (full scan). As can be seen from the figure, when processing grid data of about 4 million grid cells, this embodiment successfully filtered more than 90% of the background spatial domain through the prediction module, and only needed to perform geometric calculations on about 10% of the region, that is, only performed geometric interpolation on the grid cells in the active cell candidate table.
[0047] like Figure 5 The image shown is a sampling distribution diagram of the electromagnetic simulation isosurface extraction method based on spatial rearrangement and deep learning prediction in this embodiment. For comparison, as shown... Figure 6 The figure shows the sampling distribution of the traditional method (moving cube / tetrahedron algorithm); as can be seen from the figure, compared with the uniform sampling of the entire space in the traditional method, the sampling points of the present invention are highly concentrated near the isosurface features, which greatly reduces invalid calculations.
[0048] The beneficial effects of the present invention will be explained in detail below with reference to accuracy verification.
[0049] like Figure 7 The image shown is a geometric similarity analysis result of the electromagnetic simulation isosurface extraction method based on spatial rearrangement and deep learning prediction in this embodiment. For comparison, as shown... Figure 8 The image shows the geometric similarity analysis results of the traditional method (moving cube / tetrahedron algorithm). A quantitative analysis of the results is as follows:
[0050] 1) Hausdorff Distance: Calculate the bidirectional Hausdorff distance between the extracted result and the true value. The maximum geometric error measured is 0.12095 (normalized unit). This value is on the same order of magnitude as the average side length of the grid cell, which is within the normal range of grid discretization error and does not introduce visually visible deformation.
[0051] 2) Point-wise Error Distribution: The error histogram shows that the geometric deviation of the vast majority of sampling points is concentrated in the small interval of [0, 0.02], with very few long-tailed distributions, indicating that the present invention has extremely high stability in ensuring geometric details;
[0052] 3) Accuracy Distribution: Statistical analysis shows that the accuracy index exhibits a significant unimodal and left-skewed shape, which means that the error of the vast majority of prediction results is close to zero. The prediction model not only successfully locates the isosurface, but also maintains a high degree of consistency with the true solution in terms of geometry and topology, without significant structure loss or artifacts.
[0053] The above description is merely a specific embodiment of the present invention. Any feature disclosed in this specification may be replaced by other equivalent or similar features unless otherwise specified. All disclosed features, or steps in all methods or processes, may be combined in any way except for mutually exclusive features and / or steps.
Claims
1. A method for extracting isosurfaces in electromagnetic simulation based on spatial rearrangement and deep learning prediction, characterized in that, Includes the following steps: Step 1: Obtain the three-dimensional unstructured mesh data and corresponding electromagnetic field scalar values generated by electromagnetic simulation, and use Morton coding to rearrange the mesh data in memory to complete the spatial rearrangement; Step 2: Construct a fully connected neural network and complete the training to obtain a prediction model; the input of the prediction model is the field scalar value of all vertices of the grid cell and the corresponding target isosurface, and the prediction model outputs the activity probability that the grid cell contains isosurfaces. A fully connected neural network consists of an input layer, two hidden layers, and an output layer. The input layer receives the input data. , Represents the first grid cell The field scalar value at each vertex, This represents the total number of vertices in the grid cells. The target is equal to the target; the number of neurons in the two hidden layers are 128 and 64 respectively, and the activation function is a linear rectified function; the output layer uses the Softmax function to output the binary classification probability, outputting the active probability and the idle probability; Step 3: Input the spatially rearranged grid data into the prediction model in batches for probability prediction, set a probability threshold, and retain all grid cells whose probability prediction values are greater than the probability threshold to form an active cell candidate table. Step 4: Perform geometric interpolation on the grid cells in the active cell candidate table to generate an isosurface grid.
2. The method for extracting electromagnetic simulation isosurfaces based on spatial rearrangement and deep learning prediction according to claim 1, characterized in that, The specific process of step 1 is as follows: Step 1.1: For each mesh cell in the 3D unstructured mesh data generated by electromagnetic simulation, calculate the centroid coordinates of the mesh cell; Step 1.2: Quantize the three-axis coordinates of the centroid coordinates of each grid cell into integers, and generate Morton codes using the bit-crossing algorithm; Step 1.3: Sort the grid cells and their corresponding electromagnetic field data in ascending order using Morton code as the index.
3. The method for extracting electromagnetic simulation isosurfaces based on spatial rearrangement and deep learning prediction according to claim 2, characterized in that, In step 1.2, the quantization process uses integer centroid quantization.
4. The method for extracting electromagnetic simulation isosurfaces based on spatial rearrangement and deep learning prediction according to claim 1, characterized in that, In step 2, the field scalar values include: electric field magnitude or magnetic field magnitude.
5. The method for extracting electromagnetic simulation isosurfaces based on spatial rearrangement and deep learning prediction according to claim 1, characterized in that, In step 3, the threshold value ranges from 0.
01.
6. The method for extracting electromagnetic simulation isosurfaces based on spatial rearrangement and deep learning prediction according to claim 1, characterized in that, In step 4, the geometric interpolation uses the moving tetrahedron algorithm.