Grid encryption method, computer equipment, storage medium and program product
By introducing body and surface element error indicators in high-frequency electromagnetic field calculation, identifying key grid areas and performing local encryption, the problems of accuracy and resource consumption in S parameter calculation are solved, and higher computing efficiency and accuracy are achieved.
Patent Information
- Application Number
- CN202510542198.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-04-28
AI Technical Summary
In high-frequency electromagnetic field calculation, the high-precision calculation of S parameters faces the challenges of geometric complexity, frequency dependence and unevenness of error distribution, resulting in high computing resource consumption and insufficient accuracy.
By introducing bulk element error index and surface element error index, the grid area that has the greatest impact on S parameters is identified and local encryption is performed to achieve accelerated convergence and accuracy improvement.
It significantly reduces the consumption of computing resources and improves the S-parameter solution accuracy, and is suitable for finite element electromagnetic simulation calculations of complex structures such as transmission lines, vias, and printed circuit boards.
Smart Images

Figure CN120068782A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of grid encryption, and particularly to a grid encryption method, a computer device, a storage medium and a program product. Background Art
[0002] Problems of high-frequency electromagnetic fields are widely applied in fields such as microwave communication, antenna design, and radio frequency circuits. In these problems, S-parameters are key indicators for evaluating system performance, used to reflect the transmission, reflection, and coupling characteristics of electromagnetic waves. However, the high-precision calculation of S-parameters poses the following challenges to the finite element numerical method: geometric complexity, the calculation of high-frequency electromagnetic fields involves complex geometric shapes and boundary conditions, such as sharp corner features, multi-layer interfaces, or small-size structures in microwave devices; frequency dependence, high-frequency electromagnetic wave propagation has a short wavelength, posing higher requirements for the resolution of the grid; non-uniformity of error distribution, electromagnetic field errors are concentrated in sharp corners, current concentration regions, or dielectric interfaces, while the errors may be smaller in other regions. Therefore, there is an urgent need for a grid encryption method that can improve the calculation accuracy of S-parameters for complex structures such as transmission lines, vias, and PCBs in three-dimensional electromagnetic finite element simulations, optimize computing resources, and reduce computing costs. Summary of the Invention
[0003] The purpose of the present invention is to provide a grid encryption method, a computer device, a storage medium and a program product. By introducing a volume element error index and a surface element error index, it identifies the grid regions that have the greatest impact on the S-parameters and locally encrypts them to accelerate convergence. Compared with traditional global or local grid refinement methods, it can significantly reduce the consumption of computing resources and improve the solution accuracy of the target quantity, and is applicable to finite element electromagnetic simulation calculations of complex structures such as transmission lines, vias, and printed circuit boards.
[0004] The technical solution provided by the present invention is as follows: In a first aspect, the present application provides a grid encryption method, including the steps of: Obtain the input initial grid, frequency, maximum number of iterations, and a preset S-parameter change threshold; Read the initial grid and perform grid boundary recognition to obtain grid blocks with different material properties; Construct a finite element matrix at a single frequency according to the grid blocks with different material properties; Solve the finite element matrix to obtain the S-parameter matrix at the current iteration. When the number of iterations is greater than 1, calculate the current S-parameter change amount according to the S-parameter matrix obtained at the current iteration and the S-parameter matrix obtained at the previous iteration; When the current S-parameter change amount is greater than the preset S-parameter change threshold, construct the mapping relationship between the four faces of each tetrahedron of the initial grid and the adjacent tetrahedrons; Calculate the volume charge, volume current density, surface charge, and surface current density of each tetrahedron according to the mapping relationship; Calculate the volume error of each tetrahedron according to the volume charge and the volume current density, calculate the surface error of each face of each tetrahedron according to the surface charge and the surface current density, and calculate the total error of each tetrahedron according to the volume error and the surface error of each tetrahedron; Calibrate the tetrahedrons that need to be refined according to the total error of each tetrahedron; Refine the tetrahedrons that need to be refined and update the initial mesh for the next iteration.
[0005] In one embodiment, the grid boundary recognition includes: Based on the markings of different cells in the initial mesh, filter out the mesh blocks with different material properties; Judge the grid boundary of each piece of material according to the overlapping properties of each triangular face in the tetrahedrons of each mesh block.
[0006] In one embodiment, the calculating the volume charge, volume current density, surface charge, and surface current density of each tetrahedron according to the mapping relationship includes: Calculate the physical property jump amount between each tetrahedron and its adjacent tetrahedrons on the common face according to the mapping relationship; Obtain the volume charge, the volume current density, the surface charge, and the surface current density of each tetrahedron according to the physical property jump amount and the electric field vector of each tetrahedron.
[0007] In one embodiment, the calibrating the tetrahedrons that need to be refined according to the total error of each tetrahedron includes: Store the total error of each tetrahedron and sort them in ascending order; Successively filter out the tetrahedrons with larger total errors through a reverse iterator. When the total error of a tetrahedron is greater than the preset error value, mark this tetrahedron as the tetrahedron that needs to be refined.
[0008] In one embodiment, it further includes: when the number of tetrahedrons that need to be refined is greater than a preset percentage of the total number of tetrahedrons, jump out of the iteration.
[0009] In one embodiment, it further includes: when the number of iterations is less than the maximum number of iterations and the change amount of the current S parameter is less than the preset S parameter change threshold, judge that the grid reaches the convergence state and end the grid refinement.
[0010] In one embodiment, the maximum number of iterations is 50, and the preset S parameter change threshold is 0.02.
[0011] In a second aspect, the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the steps of a grid encryption method described in the first aspect.
[0012] In a third aspect, the present application provides a computer storage medium, on which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the steps of a grid encryption method described in the first aspect are implemented.
[0013] In a fourth aspect, the present application provides a computer program product, including a computer program or instruction. When the computer program or instruction is executed by a processor, the steps of a grid encryption method described in the first aspect are implemented.
[0014] According to a grid encryption method, a computer device, a storage medium, and a program product provided by the present invention, by introducing a volume element error index and a surface element error index, identifying the grid region that has the greatest impact on the S parameter, and locally encrypting it to accelerate convergence. Compared with traditional global or local grid refinement methods, it can significantly reduce the consumption of computing resources and improve the solution accuracy of the target quantity, and is applicable to finite element electromagnetic simulation calculations of complex structures such as transmission lines, vias, and printed circuit boards. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above characteristics, technical features, advantages, and their implementation manners of the present solution will be further described below in a clear and understandable manner in combination with the drawings to illustrate the preferred embodiments.
[0016] Figure 1 is a schematic diagram of the overall process of an embodiment of the present invention; Figure 2 is a schematic diagram of the process of an embodiment of the present invention; Figure 3 is a schematic diagram of the cut-board structure of a PCB along the illustrated metal line and its air box calculation domain in an embodiment of the present invention; Figure 4 is a schematic diagram of the initial grid in an embodiment of the present invention; Figure 5 is a schematic diagram of the metal boundary in an embodiment of the present invention; Figure 6 is a schematic diagram of the tetrahedral grid unit to be encrypted in an embodiment of the present invention; Figure 7 is a schematic diagram of the grid distribution after encryption in an embodiment of the present invention; Figure 8 is a schematic diagram of the grid distribution after convergence in an embodiment of the present invention; Figure 9It is a schematic diagram of the grid distribution after convergence in the prior art of the present invention; Figure 10 It is a schematic diagram of the convergence curve of the current S-parameter change amount during the encryption process in an embodiment of the present invention; Figure 11 It is a schematic diagram for comparing the convergence curve of the current S-parameter change amount in an embodiment of the present invention with the convergence curve of the current S-parameter change amount in the prior art. Detailed implementation manners
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the specific implementation manners of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings, and other implementation manners can be obtained.
[0018] To make the drawings concise, only the parts related to the present invention are schematically shown in each drawing, and they do not represent the actual structure of the product. In addition, to make the drawings concise and easy to understand, in some drawings, components with the same structure or function are only schematically shown for one of them, or only one of them is marked. In this article, "one" not only means "only this one", but also means "more than one" situation.
[0019] Problems of high-frequency electromagnetic fields are widely applied in fields such as microwave communication, antenna design, and RF circuits. In these problems, S-parameters are key indicators for evaluating system performance, and are used to reflect the transmission, reflection, and coupling characteristics of electromagnetic waves. However, the high-precision calculation of S-parameters poses the following challenges to the finite element numerical method: geometric complexity, the calculation of high-frequency electromagnetic fields involves complex geometric shapes and boundary conditions, such as sharp corner features, multi-layer interfaces, or small-size structures in microwave devices; frequency dependence, high-frequency electromagnetic wave propagation has a short wavelength, which poses higher requirements for the resolution of the grid; non-uniformity of error distribution, electromagnetic field errors are concentrated in sharp corners, current concentration areas, or dielectric interfaces, while the errors may be smaller in other areas.
[0020] Traditional grid refinement methods, including global refinement and empirical encryption strategies, have the following problems: global refinement is to uniformly encrypt the entire calculation domain, which will lead to a sharp increase in the number of grids and inefficiency; empirical encryption is a local encryption method based on geometric features, but it cannot effectively associate with the target physical quantity and is difficult to significantly improve the accuracy of S-parameters. Therefore, there is an urgent need for a grid encryption method that can improve the calculation accuracy of S-parameters for complex structures such as transmission lines, vias, and PCBs in three-dimensional electromagnetic finite element simulation, optimize computing resources, and reduce the calculation cost.
[0021] This solution proposes a mesh encryption method based on S-parameters and oriented towards the target under the 0th-order vector finite element basis function, which directly correlates the error estimation of S-parameters with the mesh encryption process to achieve higher accuracy and better computational efficiency. By introducing volume element error metrics and surface element error metrics, it identifies the mesh regions that have the greatest impact on S-parameters and locally encrypts them to accelerate convergence. Compared with traditional global or local mesh refinement methods, it can significantly reduce computational resource consumption and improve the solution accuracy of the target quantity, and is applicable to finite element electromagnetic simulation calculations of complex structures such as transmission lines, vias, and printed circuit boards. Next, this solution will be described in detail with reference to the accompanying drawings: An embodiment of the present invention, as Figure 1 and Figure 2 shown, the present invention provides a mesh encryption method, including the steps of: S100. Obtain the input initial mesh, frequency, maximum number of iterations, and preset S-parameter change threshold; S200. Read the initial mesh and perform mesh boundary recognition to obtain mesh blocks with different material properties; S300. Construct a finite element matrix at a single frequency according to the mesh blocks with different material properties; S400. Solve the finite element matrix to obtain the S-parameter matrix at the current iteration. When the number of iterations is greater than 1, calculate the current S-parameter change amount based on the S-parameter matrix obtained at the current iteration and the S-parameter matrix obtained at the previous iteration; S500. When the current S-parameter change amount is greater than the preset S-parameter change threshold, construct the mapping relationship between the four faces of each tetrahedron of the initial mesh and the adjacent tetrahedrons; S600. Calculate the volume charge, volume current density, surface charge, and surface current density of each tetrahedron according to the mapping relationship; S700. Calculate the volume error of each tetrahedron according to the volume charge and volume current density, calculate the surface error of each face of each tetrahedron according to the surface charge and surface current density, and calculate the total error of each tetrahedron according to the volume error and surface error of each tetrahedron; S800. Calibrate the tetrahedrons that need to be encrypted according to the total error of each tetrahedron; S900. Encrypt the tetrahedrons that need to be encrypted and update the initial mesh for the next iteration.
[0022] For the initial mesh to be encrypted, the mesh boundary is first identified to determine the different material properties of each mesh. Then, a finite element matrix is constructed based on the different material properties of each mesh. According to the finite element matrix, the S-parameter matrix at the current iteration can be calculated. When the change in the current S-parameters is greater than the preset S-parameter change threshold, that is, when the mesh is not converged, the mapping relationship between the four faces of each tetrahedron in the initial mesh and the adjacent tetrahedrons is constructed, and the volume charge, volume current density, surface charge, and surface current density of each tetrahedron are calculated. Thus, the volume error and surface error of each tetrahedron can be obtained. Taking the volume error and surface error as the judgment criteria, the tetrahedrons that need to be encrypted are determined and encrypted. It is possible to identify the mesh area that has the greatest impact on the S-parameters, thereby performing accurate local encryption, which is beneficial to improving the calculation accuracy and significantly reducing the consumption of computing resources. It is applicable to the finite element electromagnetic simulation calculations of complex structures such as transmission lines, vias, and printed circuit boards.
[0023] In one embodiment, for a PCB board as Figure 3 shown, its initial mesh is as Figure 4 shown. The initial mesh can be input into the finite element solver in VTK text format. For Figure 4 an example of an initial mesh shown, the VTK text format contains the coordinate information (X, Y, Z) of 4117 mesh nodes, where X, Y, and Z are the x, y, and z components of the coordinates respectively. For example, for the node numbered 0, the coordinate information is (0.088902, -0.002852, 1.98122); the VTK text format also contains the information of 22697 mesh elements (N, N0, N1, N2,...), where N is the number of mesh nodes contained in the element, and N0, N1, N2,... are the numbers of each mesh node in the element respectively. For example, the element numbered 0 is a triangular mesh element, and its mesh information is (3, 66, 150, 500), and the element numbered 3730 is a tetrahedral mesh element, and its mesh information is (4, 38, 230, 88, 153); the VTK text format also contains the type numbers of 22697 mesh elements. For example, the triangular element number is 5, and the tetrahedron number is 10. At the same time, the VTK text format also contains the marks of 22697 mesh elements, which are used for mesh boundary identification and material type definition.
[0024] The input information includes frequency and adaptive encryption information at the same time. For example, in one embodiment, the input frequency is 10 GHz; the adaptive encryption information includes the maximum number of iterations for mesh encryption to control adaptive encryption and the preset S-parameter change threshold for controlling mesh convergence (maximum ), It refers to the change amount between the S parameters obtained from two adjacent iterative calculations during the adaptive mesh refinement process. In this embodiment, the maximum number of iterations is 50, and the preset S parameter change threshold is 0.02. In other embodiments, it can be adjusted according to the calculation accuracy and requirements, which is not limited in this application.
[0025] When reading the initial mesh, the VTK mesh file is read into the mesh data structure of the finite element solver, and different data structures are constructed according to the mesh element types to store the corresponding mesh data. For example, mesh nodes can be stored in the node data structure, and the data structure contains the numbers of the mesh nodes and their coordinate components in the X, Y, and Z directions. For example, node 0: [0, 0.088902, -0.002852, 1.98122]; triangular elements are stored in the triangular data structure, and the data structure contains the numbers of the triangular elements and the numbers of their N0, N1, and N2 mesh nodes. For example, triangular element 0: [0, 66, 150, 500]; tetrahedral elements are stored in the tetrahedral data structure, and the data structure contains the numbers of the tetrahedral elements and the numbers of their N0, N1, N2, and N3 mesh nodes. For example, the tetrahedral mesh element with mesh number 3730: [0, 38, 230, 88, 153]; mesh tags are stored in the mesh tag container. For example, the calculation domain tags are all 1, and the corresponding material is vacuum.
[0026] In one embodiment, mesh boundary recognition is performed to obtain mesh blocks with different material properties, including: screening out mesh blocks with different material properties based on the tags of different elements in the initial mesh; and judging the mesh boundaries of each piece of material according to the overlapping properties of the triangular faces in the tetrahedrons of each mesh block.
[0027] Based on the tags of different elements in the mesh, mesh blocks with different material properties can be screened out. According to the overlapping properties of the triangular faces in the tetrahedrons of each mesh block, the mesh boundaries of each piece of material can be judged. For example, in a specific implementation, the mesh tag of the metal wire is 9, as Figure 5 shown, the method for identifying the metal boundary is: traverse all tetrahedral mesh elements with the tag of 9, mark the overlapping of the triangles in these tetrahedral elements, and if a triangle face does not overlap with other triangle faces, then this triangle face belongs to the boundary face.
[0028] According to the mesh blocks with different material properties, a finite element matrix at a single frequency can be constructed. The expression of the finite element matrix is: (1) Where is the relative magnetic permeability of the material, is the relative permittivity of the material, is the electric field vector, is the vector edge basis function of the grid cell. In this embodiment, the 0th-order edge basis function is adopted, and the expression is , is the volume coordinate or area coordinate of a point within the grid cell, is the edge length of the edge with starting point numbers i and j within the grid cell. At the same time, in Formula 1: is the angular frequency, and its relationship with the frequency f is , and the frequency selected in the example is 10 GHz, and the calculated angular frequency is approximately ; , and the magnitude of this variable in the example is approximately 209.5845, , are the vacuum permittivity and the vacuum permeability respectively; j is the imaginary part symbol in complex numbers, is the unit normal vector of the triangular surface on the boundary.
[0029] The material properties of the PCB structure in the example are specifically shown in the following table:
[0030] Through the 0th-order vector basis function, a linear equation system in the form of AX = B can be constructed. In this example, both A and B are in the form of sparse matrices. Under the initial grid, the dimension of matrix A is (25140, 25140), and the dimension of matrix B is (25140, 3). The first column in matrix B stores the right-hand side term under the excitation of the first port, the second column stores the right-hand side term under the excitation of the second port, and the third column stores the right-hand side term under the simultaneous excitation of both ports.
[0031] Taking the sparse matrices A and B as inputs, calling the sparse matrix direct solver to solve the linear equation system AX = B, the S-parameter matrix [S] is solved according to Formula (2), (2) where is a matrix with dimensions (p, p) from the m - pth row to the pth row and from the 0th column to the pth column of matrix X, and I is the identity matrix with dimensions (p, p). In this example, under the initial grid, m is 25140 and p is 2. In the first grid encryption iteration based on the initial grid, the initial value is a null value. In the case where the number of adaptive encryption iterations n is greater than 1, the calculation formula for the change in S-parameters is: (3) That is, subtract the S-parameter matrix stored in the previous iteration from the current S-parameter matrix, and then take the absolute value of the maximum magnitude of the resulting new matrix. For example, the calculation process of the change in S-parameters after the first grid encryption in adaptive encryption is:
[0032] That is, the value of the obtained change in S-parameters is 0.9039. The change curves under each grid refinement iteration are as Figure 10 shown.
[0033] When the number of iterations is less than the maximum number of iterations and the current change in S-parameters is less than the preset S-parameter change threshold, it is determined that the grid reaches the convergence state, and the grid refinement ends.
[0034] Specifically, compare the calculated current change in S-parameters with the preset S-parameter change threshold input in step S100 (for example, the preset S-parameter change threshold is 0.02). If the current number of iteration steps is less than the maximum number of iteration steps (for example, the maximum number of iteration steps is 50) and , then it is determined that in this iteration state, the grid reaches the convergence state; if not, it is determined that in this iteration state, the grid does not reach the convergence state. For example, in a specific implementation, the number of iteration steps n after the grid converges is 13, and the current change in S-parameters is 0.0113; while when using commercial software, when the number of iteration steps n after the grid converges is 13, the current change in S-parameters is 0.02. It can be seen that the calculation accuracy of this application is higher.
[0035] In one embodiment, calculate the volume charge, volume current density, surface charge, and surface current density of each tetrahedron according to the mapping relationship, specifically including: calculating the physical property jump amount between each tetrahedron and its adjacent tetrahedrons on the common surface according to the mapping relationship; calculating the volume charge, volume current density, surface charge, and surface current density of each tetrahedron based on the physical property jump amount and the electric field vector of each tetrahedron.
[0036] Specifically, in the error calculation of the tetrahedron, to calculate the charge and current density of the four faces of each tetrahedron unit, according to the error estimation theory, it is necessary to calculate the physical property jump amount between each tetrahedron and its adjacent tetrahedrons on the common surface. The mapping relationship between each face of each tetrahedron and its adjacent tetrahedrons can be constructed based on the following data structure. [{ , }, { , }, { , }, { , }, Ne0], [{ , }, { , }, { , }, { , },Ne1], ... In the above data structure, each row contains the face numbers of the four faces of a tetrahedron and the corresponding adjacent tetrahedron element numbers, and then the global mapping is constructed in sequence according to the tetrahedron numbers. In addition, if several faces of a tetrahedron are on the boundary, the triangle on the boundary face of the tetrahedron has no adjacent tetrahedron. When filling the data structure, only the mapping data of the existing adjacent tetrahedrons need to be filled.
[0038] For example, in the initial mesh: For the tetrahedron numbered 0, its mapping information is [{0, 8705}, {1, 2}, {2, 116}, {3, 1225}]; For the tetrahedron numbered 1, its mapping information is [{4, 3}, {5, 143}, {7, 130}]. This tetrahedron has only three faces with adjacent tetrahedrons.
[0039] Based on the finite element solution X, the electric field vector of each tetrahedron can be calculated , and the calculation formula is , that is: multiply the vector basis function of each edge corresponding to the centroid of each tetrahedron by the finite element solution corresponding to the edge, and the superposition is the vector electric field of the tetrahedron. Since the vector basis function used in this embodiment is a vector basis function, the divergence of the electric field is 0, and the volume charge density of the corresponding tetrahedron is 0, and since the vector basis function used in this embodiment is of 0th order accuracy, its double curl is 0, and the volume current density of the tetrahedron , surface charge , surface current density The calculation formulas are as follows: (4) (5) (6) (7) Among them, is the vacuum permittivity, and its numerical value is ; is the vacuum permeability, and its numerical value is ; is the relative permittivity of the material, such as the value in vacuum is 1; is the relative permeability of the material, such as the value in vacuum is 1; is the angular frequency, and its relationship with the frequency f is , in the example, the frequency is 10 GHz, and the calculated angular frequency is approximately ; , in the example, the magnitude is approximately 209.5845; j is the imaginary part symbol in complex numbers, is the unit normal vector of the outer normal of a certain triangular face in the tetrahedron.
[0040] For the calculation of the current density vector of the tetrahedron, only need to multiply the electric field vector corresponding to its centroid by the coefficient and its volume.
[0041] For the calculation of the surface charge density of a face in the tetrahedron, combine the adjacent tetrahedron numbers corresponding to this triangular face, subtract the product of the centroid electric field vector of this tetrahedron and the relative permittivity from the product of the centroid electric field vector of the adjacent tetrahedron and the relative permittivity, and then multiply the calculated vector by the unit normal vector of this face and then multiply by the triangular area.
[0042] For the calculation of the surface current density of a tetrahedron in the tetrahedron, subtract the product of the curl of the centroid electric field of this tetrahedron and the reciprocal of the relative permeability from the product of the curl of the centroid electric field of the adjacent tetrahedron and the reciprocal of the relative permeability, and then multiply the calculated vector by the unit normal vector of this face and then multiply by the triangular area and the coefficient in the formula.
[0043] Calculate the volume error of each tetrahedron according to the volume charge and volume current density, calculate the surface error of each face of each tetrahedron according to the surface charge and surface current density, and the calculation formula for the total error of each tetrahedron according to the volume error and surface error of each tetrahedron is: (8) (9) (10) The total error magnitude of the tetrahedron consists of the volume error inside the tetrahedron and the surface errors of its four faces. Its calculation formula is as shown in formula 10, the calculation formula for the volume error is as shown in formula 8, and the calculation formula for the surface error is as shown in formula 9. In the above formulas is the radius of the circumscribed sphere of the tetrahedron, is the radius of the circumscribed circle of the triangular face, is the volume error of the adjacent tetrahedron of a certain face of the tetrahedron, is the surface error of a certain face of the tetrahedron. After calculating the error of the tetrahedron according to the above formula, the total error magnitude of the tetrahedron and the tetrahedron number can be stored in the std::map in C++, in the form of std::map<double, int>, which is convenient for finding the corresponding tetrahedron mesh element according to the error magnitude later.
[0044] In one embodiment, calibrating the tetrahedrons to be encrypted according to the total error of each tetrahedron includes: storing the total error of each tetrahedron and sorting them in ascending order; screening out the tetrahedrons with larger total error in turn through a reverse iterator. When the total error of a tetrahedron is greater than a preset error value, mark the tetrahedron as a tetrahedron to be encrypted.
[0045] Preferably, the iteration is terminated when the number of tetrahedrons to be encrypted is greater than a preset percentage of the total number of tetrahedrons.
[0046] Since the total error of each tetrahedral mesh element calculated through the steps shown in the above embodiment is stored in the form of std::map<double, int>, the sorting characteristic of the map for errors from small to large is effectively utilized, and at the same time, the tetrahedron numbers corresponding to different errors are stored. Therefore, the tetrahedrons with larger errors can be screened out by using the reverse iterator of the map. When the total error of a certain tetrahedron is greater than the preset error value, the number of the tetrahedron is stored in std::vector, that is, mark the tetrahedron as a tetrahedron to be encrypted. In addition, in order to ensure the calculation speed, the number of tetrahedrons to be encrypted is set not to exceed a preset percentage (such as 30%) of the total number of tetrahedrons. If the number exceeds the constraint number, the iteration is terminated. Figure 6 Shows the tetrahedral mesh elements to be encrypted found in the first mesh encryption iteration in a specific implementation.
[0047] Input the mesh file to be encrypted and the container of the tetrahedron numbers to be encrypted into the mesh encryption solver, perform mesh encryption on the mesh file based on the constrained Delaunay algorithm, and output the mesh in the form of a VTK text file after encryption, which is convenient for subsequent mesh reading and finite element calculation. Figure 7 Shows the mesh distribution after encryption by combining the encrypted unit information found in the first mesh encryption iteration process with the mesh encryption algorithm in a specific implementation.
[0048] In the adaptive encryption loop, repeat the above steps and end the adaptive encryption when the convergence criterion is met. For example, in the 13th iteration, =0.0113, which meets the convergence criterion and ends the adaptive encryption. After final convergence, the number of tetrahedral meshes is 145082, and the corresponding finite element matrix dimension is (185714, 185714). Under the same number of iteration steps, the number of tetrahedral meshes after convergence of the commercial software is 172231, and the corresponding finite element matrix dimension is (215054, 215054). The mesh distribution after convergence in this example is as Figure 8 shown, and the mesh distribution after convergence of the commercial software is as Figure 9As shown, it can be found that the distribution of grid cells after convergence is basically the same, and the grid mainly has a higher distribution density near the metal lines, which conforms to physical laws.
[0049] At the same time, the S-parameter matrix is also close to that of the commercial software, as shown in the following table.
[0050] The convergence curve of the grid during the adaptive encryption process is as Figure 10 shown. The convergence trend is basically the same as that of the commercial software. Based on the converged grid, the S-parameters are discretely calculated at 5 GHz - 10 GHz, and the calculated S-parameters are compared with the S-parameters of the commercial software. It can be found that the converged grid obtained by the adaptive encryption method can calculate an S-parameter curve that is relatively consistent with that of the commercial software, as Figure 11 shown. At the same time, the number of grids and the finite element matrix are relatively reduced compared to the commercial grid, achieving a significant reduction in computational resource consumption while improving the calculation accuracy, and are applicable to the finite element electromagnetic simulation calculations of complex structures such as transmission lines, vias, and printed circuit boards.
[0051] In one embodiment, the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the steps of a grid encryption method in the foregoing embodiment.
[0052] In one embodiment, the present application provides a computer storage medium, on which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the steps of a grid encryption method in the foregoing embodiment are implemented.
[0053] In one embodiment, the present application provides a computer program product, including a computer program or instruction. When the computer program or instruction is executed by a processor, the steps of a grid encryption method in the foregoing embodiment are implemented.
[0054] A grid encryption method of the present application can be implemented by program codes executable by a computing device. Thus, they can be stored in a storage device for execution by the computing device, or they can be separately made into individual integrated circuit modules, or multiple modules or steps among them can be made into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.
[0055] It should be noted that the above embodiments can be freely combined as needed. The above are only the preferred embodiments of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A grid encryption method, characterized in that: Includes steps: Obtain the input initial grid, frequency, maximum number of iterations and preset S parameter change threshold; Reading the initial grid and identifying the grid boundary to obtain grid blocks with different material properties; Constructing a finite element matrix at a single frequency based on the grid blocks of different material properties; Solving the finite element matrix to obtain an S parameter matrix at a current iteration, and when the number of iterations is greater than 1, calculating a current S parameter change according to the S parameter matrix obtained at the current iteration and the S parameter matrix obtained at the previous iteration; When the current S parameter change is greater than the preset S parameter change threshold, constructing a mapping relationship between four faces of each tetrahedron of the initial mesh and adjacent tetrahedrons; Calculate the volume charge, volume current density, surface charge and surface current density of each tetrahedron according to the mapping relationship; Calculating the volume error of each tetrahedron according to the volume charge and the volume current density, calculating the surface error of each surface of each tetrahedron according to the surface charge and the surface current density, and calculating the total error of each tetrahedron according to the volume error and the surface error of each tetrahedron; Calibrate the tetrahedron that needs to be encrypted according to the total error of each tetrahedron; The tetrahedrons that need to be encrypted are encrypted and the initial mesh is updated to perform the next iteration.
2. A grid encryption method according to claim 1, characterized in that: The grid boundary identification includes: Based on the labels of different units in the initial grid, selecting grid blocks with different material properties; The mesh boundary of each piece of material is determined according to the overlapping properties of the triangular faces in the tetrahedrons of the mesh blocks.
3. A grid encryption method according to claim 1, characterized in that: The calculation of the volume charge, volume current density, surface charge and surface current density of each tetrahedron according to the mapping relationship includes: Calculate the jump amount of physical properties between common faces of each tetrahedron and adjacent tetrahedrons according to the mapping relationship; The volume charge, volume current density, surface charge and surface current density of each tetrahedron are calculated according to the physical property jump amount and the electric field vector of each tetrahedron.
4. A grid encryption method according to claim 1, characterized in that: The step of calibrating the tetrahedrons to be encrypted according to the total errors of the tetrahedrons includes: The total errors of the tetrahedrons are stored and sorted in order from small to large; The tetrahedrons with larger total errors are screened in sequence through a reverse iterator, and when the total error of a tetrahedron is greater than a preset error value, the tetrahedron is marked as the tetrahedron that needs to be encrypted.
5. A grid encryption method according to claim 4, characterized in that: Also includes: When the number of tetrahedrons to be encrypted is greater than a preset percentage of the total number of tetrahedrons, the iteration is exited.
6. A grid encryption method according to claim 1, characterized in that: Also includes: When the number of iterations is less than the maximum number of iterations and the current S parameter change is less than the preset S parameter change threshold, it is determined that the grid has reached a convergence state and grid encryption is terminated.
7. A grid encryption method according to claim 1, characterized in that: The maximum number of iterations is 50, and the preset S parameter change threshold is 0.
02.
8. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of a grid encryption method as described in any one of claims 1-7.
9. A computer storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of a grid encryption method described in any one of claims 1-7 are implemented.
10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of a grid encryption method described in any one of claims 1-7 are implemented.
Citation Information
Patent Citations
Electromagnetic radiation simulation analysis method based on local grid adaptive subdivision
CN115329628A
Multi-physical-target-oriented electromagnetic field grid adaptive regulation and control optimization method in electromagnetic system
CN116151077A
Cited By
Tetrahedral mesh encryption method based on spatial octree index and error feedback
CN120823341A