Grid quality optimization method, computer equipment, program product and storage medium
By optimizing the mesh quality through the hyperelastic model and variational vertex smoothing algorithm, the problems of insufficient mesh unit geometric quality and boundary fit in the existing technology are solved, and the simulation quality and efficiency of high-precision electromagnetic simulation are improved.
Patent Information
- Application Number
- CN202510905256.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-07-02
AI Technical Summary
In existing electromagnetic simulations, the quality of three-dimensional meshes cannot meet the requirements of high-precision simulation, resulting in low simulation accuracy, slow convergence and low computational efficiency. Existing methods make it difficult to simultaneously improve the geometric quality and boundary conformity of mesh units.
The hyperelastic model is used to construct the grid energy functional. The variational vertex smoothing algorithm and perturbation optimization path are used to expand the optimization path. Multiple constraints are introduced to optimize the grid node positions and screen out the optimal grid corresponding to the minimum energy value.
The overall quality of the mesh is significantly improved, the boundary preservation capability and the repair capability of degraded units are enhanced, the simulation accuracy and efficiency are improved, and the local optimal dilemma and boundary distortion are avoided.
Smart Images

Figure CN120409146B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electromagnetic simulation, and in particular to a grid quality optimization method, computer equipment, program product and storage medium. Background Art
[0002] In high-frequency electromagnetic simulations (such as those for integrated circuits, printed circuit boards, high-frequency antennas, filters, or high-speed interconnect structures), the quality of the three-dimensional mesh directly determines the accuracy, convergence speed, and computational efficiency of the simulation results. Electromagnetic simulations are often solved using the finite element method (FEM) or finite difference time-domain (FDTD) method. This requires three-dimensional discretization of the simulation domain, which divides the continuous structure into a number of finitely small elements (such as tetrahedrons and hexahedrons) to construct the simulation mesh. To achieve high-quality simulation results, an ideal mesh must meet the following requirements:
[0003] 1) Regular unit shape: the minimum dihedral angle is not less than a certain threshold (such as 10°), and the Jacobian determinant remains positive and far from zero;
[0004] 2) Size adaptation: The unit size should conform to the local electromagnetic wavelength variation to avoid being too dense or too sparse;
[0005] 3) No degenerate elements: Eliminate elements that are extremely small, severely distorted, or flipped to ensure that the condition number of the solution matrix is moderate;
[0006] 4) Accurate boundary fitting: The mesh nodes are strictly located on the geometric boundary surfaces or curves, keeping the model geometric features undistorted.
[0007] However, the mesh quality used in existing simulations does not meet the above requirements, which affects the quality of subsequent simulations. Therefore, there is an urgent need for a mesh quality optimization method that can improve the geometric quality of mesh cells and thus improve simulation quality. Summary of the Invention
[0008] The purpose of the present invention is to provide a mesh quality optimization method, computer equipment, program product and storage medium, which can effectively improve the overall quality of the mesh, enhance the boundary preservation ability and the ability to repair degraded elements, thereby improving the simulation quality.
[0009] The technical solutions provided by the present invention are as follows:
[0010] In a first aspect, the present application provides a method for optimizing mesh quality, comprising the steps of:
[0011] Obtaining an initial grid, and converting the initial grid into a built-in data structure to obtain a grid object, wherein the grid object includes a node set, a tetrahedron set, and topological adjacency information;
[0012] Traversing each grid node of the grid object and adding corresponding constraint conditions to each grid node;
[0013] The discretized three-dimensional grid is regarded as a hyperelastic body, and for each tetrahedral unit in the grid object, the energy of the current grid is calculated using a hyperelastic model;
[0014] Iteratively calculate the minimum energy value of the current grid according to the constraints, and apply random perturbations after every N iterations until a convergence threshold or a maximum number of iterations is reached;
[0015] The grid corresponding to the minimum output energy is taken as the optimal grid.
[0016] This solution regards the discretized three-dimensional grid as a hyperelastic body, constructs a hyperelastic model to calculate the grid energy, and adds corresponding constraints to each grid node of the grid object. Based on the hyperelastic model, a variational vertex smoothing algorithm is designed. By expanding the optimization path through perturbations, the grid corresponding to the minimum energy value is selected as the optimal grid for subsequent simulation calculations in multiple iterations. This can effectively improve the overall quality of the grid, enhance the boundary preservation ability and the ability to repair degraded units, thereby improving the simulation quality.
[0017] In some implementations, traversing each grid node of the grid object and adding corresponding constraints to each grid node includes:
[0018] Dividing the grid nodes into fixed nodes, constrained edge nodes, constrained surface nodes and free nodes;
[0019] Adding corresponding constraints to the fixed nodes to keep the fixed nodes stationary;
[0020] Add corresponding constraint conditions to the constraint edge node so that the constraint edge node can only move on the constraint edge;
[0021] Adding corresponding constraint conditions to the constraint surface node so that the constraint surface node can only move on the constraint surface;
[0022] Corresponding constraints are added to the free nodes, so that the free nodes can move freely in the constraint area.
[0023] In some embodiments, the calculation formula of the hyperelastic model is:
[0024] ,
[0025] in, represents the total energy, represents the weight of the volume deformation of the tetrahedral element, represents the deformation gradient of the unit, express The square of the Frobenius norm of the matrix,
[0026] ,
[0027] ,
[0028] in, is the mapping from Euler coordinates to Lagrange coordinates, 、 It is different from the tetrahedron 、 Two other points, yes 、 、 and 、 、 The dihedral angle formed by the planes in which they lie.
[0029] In some embodiments, iteratively calculating the minimum energy value of the current grid according to the constraint condition and applying random perturbation after every N iterations includes:
[0030] The variational vertex smoothing method is used to solve the minimum energy of the current grid. The solution formula is:
[0031] ,
[0032] in, represents the energy of the hyperelastic body, represents Euler coordinates, represents the Lagrangian coordinates, represents the region defined by the hyperelastic body;
[0033] Applying random perturbations can be expressed as:
[0034] ,
[0035] in, Indicates the The first iteration vertices, is the step length, is the disturbance amplitude, represents a random move that satisfies the constraints.
[0036] In some embodiments, further comprising:
[0037] Each time the energy minimum value is updated, the mesh vertex data is recorded or updated;
[0038] The grid corresponding to the minimum output energy value is taken as the optimal grid, including:
[0039] The optimal mesh is determined using the mesh vertex data that is recorded or updated last time.
[0040] In some embodiments, before iteratively calculating the minimum energy value of the current grid according to the constraint condition, the method further includes:
[0041] Initialize the node coordinates of the grid and preset the maximum number of iterations, convergence threshold, step size, and perturbation amplitude.
[0042] In some embodiments, after the grid corresponding to the minimum output energy value is selected as the optimal grid, the method further includes:
[0043] The first resonance frequency of the first resonance point is calculated by assembling the finite element discretization equation through the grid;
[0044] The first resonant frequency is compared with the resonant frequency of the first resonant point of the standard grid to determine the accuracy of the optimal grid.
[0045] In a second aspect, the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the grid quality optimization method described in the first aspect.
[0046] In a third aspect, the present application provides a computer storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implements the steps of the grid quality optimization method described in the first aspect.
[0047] In a fourth aspect, the present application provides a computer program product, comprising a computer program or instructions, which, when executed by a processor, implement the steps of the grid quality optimization method described in the first aspect.
[0048] According to a mesh quality optimization method, computer device, program product and storage medium provided by the present invention, a discretized three-dimensional mesh is regarded as a hyperelastic body, a hyperelastic model is constructed to calculate the energy functional of the mesh, and corresponding constraints are added to each mesh node of the mesh object. A variational vertex smoothing algorithm is designed based on the hyperelastic model. The optimization path is expanded through perturbations, and the perturbed mesh corresponding to the minimum value of the energy functional is screened out in multiple iterations as the optimal mesh for subsequent simulation calculations. This can effectively improve the overall quality of the mesh, enhance the boundary preservation capability and the ability to repair degraded units, thereby improving the simulation quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The preferred implementation scheme will be described below in a clear and understandable manner with reference to the accompanying drawings to further illustrate the above-mentioned characteristics, technical features, advantages and implementation methods of this solution.
[0050] Figure 1 This is a schematic diagram of the overall process of an embodiment of the present invention;
[0051] Figure 2 It is a flow chart of an embodiment of the present invention;
[0052] Figure 3 2. It is a schematic diagram comparing the first resonance point of a test grid, a smooth grid, and a standard grid according to an embodiment of the present invention;
[0053] Figure 4 3 is a schematic diagram comparing the errors of the resonant frequencies of a test grid, a smooth grid, and a standard grid according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific embodiments of the present invention will be described below with reference to the accompanying drawings. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings and other embodiments can be obtained based on these drawings without inventive work.
[0055] To simplify the drawings, only the parts relevant to the present invention are schematically shown in each figure. They do not represent the actual structure of the product. Furthermore, to simplify the drawings and facilitate understanding, in some figures, only one of the components with the same structure or function is schematically depicted or labeled. As used herein, "one" not only means "only one" but also "more than one."
[0056] In high-frequency electromagnetic simulations (such as those for integrated circuits, printed circuit boards, high-frequency antennas, filters, or high-speed interconnect structures), the quality of the three-dimensional mesh directly determines the accuracy, convergence speed, and computational efficiency of the simulation results. Electromagnetic simulations are often solved using the finite element method (FEM) or finite difference time-domain (FDTD) method. This requires three-dimensional discretization of the simulation domain, which divides the continuous structure into a number of finitely small elements (such as tetrahedrons and hexahedrons) to construct the simulation mesh. To achieve high-quality simulation results, an ideal mesh must meet the following requirements:
[0057] 1) Regular unit shape: the minimum dihedral angle is not less than a certain threshold (such as 10°), and the Jacobian determinant remains positive and far from zero;
[0058] 2) Size adaptation: The unit size should conform to the local electromagnetic wavelength variation to avoid being too dense or too sparse;
[0059] 3) No degenerate elements: Eliminate elements that are extremely small, severely distorted, or flipped to ensure that the condition number of the solution matrix is moderate;
[0060] 4) Accurate boundary fitting: The mesh nodes are strictly located on the geometric boundary surfaces or curves, keeping the model geometric features undistorted.
[0061] Existing methods for obtaining higher quality meshes are:
[0062] 1. Laplace smoothing algorithm
[0063] This method achieves geometric smoothness by updating the position of a node to a weighted average of the positions of its neighboring nodes, making the nodes more evenly distributed. However, this method does not consider specific cell quality metrics (such as volume, angle, and shape), which can lead to reduced cell quality, mesh distortion, or cell inversion, disrupting the mesh's topology. Furthermore, without specific constraints near boundaries, boundary nodes can easily shift, causing shape distortion and reducing simulation accuracy.
[0064] 2. Spring model method
[0065] This method abstracts mesh nodes into a system of point masses connected by springs. Nodes are connected by edges, simulating springs with elastic potential energy. By constructing a potential energy function and iteratively adjusting node positions using energy minimization, mesh smoothing is achieved. A drawback of this method is that its optimization objective is primarily to balance the distances between nodes, rather than directly improving the geometric quality of the elements (such as distortion and volume ratio). Therefore, this method is sensitive to distance variations and can, to a certain extent, prevent node clustering or overstretching. However, it still focuses on distance balance and does not directly optimize the mesh quality function, making it difficult to eliminate locally distorted elements. Consequently, it is difficult to effectively improve the shape quality of degenerate elements. This is particularly true in scenarios where high-precision electromagnetic simulations require high element quality. The lack of precise constraints on complex boundaries limits its applicability.
[0066] 3. Optimize driving method
[0067] This method sets a clear unit quality metric function (such as minimum volume, minimum internal angle, Jacobian determinant), establishes an optimization objective function, and uses an iterative optimization algorithm (Newton method, quasi-Newton method or gradient descent) to gradually update the node positions to improve the overall mesh quality. The disadvantages of this method are:
[0068] 1) High computational complexity: The Hessian matrix assembly and solution cost is high on large-scale 3D grids, resulting in slow optimization speed, especially on large-scale 3D grids.
[0069] 2) Local optimality dilemma: When the initial quality is poor, it is easy to fall into a local extreme value, and the optimization process is prone to fall into the local optimal solution and cannot further improve the quality;
[0070] 3) Risk of boundary distortion: Without strict projection or constraints, boundary nodes may drift during optimization, which may easily lead to boundary offset or geometric distortion.
[0071] In summary, although these existing methods have good performance in certain specific applications, they are difficult to meet the stringent mesh quality requirements of high-precision electromagnetic simulations. The main problems are as follows:
[0072] 1) Local optimality is difficult to break through
[0073] Many traditional smoothing methods rely solely on local gradients or geometric mean strategies, making it difficult to escape the extreme quality region determined by the current mesh topology. This results in degenerate elements (such as tetrahedrons with extremely small volumes and distorted shapes) reappearing during iterations and being difficult to completely eliminate.
[0074] 2) Insufficient boundary fit
[0075] Some methods do not introduce boundary constraint mechanisms during the smoothing process. Especially near complex boundaries, changes in node positions may cause the geometry to deviate from the original structure, thereby changing the intrinsic characteristics of the simulation model and affecting the simulation accuracy.
[0076] 3) Single optimization path
[0077] Most existing algorithms perform optimization along a deterministic descent path, lack a disturbance regulation mechanism, and fail to introduce local disturbances or jump strategies, resulting in optimization being limited by the initial grid distribution, especially in the multi-extreme function space, making it difficult to find the global optimum.
[0078] Therefore, there is an urgent need for a mesh quality optimization method that can improve the geometric quality of mesh units and thus improve the simulation quality. In order to overcome the shortcomings of traditional smoothing algorithms in the prior art, such as the tendency to fall into local optimality, poor boundary fit, and difficulty in completely repairing degenerate units, this solution proposes a variational vertex smoothing method based on a hyperelastic model. This method designs a variational vertex smoothing algorithm based on the hyperelastic model, introduces an energy functional, and expands the optimization path through perturbations, effectively improving the overall quality of the mesh, enhancing the boundary preservation capability, and the ability to repair degenerate units. The following will describe this solution in detail with reference to the accompanying drawings:
[0079] In one embodiment, the reference Figure 1 and attached Figure 2 , this application provides a grid quality optimization method, comprising the steps of:
[0080] S100: Obtain an initial grid, and convert the initial grid into a built-in data structure to obtain a grid object. The grid object includes a node set, a tetrahedron set, and topological adjacency information.
[0081] S200: traverse each grid node of the grid object and add corresponding constraint conditions to each grid node.
[0082] S300, treating the discretized three-dimensional grid as a hyperelastic body, and calculating the energy of the current grid for each tetrahedral unit in the grid object using a hyperelastic model;
[0083] S400, iteratively calculating the minimum energy value of the current grid according to the constraint conditions, and applying random perturbations after every N iterations until a convergence threshold or a maximum number of iterations is reached;
[0084] S500: Output the grid corresponding to the minimum energy value as the optimal grid.
[0085] This solution regards the discretized three-dimensional grid as a hyperelastic body, constructs a hyperelastic model to calculate the grid energy, and adds corresponding constraints to each grid node of the grid object. Based on the hyperelastic model, a variational vertex smoothing algorithm is designed. By expanding the optimization path through perturbations, the grid corresponding to the minimum energy value is selected as the optimal grid for subsequent simulation calculations in multiple iterations. This can effectively improve the overall quality of the grid, enhance the boundary preservation ability and the ability to repair degraded units, thereby improving the simulation quality.
[0086] Specifically, this solution first uses conventional methods to obtain the initial mesh for simulation, and then optimizes the initial mesh to obtain the optimal mesh. After obtaining the initial mesh, the initial mesh is converted into a built-in data structure to obtain a mesh object, which includes a node set , tetrahedron set and topological adjacency information.
[0087] In a specific implementation, each grid node of the grid object is traversed, and corresponding constraints are added to each grid node, including:
[0088] The mesh nodes are divided into fixed nodes, constrained edge nodes, constrained surface nodes and free nodes; corresponding constraints are added to fixed nodes to keep them stationary; corresponding constraints are added to constrained edge nodes to make them move only on the constrained edges; corresponding constraints are added to constrained surface nodes to make them move only on the constrained surfaces; corresponding constraints are added to free nodes to make them move freely in the constrained area.
[0089] Specifically, to strictly maintain the geometric and physical characteristics, this solution explicitly adds the following linear constraints in the mesh optimization:
[0090] a. Point constraint: The vertex cannot be moved and is a fixed feature point;
[0091] b. Edge constraint: vertices can only move along feature edges;
[0092] c. Face constraint: vertices can only move along the normal projection of the original surface to maintain fit;
[0093] d. Volume constraint: The vertex can only move within the polyhedron, ensuring that the vertex is always within the region.
[0094] Therefore, in order to prevent the violation of geometric boundaries, the present invention explicitly imposes the following constraints during the energy functional minimization process:
[0095] ,
[0096] in, represents the coordinates of the vertex, Indicates the constraints on the vertex, It represents the weight, satisfying the conditions: , In addition, for each unit Jacobian matrix, it is required that In order to meet the property of maintaining volume and prevent excessive shrinkage of unit volume. In actual engineering, geometric or physical constraints are often imposed on boundary nodes, feature points or feature lines, but traditional algorithms often ignore these constraints or use post-processing methods, and cannot take them into account during the optimization process, resulting in insufficient boundary fit and feature fidelity. The present invention explicitly introduces multiple constraints during the optimization process to ensure that boundary, feature and physical constraints are strictly met while maintaining a high-quality mesh, thereby improving the mesh quality and computational efficiency of complex geometric simulations.
[0097] In a specific implementation, in order to simulate the electromagnetic system, it is first necessary to construct a grid to discretize the specified area and then perform a numerical solution. The present invention regards the discretized three-dimensional grid as a hyperelastic body. Consider a tetrahedral unit in the grid. In order to describe the energy of the hyperelastic body, the present invention designs a total energy functional ,
[0098] The calculation formula of the hyperelastic model is:
[0099] ,
[0100] in, represents the total energy, represents the weight of the volume deformation of the tetrahedral element, represents the deformation gradient of the unit, express The square of the Frobenius norm of the matrix,
[0101] ,
[0102] ,
[0103] in, is the mapping from Euler coordinates to Lagrange coordinates, 、 It is different from the tetrahedron 、 Two other points, yes 、 、 and 、 、 Compared to the existing technology, the hyperelastic model constructed in this invention can well capture the deformation of the mesh because it takes into account the energy stored in volume and shape. This can be used to guide mesh optimization, thereby ensuring the stability and robustness of the simulation process.
[0104] In a specific implementation, the energy minimum of the current grid is iteratively calculated according to the constraints, and a random perturbation is applied after every N iterations, including:
[0105] After the hyperelastic model is established, the mapping from Euler coordinates to Lagrangian coordinates is expressed as , thus constructing a variational problem, and solving the minimum energy of the current grid by the variational vertex smoothing method. The solution formula is:
[0106] ,
[0107] in, represents the energy of the hyperelastic body, represents Euler coordinates, represents the Lagrangian coordinates, Represents the region defined by the hyperelastic body.
[0108] During the iteration process, the present invention performs the following operations on the vertex: Applying random perturbations can be expressed as:
[0109] ,
[0110] in, Indicates the The first iteration vertices, is the step length, is the disturbance amplitude, Represents random movements that satisfy the constraints, preventing the algorithm from falling into local minima and continuing to search for the global optimal solution. After perturbation, only candidate positions that reduce local energy are retained to ensure global convergence. For regions where node movement is constrained by the surrounding topology, the Jacobian or gradient direction calculations are inaccurate. The introduced perturbation mechanism can achieve a high-quality mesh while ensuring overall convergence, thereby improving the efficiency of electromagnetic simulations. The present invention uses an efficient iterative solver (such as LN-COBYLA or LD-LBFGS) to perform line search and Hessian approximation on each batch of updated candidates, iterating until the energy change falls below a threshold or the maximum number of iterations is reached.
[0111] In order to facilitate determination of the mesh corresponding to the minimum energy value, the mesh vertex data is recorded or updated each time the minimum energy value is updated.
[0112] Outputting a mesh corresponding to the minimum energy value as an optimal mesh includes: determining the optimal mesh using mesh vertex data recorded or updated last time.
[0113] Before iteratively calculating the minimum energy value of the current grid according to the constraint conditions, the method further includes: initializing the node coordinates of the grid, and presetting the maximum number of iterations, convergence threshold, step size and disturbance amplitude.
[0114] In order to determine the accuracy of the optimal grid obtained by this solution, in some embodiments, after outputting the grid corresponding to the minimum energy value as the optimal grid, the following steps are further included:
[0115] Finite element discretization equations assembled by mesh ,in is the stiffness matrix, For the mass matrix, calculate the minimum eigenvalue , and calculate the first resonant frequency of the first resonant point ;
[0116] The first resonant frequency is compared with the resonant frequency of the first resonant point of the standard grid to determine the accuracy of the optimal grid. Compared with the existing technology, the present invention ensures that the grid quality and geometric boundary conditions are simultaneously met during the grid optimization process, and exhibits better accuracy and numerical stability. Random perturbations prevent the grid from falling into local minima. This embodiment clarifies the static constraints and dynamic iteration mechanisms of each step, which not only improves the quality of design verification, but also helps shorten the development cycle and cost of electronic products.
[0117] Specifically, the grid quality optimization method provided by this solution has at least the following technical effects:
[0118] 1) Breaking through the local optimal dilemma:
[0119] On the basis of the conventional optimization path, by introducing a controlled perturbation mechanism, small random perturbations are introduced to the positions of the grid vertices, breaking the iterative process's dependence on the initial grid structure, enabling the algorithm to jump out of the current quality extreme area, avoiding falling into the local optimal dilemma common in traditional optimization methods, and thus continuously improving the grid quality.
[0120] 2) Taking into account both boundary conformation and mesh smoothness
[0121] During the perturbation generation and screening stages, normal projections, surface constraints, and linear geometric constraints are explicitly applied to ensure that boundary nodes always fit the original geometric contours. At the same time, mesh smoothing is applied to achieve quality improvement, taking into account both boundary fidelity and global smoothness.
[0122] 3) Prioritize repairing degraded units
[0123] By involving energy functionals, degenerate units such as distortion, elongation, and extremely small size are automatically identified, and perturbation and energy minimization operations are applied to these areas to effectively repair degenerate or poor-quality units, significantly improve local extreme structure, and enhance the overall robustness of the grid.
[0124] 4) The present invention constructs a hyperelastic model and explicitly adds linear constraints by introducing a variational vertex smoothing method driven by a perturbation mechanism, thereby effectively improving the overall quality of the mesh and the shape control capability of local extreme structure, directly improving the numerical accuracy and result stability in electromagnetic simulation, and avoiding local contamination of the solution field by inferior units; in multiple microstrip line, package and antenna models, the present invention can reduce the S parameter calculation error compared with traditional smoothing methods; improving simulation accuracy not only reduces error accumulation, but also effectively reduces repeated design modifications, sample trial and error and test iterations in the later stage, reduces product failure rate due to simulation errors, and reduces engineering rework costs; promotes the intelligent and automated upgrade of simulation core algorithms in high-end EDA tools; and helps to improve the high-precision simulation teaching and scientific research level of domestic engineering colleges and research institutions.
[0125] For example, taking the common resonant cavity model as an example, the experimental results of the iterative grid in the adaptive process are as follows: Figure 3 and Figure 4 shown. Figure 3 The following table shows the comparison of the first resonance points calculated for the test grid (Test), smooth grid (Smooth), and standard grid (std) at different iteration times (grid counts). When convergence is reached (grid count is 1200), the first resonance points calculated for these grids tend to be the same. It can be seen that the resonance point calculated for the smooth grid is larger than the resonance points calculated for the test grid and standard grid, and is closer to the final result, as shown in Table 1 below:
[0126]
[0127] Table 2 below shows a comparison of the quality of the standard mesh and smoothed mesh for Pass 1 and Pass 4 in Table 1. The aspect ratio represents the ratio of the outer diameter to the inner diameter, the diameter-to-edge ratio represents the ratio of the outer diameter to the minimum edge length, the volume-to-edge ratio represents the ratio of the volume to the cube of the root mean square of the edge length, and the total energy represents the sum of the energies of all tetrahedrons. As Table 2 shows, the mesh quality of the smoothed mesh is very similar to that of the standard mesh, demonstrating the superiority of the variational vertex smoothing algorithm.
[0128]
[0129] Figure 4 The figure shows the error of the resonant frequency calculated by the test mesh (Test), smooth mesh (Smooth) and standard mesh (std) compared with the resonant frequency converged by the standard mesh (12.4967Hz). Figure 4 It can be seen that the error of the resonant frequency calculated by the smooth grid is the smallest.
[0130] In summary, this invention, based on a hyperelastic model and introducing a perturbation mechanism for variational mesh smoothing, overcomes the technical bottlenecks of traditional smoothing algorithms in local optimization, boundary control, and degenerate element repair, significantly improving mesh quality and electromagnetic simulation accuracy. This method combines local quality improvement with global structural optimization capabilities, effectively improving the accuracy and stability of numerical solutions while maintaining geometric conformity. Its modular design facilitates integration into existing EDA simulation platforms, demonstrating excellent engineering adaptability, economic value, and potential for social promotion in practical applications.
[0131] In one embodiment, based on the aforementioned embodiment, the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the mesh quality optimization method of the aforementioned embodiment.
[0132] In one embodiment, based on the aforementioned embodiment, the present application provides a computer storage medium having a computer program or instructions stored thereon, which implements the steps of the mesh quality optimization method of the aforementioned embodiment when the computer program or instructions are executed by a processor.
[0133] In one embodiment, based on the aforementioned embodiment, the present application provides a computer program product, including a computer program or instructions, which implements the steps of the mesh quality optimization method of the aforementioned embodiment when the computer program or instructions are executed by a processor.
[0134] The mesh quality optimization method of the present application can be implemented using program code executable by a computing device. Thus, the program code can be stored in a storage device and executed by the computing device, or implemented as separate integrated circuit modules, or multiple modules or steps can be implemented as a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
[0135] It should be noted that the above embodiments can be freely combined as needed. The above description is only a preferred embodiment of the present invention. It should be pointed out that those skilled in the art can make several improvements and modifications without departing from the principles of the present invention, and such improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for optimizing mesh quality, characterized in that: Including steps: Obtaining an initial grid, and converting the initial grid into a built-in data structure to obtain a grid object, wherein the grid object includes a node set, a tetrahedron set, and topological adjacency information; Traversing each grid node of the grid object and adding corresponding constraint conditions to each grid node; The discretized three-dimensional grid is regarded as a hyperelastic body, and for each tetrahedral unit in the grid object, the energy of the current grid is calculated using a hyperelastic model; Iteratively calculate the energy minimum of the current grid according to the constraints, and apply random perturbations after every N iterations until a convergence threshold or a maximum number of iterations is reached; The grid corresponding to the minimum output energy is taken as the optimal grid; The calculation formula of the hyperelastic model is: , in, represents the total energy, represents the weight of the volume deformation of the tetrahedral element, represents the deformation gradient of the unit, express The square of the Frobenius norm of the matrix, , , in, 、 Represents the numbers of any two vertices of a tetrahedral unit; is the mapping from Euler coordinates to Lagrange coordinates, , Represents vertices , Mapping from Eulerian coordinates to Lagrangian coordinates; Indicates the Lagrangian coordinates of the tetrahedron element The weight of the tetrahedron edge formed by two vertices; 、 It is different from the tetrahedron 、 Two other points, yes 、 、 and 、 、 The dihedral angle formed by the planes in which they lie.
2. The grid quality optimization method according to claim 1, characterized in that: The traversing of each grid node of the grid object and adding corresponding constraints to each grid node includes: Dividing the grid nodes into fixed nodes, constrained edge nodes, constrained surface nodes and free nodes; Adding corresponding constraints to the fixed nodes to keep the fixed nodes stationary; Add corresponding constraint conditions to the constraint edge node so that the constraint edge node can only move on the constraint edge; Adding corresponding constraint conditions to the constraint surface node so that the constraint surface node can only move on the constraint surface; Corresponding constraints are added to the free nodes, so that the free nodes can move freely in the constraint area.
3. The grid quality optimization method according to claim 2, characterized in that: The iterative calculation of the energy minimum of the current grid according to the constraint conditions and applying random perturbations after every N iterations includes: The variational vertex smoothing method is used to solve the minimum energy of the current grid. The solution formula is: , in, represents the energy of the hyperelastic body, represents Euler coordinates, represents the Lagrangian coordinates, represents the region defined by the hyperelastic body; Applying random perturbations can be expressed as: , in, Indicates the The first iteration vertices, is the step length, is the disturbance amplitude, represents a random move that satisfies the constraints.
4. The grid quality optimization method according to claim 3, characterized in that: Also includes: Each time the energy minimum value is updated, the mesh vertex data is recorded or updated; The grid corresponding to the minimum output energy value is taken as the optimal grid, including: The optimal mesh is determined using the mesh vertex data that is recorded or updated last time.
5. The grid quality optimization method according to claim 3, characterized in that: Before iteratively calculating the minimum energy value of the current grid according to the constraint conditions, the method further includes: Initialize the node coordinates of the grid and preset the maximum number of iterations, convergence threshold, step size, and perturbation amplitude.
6. The grid quality optimization method according to claim 1, characterized in that: After the grid corresponding to the minimum output energy value is taken as the optimal grid, the method further includes: The first resonance frequency of the first resonance point is calculated by assembling the finite element discretization equation through the grid; The first resonant frequency is compared with the resonant frequency of the first resonant point of the standard grid to determine the accuracy of the optimal grid.
7. 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 the mesh quality optimization method according to any one of claims 1 to 6.
8. 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 the grid quality optimization method according to any one of claims 1 to 6 are implemented.
9. 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 the grid quality optimization method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
A topological mesh generation method and electronic device based on boundary constraints
CN109408870A
Grid optimization method with penalty term constraint
CN116484656A