Grid quality optimization method, computer equipment, program product and storage medium
The grid quality is optimized through the superelastic model and the variational vertex smoothing algorithm, and the problem of insufficient grid quality in electromagnetic simulation is solved, and high-precision and efficient simulation results are achieved.
Patent Information
- Application Number
- CN202510905256.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-02
AI Technical Summary
In existing electromagnetic simulations, it is difficult for mesh quality to meet high precision, rapid convergence and boundary fit at the same time, resulting in insufficient accuracy and efficiency of simulation results.
The grid energy functional is constructed using a hyperelastic model, and the optimization path is expanded through the variational vertex smoothing algorithm and perturbation, and constraints are introduced to optimize the grid quality, especially to repair the degraded units.
Significantly improve the overall quality of the grid, enhance boundary maintenance capabilities and degraded unit repair capabilities, improve simulation accuracy and efficiency, reduce simulation errors, and reduce project rework costs.
Smart Images

Figure CN120409146A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electromagnetic simulation, and particularly to a method for optimizing grid quality, a computer device, a program product, and a storage medium. Background Art
[0002] In high-frequency electromagnetic simulation (such as integrated circuits, printed circuit boards, high-frequency antennas, filters, or high-speed interconnect structures, etc.), the quality of three-dimensional grids directly determines the accuracy, convergence speed, and computational efficiency of simulation results. In electromagnetic simulation, the finite element method (FEM) or the finite-difference time-domain method (FDTD) is often used for solving, and the premise is to discretize the simulation region in three dimensions, that is, to divide the continuous structure into several finite small units (such as tetrahedrons, hexahedrons, etc.) to construct a simulation grid. In order to obtain high-quality simulation results, the ideal grid needs to meet the following requirements: 1) The unit shape is regular: the minimum dihedral angle is not less than a certain threshold (such as 10°), and the Jacobian determinant remains positive and far from zero; 2) The size is adapted: the unit size conforms to the local electromagnetic wavelength change to avoid being too dense or too sparse; 3) There are no degenerate units: eliminate units with extremely small volume, severe distortion, or flipping to ensure that the condition number of the solution matrix is moderate; 4) The boundary is precisely fitted: the grid nodes are strictly located on the geometric boundary surface or curve to keep the geometric features of the model undistorted.
[0003] However, the grid quality adopted in existing simulations fails to meet the above requirements, resulting in an impact on the subsequent simulation quality. Therefore, there is an urgent need for a grid quality optimization method that can improve the geometric quality of grid cells and thus improve the simulation quality. Summary of the Invention
[0004] The purpose of the present invention is to provide a method for optimizing grid quality, a computer device, a program product, and a storage medium, which can effectively improve the overall quality of the grid, enhance the boundary retention ability and the ability to repair degenerate units, thereby improving the simulation quality.
[0005] The technical solution provided by the present invention is as follows: In a first aspect, the present application provides a method for optimizing grid quality, including the steps of: Obtaining an initial grid and converting the initial grid into a built-in data structure to obtain a grid object, where 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; Regarding the discretized three-dimensional grid as a hyperelastic body, for each tetrahedron unit in the grid object, calculating the energy of the current grid through a hyperelastic model; Iteratively calculate the minimum energy of the current grid according to the described constraints, and apply random perturbations after every N iterations until the convergence threshold is reached or the maximum number of iterations is reached; Output the grid corresponding to the minimum energy as the optimal grid.
[0006] In this solution, by treating the discretized three-dimensional grid as a hyperelastic body, a hyperelastic model is constructed to calculate the grid energy. At the same time, corresponding constraint conditions are added to each grid node of the grid object. Based on the hyperelastic model, a variational vertex smoothing algorithm is designed. By perturbing and expanding the optimization path, the grid corresponding to the minimum energy is selected as the optimal grid through multiple iterations for subsequent simulation calculations, which can effectively improve the overall quality of the grid, enhance the boundary retention ability and the repair ability for degenerate elements, thereby improving the simulation quality.
[0007] In some embodiments, traversing each grid node of the grid object and adding corresponding constraint conditions to each grid node includes: Dividing the grid nodes into fixed nodes, constrained edge nodes, constrained surface nodes, and free nodes; Adding corresponding constraint conditions to the fixed nodes to keep the fixed nodes immobile; Adding corresponding constraint conditions to the constrained edge nodes to make the constrained edge nodes move only on the constrained edges; Adding corresponding constraint conditions to the constrained surface nodes to make the constrained surface nodes move only on the constrained surfaces; Adding corresponding constraint conditions to the free nodes to make the free nodes move freely in the constrained region.
[0008] In some embodiments, the calculation formula of the hyperelastic model is: , where, represents the total energy, represents the weight occupied by the volume deformation of the tetrahedral element, represents the deformation gradient of the element, represents the square of the Frobenius norm of the matrix, , , where, is the mapping from the Euler coordinates to the Lagrangian coordinates, , are the other two points on the tetrahedron different from , , Yes , , and , , form a dihedral angle with the plane where they are located.
[0009] In some embodiments, the iterative calculation of the minimum energy of the current mesh according to the constraint conditions, and applying a random perturbation after every N iterations, includes: Solving the minimum energy of the current mesh by the variational vertex smoothing method, and the solution formula is: , where represents the energy of the hyperelastic body, represents the Euler coordinates, represents the Lagrangian coordinates, represents the region defined by the hyperelastic body; Applying a random perturbation can be expressed as: , where represents the th vertex of the th iteration, is the step size, is the perturbation amplitude, represents a random movement that satisfies the constraint conditions.
[0010] In some embodiments, it further includes: Every time the minimum energy is updated, record or update the mesh vertex data once; The output of the mesh corresponding to the minimum energy as the optimal mesh includes: Determine the optimal mesh with the mesh vertex data recorded or updated last time.
[0011] Before the iterative calculation of the minimum energy of the current mesh according to the constraint conditions in some embodiments, it further includes: Initialize the node coordinates of the mesh, and preset the maximum number of iterations, convergence threshold, step size, and perturbation amplitude.
[0012] In some embodiments, after the output of the mesh corresponding to the minimum energy as the optimal mesh, it further includes: Assemble the finite element discrete equation through the mesh and calculate the first resonance frequency of the first resonance point; Compare the first resonance frequency with the resonance frequency of the first resonance point of the standard mesh to judge the accuracy of the optimal mesh.
[0013] In a second aspect, the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory, where the processor executes the computer program to implement the steps of the mesh quality optimization method described in the first aspect.
[0014] In a third aspect, the present application provides a computer storage medium, on which a computer program or instruction is stored, and when the computer program or instruction is executed by a processor, the steps of the mesh quality optimization method described in the first aspect are implemented.
[0015] In a fourth aspect, the present application provides a computer program product, including a computer program or instruction, and when the computer program or instruction is executed by a processor, the steps of the mesh quality optimization method described in the first aspect are implemented.
[0016] According to a mesh quality optimization method, a computer device, a program product, and a storage medium provided by the present invention, by regarding the discretized three-dimensional mesh as a hyperelastic body, constructing a hyperelastic model to calculate the energy functional of the mesh, and adding corresponding constraint conditions to each mesh node of the mesh object at the same time, designing a variational vertex smoothing algorithm based on the hyperelastic model, expanding the optimization path through perturbation, and screening out the perturbed mesh corresponding to the minimum value of the energy functional in multiple iterations as the optimal mesh for subsequent simulation calculations, it can effectively improve the overall quality of the mesh, enhance the boundary retention ability and the repair ability for degenerate elements, thereby improving the simulation quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The following will further illustrate the above characteristics, technical features, advantages and their implementation manners of the solution in a clear and understandable manner in combination with the drawings of the preferred embodiments.
[0018] 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 comparison of the first resonance points of the test mesh, the smoothed mesh, and the standard mesh in an embodiment of the present invention; Figure 4 is a schematic diagram of the error comparison of the resonance frequencies of the test mesh, the smoothed mesh, and the standard mesh in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the specific embodiments 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 embodiments can also be obtained.
[0020] To simplify the drawings, only the parts related to the present invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, to simplify the drawings for easy understanding, in some figures, for components with the same structure or function, only one of them is schematically shown, or only one of them is labeled. In this article, "one" not only means "only this one", but also means "more than one" situation.
[0021] In high-frequency electromagnetic simulation (such as integrated circuits, printed circuit boards, high-frequency antennas, filters, or high-speed interconnect structures, etc.), the quality of the three-dimensional mesh directly determines the accuracy, convergence speed, and computational efficiency of the simulation results. In electromagnetic simulation, the finite element method (FEM) or the finite-difference time-domain method (FDTD) is often used for solving, and the premise is to discretize the simulation region in three dimensions, that is, to divide the continuous structure into several finite small units (such as tetrahedrons, hexahedrons, etc.) to construct the simulation mesh. To obtain high-quality simulation results, the ideal mesh needs to meet the following requirements: 1) The unit shape is regular: the minimum dihedral angle is not less than a certain threshold (such as 10°), and the Jacobian determinant remains positive and far from zero; 2) The size is adaptable: the unit size conforms to the local electromagnetic wavelength change to avoid being too dense or too sparse; 3) There are no degenerate units: eliminate units with extremely small volume, serious distortion, or flipping to ensure that the condition number of the solution matrix is moderate; 4) The boundary fits precisely: the mesh nodes are strictly located on the geometric boundary surface or curve to keep the geometric features of the model undistorted.
[0022] Existing methods for obtaining higher-quality meshes are as follows: 1. Laplace smoothing algorithm This method updates the position of a certain node to the weighted average of the positions of its adjacent nodes, making the nodes tend to be evenly distributed geometrically, thereby realizing the geometric smoothing of the mesh. The disadvantages of this method are: it does not consider the specific quality indicators of the units (such as volume, angle, shape, etc.), which may lead to a decrease in the quality of the mesh units, easily cause mesh distortion or unit inversion, and break the topological structure of the mesh; at the same time, without a special constraint mechanism near the boundary, it is easy to cause the movement of the boundary nodes, thereby causing the boundary shape to be distorted and reducing the simulation accuracy.
[0023] 2. Spring model method This method abstracts grid nodes into a particle system connected by springs. The nodes are connected by edges and simulated as springs with elastic potential energy. By constructing a potential energy function and using energy minimization to iteratively adjust the node positions, grid smoothing is achieved. The drawback of this method is that its optimization goal mainly focuses on the distance balance between nodes, rather than directly improving the geometric quality of elements (such as distortion degree, volume ratio, etc.). Therefore, this method is sensitive to distance changes and can avoid node aggregation or excessive stretching to a certain extent, but still emphasizes distance balance and does not directly optimize the grid quality function. It is difficult to eradicate locally distorted elements, so it is difficult to effectively improve the shape quality of degenerate elements. Especially in scenarios with high requirements for element quality in high-precision electromagnetic simulations, there are few fine constraints on complex boundaries, and the applicability is limited.
[0024] 3. Optimization-driven method This method sets a clear element quality metric function (such as minimum volume, minimum interior angle, Jacobian determinant), establishes an optimization objective function, and uses an iterative optimization algorithm (Newton's method, quasi-Newton method or gradient descent) to gradually update the node positions, thereby improving the overall grid quality. The drawbacks of this method are as follows: 1) High computational cost: The assembly and solution of the Hessian matrix on large-scale three-dimensional grids have high overhead, especially the optimization speed is slow in large-scale three-dimensional grids; 2) Local optimum dilemma: It is easy to fall into local extrema when the initial quality is poor, and the optimization process is prone to fall into local optimal solutions and unable to further improve the quality; 3) Risk of boundary distortion: Without strict projection or constraints, boundary nodes drift during optimization, and boundary deviation or geometric distortion is likely to occur.
[0025] In summary, although these existing methods have good performance in some specific applications, they are difficult to simultaneously meet the strict requirements of high-precision electromagnetic simulations for grid quality. The main problems are as follows: 1) Difficulty in breaking through local optima Many traditional smoothing methods only rely on local gradients or geometric averaging strategies, and it is difficult to jump out of the quality extreme region determined by the current grid topology, resulting in the repeated appearance of degenerate elements (such as tetrahedrons with extremely small volume and distorted shapes) in iterations and being difficult to completely eliminate.
[0026] 2) Insufficient boundary conformity Some methods do not introduce a boundary constraint mechanism during the smoothing process. Especially near complex boundaries, the change of node positions may cause the geometry to deviate from the original structure, thereby changing the eigen characteristics of the simulation model and affecting the simulation accuracy.
[0027] 3) Single optimization path Most existing algorithms perform optimization along a deterministic descent path, lacking a perturbation adjustment mechanism and failing to introduce local perturbation or jump strategies. As a result, the optimization is restricted by the initial grid distribution, especially in a multi-extremum function space where it is difficult to globally optimize.
[0028] Therefore, there is an urgent need for a mesh quality optimization method that can improve the geometric quality of mesh elements and thus enhance the simulation quality. To overcome the deficiencies of traditional smoothing algorithms in the prior art, such as being prone to falling into local optima, having poor boundary conformity, and being difficult to thoroughly repair degenerate elements, 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 perturbation, effectively improving the overall quality of the mesh, enhancing the boundary retention ability, and the ability to repair degenerate elements. The following will describe this solution in detail with reference to the accompanying drawings: In one embodiment, referring to the attached Figure 1 and Figure 2 , this application provides a mesh quality optimization method, including the steps of: S100. Obtain an initial mesh and convert the initial mesh into a built-in data structure to obtain a mesh object, where the mesh object includes a node set, a tetrahedron set, and topological adjacency information.
[0029] S200. Traverse each mesh node of the mesh object and add corresponding constraint conditions to each mesh node.
[0030] S300. Regard the discretized three-dimensional mesh as a hyperelastic body, and for each tetrahedron element in the mesh object, calculate the energy of the current mesh through the hyperelastic model; S400. Iteratively calculate the minimum value of the energy of the current mesh according to the constraint conditions, and apply random perturbations after every N iterations until the convergence threshold or the maximum number of iterations is reached; S500. Output the mesh corresponding to the minimum energy value as the optimal mesh.
[0031] This solution regards the discretized three-dimensional mesh as a hyperelastic body, constructs a hyperelastic model to calculate the mesh energy, and at the same time adds corresponding constraint conditions to each mesh node of the mesh object. Based on the hyperelastic model, a variational vertex smoothing algorithm is designed, and the optimization path is expanded through perturbation. The mesh corresponding to the minimum energy value is selected as the optimal mesh after multiple iterations for subsequent simulation calculations, which can effectively improve the overall quality of the mesh, enhance the boundary retention ability, and the ability to repair degenerate elements, thereby improving the simulation quality.
[0032] Specifically, this solution first uses a conventional method to obtain an initial mesh for simulation, and then optimizes the initial mesh to obtain an optimal mesh. After obtaining the initial mesh, the initial mesh is converted into a built-in data structure to obtain a mesh object, and the mesh object includes a node set , tetrahedron set and topological adjacency information.
[0033] In a specific implementation, traverse each mesh node of the mesh object and add corresponding constraint conditions for each mesh node, including: Divide the mesh nodes into fixed nodes, constrained edge nodes, constrained surface nodes, and free nodes; add corresponding constraint conditions for the fixed nodes to keep the fixed nodes immobile; add corresponding constraint conditions for the constrained edge nodes to make the constrained edge nodes move only on the constrained edges; add corresponding constraint conditions for the constrained surface nodes to make the constrained surface nodes move only on the constrained surfaces; add corresponding constraint conditions for the free nodes to make the free nodes move freely within the constrained area.
[0034] Specifically, to strictly maintain geometric and physical characteristics, this solution explicitly adds the following linear constraints in mesh optimization: a. Point constraint: The vertex cannot move and is a fixed feature point; b. Edge constraint: The vertex can only move along the feature edge; c. Surface constraint: The vertex can only move along the normal projection of the original surface to keep it fitting; d. Volume constraint: The vertex can only move within the polyhedron to ensure that the vertex is always within the region.
[0035] Therefore, in order to prevent breaking through the geometric boundary, in the process of minimizing the energy functional, the present invention explicitly imposes the following constraints: , where, represents the coordinates of the vertex, represents the constraint received by the vertex, then represents the weight, satisfying the condition: , . In addition, for the Jacobian matrix of each element, it is required that to satisfy the volume-preserving property and prevent the element volume from shrinking excessively. In actual engineering, geometric or physical constraints are often imposed on boundary nodes, feature points, or feature lines, etc., but traditional algorithms mostly ignore these constraints or use post-processing methods and cannot consider them together during the optimization process, resulting in insufficient boundary fitting and feature fidelity. The present invention ensures strict satisfaction of boundary, feature, and physical constraints while maintaining a high-quality mesh by explicitly introducing various constraint conditions during the optimization process, thereby improving the mesh quality and computational efficiency of complex geometry simulation.
[0036] In a specific implementation, in order to simulate an electromagnetic system, it is first necessary to construct a mesh to discretize a specified area, and then perform numerical solution. The present invention regards the discretized three-dimensional mesh as a hyperelastic body. Consider a tetrahedral element in the mesh . In order to describe the energy of the hyperelastic body, the present invention designs a total energy functional , The calculation formula of the hyperelastic model is: , wherein, represents the total energy, represents the weight occupied by the volume deformation of the tetrahedral element, represents the deformation gradient of the element, represents the square of the Frobenius norm of the matrix, , , wherein, is the mapping from the Euler coordinates to the Lagrangian coordinates, , are two other points on the tetrahedron different from , , is , , and , , the dihedral angle formed by the plane where they are located. Compared with the prior art, the hyperelastic model constructed by the present invention can well capture the deformation of the mesh by considering the energy stored in the volume and shape, so as to guide the optimization of the mesh, thereby ensuring the stability and robustness of the simulation process.
[0037] In a specific implementation, the minimum value of the energy of the current mesh is iteratively calculated according to the constraint conditions, and a random perturbation is applied after every N iterations, including: After establishing the hyperelastic model, the mapping from the Euler coordinates to the Lagrangian coordinates is denoted as , and thus a variational problem is constructed, and the minimum value of the energy of the current mesh is solved by the variational vertex smoothing method. The solution formula is: , wherein, represents the energy of the hyperelastic body, represents the Euler coordinates, represents the Lagrangian coordinates, represents the region defined by the hyperelastic body.
[0038] During the iteration process, the present invention applies random perturbations to the vertices The application of random perturbations can be expressed as: , where represents the -th vertex in the -th iteration, is the step size, is the perturbation amplitude, represents a random movement that satisfies the constraint conditions to prevent the algorithm from falling into a local minimum point, thereby continuing to search for the global optimal solution. Only the candidate positions that reduce the local energy are retained after perturbation to ensure global convergence. For regions where the node movement is restricted by the surrounding topology, the calculation of the Jacobian or gradient direction is inaccurate. The introduced perturbation mechanism can achieve a high-quality grid state while ensuring the overall convergence, thereby improving the electromagnetic simulation efficiency. 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, and iterates until the energy change is lower than the threshold or the maximum number of iterations is reached.
[0039] To facilitate the determination of the grid corresponding to the minimum energy, each time the minimum energy is updated, the grid vertex data is recorded or updated once.
[0040] The grid corresponding to the minimum energy is output as the optimal grid, including: determining the optimal grid based on the grid vertex data recorded or updated last.
[0041] Before performing iterative calculations on the minimum energy of the current grid according to the said constraint conditions, it further includes: initializing the node coordinates of the grid, and presetting the maximum number of iterations, convergence threshold, step size, and perturbation amplitude.
[0042] To identify the accuracy of the optimal grid obtained by this solution, in some embodiments, after outputting the grid corresponding to the minimum energy as the optimal grid, it further includes: assembling the finite element discrete equation through the grid , where is the stiffness matrix, is the mass matrix, calculating the minimum eigenvalue , and calculating the first resonance frequency of the first resonance point; Compare the first resonance frequency with the resonance frequency of the first resonance point of the standard grid to determine the accuracy of the optimal grid. Compared with the prior art, in the process of optimizing the grid, the present invention ensures that the grid quality and geometric boundary conditions are synchronously satisfied, and exhibits better accuracy and numerical stability. Random perturbation prevents getting stuck in 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 to shorten the development cycle and cost of electronic products.
[0043] Specifically, the grid quality optimization method provided by this solution at least has the following technical effects: 1) Break through the local optimal dilemma: Based on the conventional optimization path, by introducing a controlled perturbation mechanism, a small random perturbation is introduced to the positions of the grid vertices, breaking the dependence of the iterative process on the initial grid structure, enabling the algorithm to have the ability to jump out of the current quality extreme value region, avoiding getting stuck in the local optimal dilemma common in traditional optimization methods, and thus continuously improving the grid quality.
[0044] 2) Balance boundary conformality and grid smoothing In the perturbation generation and screening stage, explicit normal projection, surface constraints, linear geometric constraints, etc. are applied to ensure that the boundary nodes always fit the original geometric contour. At the same time, grid smoothing is applied to achieve quality improvement, balancing boundary fidelity and global smoothness.
[0045] 3) Prioritize the repair of degenerate elements By involving energy functionals, distorted, slender, extremely small-volume and other degenerate elements are automatically identified, and perturbation and energy minimization operations are applied in these regions to effectively repair degenerate or inferior elements, significantly improve the local extremely poor structure, and enhance the overall robustness of the grid.
[0046] 4) The present invention constructs a hyperelastic model. By introducing a perturbation mechanism to drive the variational vertex smoothing method for optimization, linear constraints are explicitly added, thus effectively improving the overall grid quality and the shape control ability of the local extremely poor structure, directly enhancing the numerical accuracy and result stability in electromagnetic simulation, and avoiding local contamination of the solution field by inferior elements; in multiple microstrip line, packaging and antenna models, the present invention can reduce the S-parameter calculation error compared with traditional smoothing methods; improving the simulation accuracy not only reduces error accumulation, but also effectively reduces the need for repeated post-design modifications, sample trial and error, and test iteration, reduces the product failure rate caused by simulation errors, and reduces the engineering rework cost; promotes the intelligent and automated upgrade of the simulation core algorithm in high-end EDA tools; helps to improve the high-precision simulation teaching and research level of domestic engineering colleges and research institutions.
[0047] For example, taking the common resonant cavity model as an example, the experimental results of the iterative grid in the adaptive process are as Figure 3 andFigure 4 as shown Figure 3 The test grid (Test), smooth grid (Smooth), and standard grid (std) at different iteration times (number of grids) are shown. The comparison of the first resonant points calculated shows that when convergence is reached (grid quantity is 1200), the first resonant points calculated by these grids tend to be the same. It can be seen that the resonant points calculated by the smooth grid are larger than those calculated by the test grid and the standard grid, and are closer to the final result, as shown in Table 1 below:
[0048] Among them, the quality comparison of the standard grid and the smooth grid for Pass1 and Pass4 in Table 1 is shown in Table 2 below. Among them, the aspect ratio represents the ratio of the outer diameter to the inner diameter, the edge ratio represents the ratio of the outer diameter to the minimum side length, the volume - side ratio represents the ratio of the volume to the cube of the root mean square of the side length, and the total energy represents the sum of the energies of all tetrahedrons. It can be seen from Table 2 that the grid quality of the smooth grid and the standard grid is very close, which proves the superiority of the variational vertex smoothing algorithm.
[0049]
[0050] Figure 4 Shown is the error graph of the resonant frequencies calculated by the test grid (Test), smooth grid (Smooth), and standard grid (std) compared with the resonant frequency converged by the standard grid (12.4967Hz). According to Figure 4 it can be seen that the error of the resonant frequency calculated by the smooth grid is the smallest.
[0051] In summary, the present invention is based on a hyperelastic model and introduces a variational grid smoothing method with a perturbation mechanism, breaking through the technical bottlenecks of traditional smoothing algorithms in local optimality, boundary control, and degenerate element repair, significantly improving the grid quality and electromagnetic simulation accuracy. This method has both the ability to improve local quality and global structure optimization, effectively improving the accuracy and stability of numerical solutions while maintaining geometric conformity. Its modular design is convenient for integration into existing EDA simulation platforms, showing excellent engineering adaptability, economic value, and social promotion potential in practical applications.
[0052] In one embodiment, based on the foregoing embodiment, the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program to implement the steps of the grid quality optimization method of the foregoing embodiment.
[0053] In one embodiment, based on the foregoing embodiment, the present application provides a computer storage medium, on which a computer program or instruction is stored, and when the computer program or instruction is executed by a processor, the steps of the grid quality optimization method in the foregoing embodiment are implemented.
[0054] In one embodiment, based on the foregoing embodiment, the present application provides a computer program product, including a computer program or instruction, and when the computer program or instruction is executed by a processor, the steps of the grid quality optimization method in the foregoing embodiment are implemented.
[0055] A grid quality optimization 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 fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated 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.
[0056] 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 still be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A mesh quality optimization method, characterized in that, Including the steps: Obtain an initial mesh, convert the initial mesh into a built-in data structure to obtain a mesh object, where the mesh object includes a node set, a tetrahedron set, and topological adjacency information; Traverse each mesh node of the mesh object and add corresponding constraint conditions to each mesh node; Regard the discretized three-dimensional mesh as a hyperelastic body, and for each tetrahedron element in the mesh object, calculate the energy of the current mesh through a hyperelastic model; Iteratively calculate the minimum energy of the current mesh according to the constraint conditions, and apply a random perturbation after every N iterations until the convergence threshold or the maximum number of iterations is reached; Output the mesh corresponding to the minimum energy as the optimal mesh.
2. The grid quality optimization method according to claim 1, wherein The step of traversing each mesh node of the mesh object and adding corresponding constraint conditions to each mesh node includes: Divide the mesh nodes into fixed nodes, constrained edge nodes, constrained surface nodes, and free nodes; Add corresponding constraint conditions to the fixed nodes to keep the fixed nodes immobile; Add corresponding constraint conditions to the constrained edge nodes to make the constrained edge nodes move only on the constrained edges; Add corresponding constraint conditions to the constrained surface nodes to make the constrained surface nodes move only on the constrained surfaces; Add corresponding constraint conditions to the free nodes to make the free nodes move freely within the constrained region.
3. The mesh quality optimization method according to claim 1, characterized in that, The calculation formula of the hyperelastic model is: , Among them, represents the total energy, represents the weight occupied by the volume deformation of the tetrahedral element, represents the deformation gradient of the element, represents the square of the Frobenius norm of the matrix, , , Among them, is the mapping from Euler coordinates to Lagrangian coordinates, and are two other points on the tetrahedron different from and , is and , and , , the dihedral angle formed by the planes where they are located.
4. The mesh quality optimization method according to claim 3, characterized in that The step of iteratively calculating the minimum energy of the current mesh according to the constraint conditions and applying a random perturbation after every N iterations includes: Solve for the minimum energy of the current mesh through the variational vertex smoothing method, and the solution formula is: , wherein, represents the energy of the hyperelastic body, represents the Eulerian coordinates, represents the Lagrangian coordinates, represents the region defined by the hyperelastic body; The application of the random perturbation can be expressed as: , Among them, represents the -th vertex in the -th iteration, is the step size, represents a random move that satisfies the constraint conditions.
5. The mesh quality optimization method according to claim 4, characterized in that It further includes: Each time the minimum energy is updated, record or update the mesh vertex data once; The step of outputting the mesh corresponding to the minimum energy as the optimal mesh includes: Determine the optimal mesh based on the mesh vertex data recorded or updated last time.
6. The mesh quality optimization method according to claim 4, characterized in that Before the step of iteratively calculating the minimum energy of the current mesh according to the constraint conditions, it further includes: Initialize the node coordinates of the mesh, and preset the maximum number of iterations, convergence threshold, step size, and perturbation amplitude.
7. The mesh quality optimization method according to claim 1, wherein After the step of outputting the mesh corresponding to the minimum energy as the optimal mesh, it further includes: Assemble the finite element discrete equation through the mesh and calculate the first resonance frequency of the first resonance point; Compare the first resonance frequency with the resonance frequency of the first resonance point of the standard mesh to judge the accuracy of the optimal mesh.
8. A computer device, comprising a memory, a processor, and a computer program stored on 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-7.
9. A computer storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instruction is executed by the processor, it implements the steps of the mesh quality optimization method according to any one of claims 1-7.
10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by the processor, it implements the steps of the mesh quality optimization method according to any one of claims 1-7.
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
Three-dimensional grid quality optimization method based on Wolfe criterion correction Newton method
CN117454502A
Hybrid grid quality optimization method based on probability model
CN118153450A
Method and system for geometrical reconstruction of an internal anatomical structure
US20200226831A1
Cited By
Quadrilateral grid lightweight method and system, storage medium and equipment
CN121437810A
Product reconstruction method and system based on three-dimensional scanning and CAD surface deviation distribution
CN122154288A
A product reconstruction method and system based on three-dimensional scanning and CAD surface deviation distribution
CN122154288B