CN118153450A - A hybrid mesh quality optimization method based on probability model - Google Patents

A hybrid mesh quality optimization method based on probability model Download PDF

Info

Publication number
CN118153450A
CN118153450A CN202410394002.7A CN202410394002A CN118153450A CN 118153450 A CN118153450 A CN 118153450A CN 202410394002 A CN202410394002 A CN 202410394002A CN 118153450 A CN118153450 A CN 118153450A
Authority
CN
China
Prior art keywords
mesh
vertex
optimization
quality
optimized
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410394002.7A
Other languages
Chinese (zh)
Inventor
尹俊辉
邓龙威
曹欣雨
贺清
张朝阳
崔君豪
李斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN202410394002.7A priority Critical patent/CN118153450A/en
Publication of CN118153450A publication Critical patent/CN118153450A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/15Vehicle, aircraft or watercraft design
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three-dimensional [3D] modelling for computer graphics
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/08Probabilistic or stochastic CAD
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Artificial Intelligence (AREA)
  • Automation & Control Theory (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Operations Research (AREA)
  • Probability & Statistics with Applications (AREA)
  • Algebra (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Databases & Information Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Computer Graphics (AREA)
  • Computing Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明属于三维四面体网格质量优化领域,涉及一种基于概率模型的混合网格质量优化方法。本发明先对目标进行建模离散,生成三维四面体网格,得到网格顶点信息与相应的拓扑信息;然后确定网格单元质量度量准则,建立优化模型,设定错误函数、目标函数形式;再建立整体迭代模型,设定最大整体迭代次数;接着检索低质量的网格单元,对其顶点分别构造局部优化域;通过基于概率模型的混合网格质量优化方法迭代求解目标函数最优值,完成网格质量优化。本发明利用修改的梯度下降法完成一次求解,建立随机方向迭代求解概率模型,在保证稳健性的情况下降低计算量的同时达到更高的优化率,最终实现高稳健性、高效率、高优化率的网格质量优化。

The present invention belongs to the field of three-dimensional tetrahedral mesh quality optimization, and relates to a hybrid mesh quality optimization method based on a probability model. The present invention first discretizes the target model, generates a three-dimensional tetrahedral mesh, obtains mesh vertex information and corresponding topological information; then determines the quality metric of the mesh unit, establishes an optimization model, sets the error function and the objective function form; then establishes an overall iteration model, sets the maximum overall iteration number; then retrieves low-quality mesh units, and constructs local optimization domains for their vertices; iteratively solves the optimal value of the objective function through a hybrid mesh quality optimization method based on a probability model, and completes mesh quality optimization. The present invention uses a modified gradient descent method to complete a solution, establishes a random direction iterative solution probability model, reduces the amount of calculation while ensuring robustness, and achieves a higher optimization rate, and finally achieves mesh quality optimization with high robustness, high efficiency, and high optimization rate.

Description

一种基于概率模型的混合网格质量优化方法A hybrid mesh quality optimization method based on probability model

技术领域Technical Field

本发明属于三维四面体网格质量优化领域,涉及一种基于概率模型的混合网格质量优化方法。The invention belongs to the field of three-dimensional tetrahedron mesh quality optimization and relates to a hybrid mesh quality optimization method based on a probability model.

背景技术Background technique

数值模拟已成为与理论和实验方法并驾齐驱的关键研究方法。这种技术对于解决偏微分方程(PDEs)至关重要,其依赖于通过网格生成进行域离散化。作为数值计算的基石,网格生成建立了模拟所需的初始离散模型。网格生成是数值计算的一个重要分支,特别是计算电磁学(Computational Electromagnetics,CEM)领域对网格质量的要求更高,自动化水平和网格质量与计算周期的持续时间以及模拟的准确性和效率成正比。然而,自动化网格生成器通常产生的初步网格元素的质量不佳,不能满足数值分析的严格精确要求。这种不足可能导致模拟稳定性下降,数值错误放大,效率降低,以及出现意料之外的数值差异等。例如,在有限元分析中,过大的网格元素角度可能会加剧梯度误差,而过小的角度可能会提高刚度矩阵的条件数。因此,网格质量优化是网格生成后的一个必要的过程。Numerical simulation has become a key research method alongside theoretical and experimental methods. This technique is essential for solving partial differential equations (PDEs) and relies on domain discretization through mesh generation. As the cornerstone of numerical computing, mesh generation establishes the initial discretized model required for simulation. Mesh generation is an important branch of numerical computing, especially in the field of computational electromagnetics (CEM), where the requirements for mesh quality are higher. The level of automation and mesh quality are proportional to the duration of the calculation cycle and the accuracy and efficiency of the simulation. However, the quality of the preliminary mesh elements usually produced by automated mesh generators is poor and cannot meet the strict and precise requirements of numerical analysis. This deficiency may lead to decreased simulation stability, amplified numerical errors, reduced efficiency, and unexpected numerical differences. For example, in finite element analysis, too large mesh element angles may aggravate gradient errors, while too small angles may increase the condition number of the stiffness matrix. Therefore, mesh quality optimization is a necessary process after mesh generation.

在网格生成领域,网格顶点光顺能够大幅度提高非结构化网格的质量,因此备受研究人员的喜爱。网格顶点光顺主要包括基于优化的光顺方法和启发式光顺方法。In the field of mesh generation, mesh vertex smoothing can greatly improve the quality of unstructured meshes, so it is favored by researchers. Mesh vertex smoothing mainly includes optimization-based smoothing methods and heuristic smoothing methods.

与基于优化的光顺方法相比,启发式光顺方法通过人为经验,直接重定位顶点位置,在实现上更有效,但网格质量较低,其中比较经典的是Laplacian光顺。基于优化的光顺方法在实现过程中,一般会利用最优化领域里面的知识,通过建立优化模型、设定目标函数、采用优化算法、求解最优顶点位置等一系列步骤来实现局部网格质量的提升,这类方法对网格质量的提升比较大,但在时间的消耗上同样巨大。先前的研究也一直在追求平滑效率和网格质量之间的平衡。Compared with the optimization-based smoothing method, the heuristic smoothing method directly relocates the vertex position through human experience, which is more effective in implementation, but the mesh quality is lower. Among them, the more classic one is Laplacian smoothing. In the implementation process of the optimization-based smoothing method, the knowledge in the field of optimization is generally used to improve the local mesh quality through a series of steps such as establishing an optimization model, setting an objective function, using an optimization algorithm, and solving the optimal vertex position. This type of method has a relatively large improvement in mesh quality, but it also consumes a lot of time. Previous studies have also been pursuing a balance between smoothing efficiency and mesh quality.

经典的梯度下降法逐个对待优化顶点进行迭代优化求解,每次迭代都会求解目标函数在当前顶点位置下的梯度,后利用线搜索法求解最佳步长,最后更新顶点位置进入下一次迭代。梯度下降法本身具有比较快的速度,优化效果也很不错。但是不难发现在每个顶点的完整迭代过程中,只有前几次的优化效果比较好,后续迭代更多的是收敛到局部最优解,利用更多时间换取整体网格质量上限的提升,在平滑效率和网格质量之间的平衡上并不完美。The classic gradient descent method iteratively optimizes and solves the vertices to be optimized one by one. Each iteration solves the gradient of the objective function at the current vertex position, then uses the line search method to solve the optimal step size, and finally updates the vertex position to enter the next iteration. The gradient descent method itself has a relatively fast speed and good optimization effect. However, it is not difficult to find that in the complete iteration process of each vertex, only the optimization effect of the first few times is relatively good, and the subsequent iterations are more likely to converge to the local optimal solution, using more time in exchange for the improvement of the upper limit of the overall mesh quality. The balance between smoothing efficiency and mesh quality is not perfect.

因此,若对传统的梯度下降法进行修改,构造一种三维四面体网格优化算法,在保证稳健性的情况下降低计算量的同时达到更高的优化率,实现较好的平滑效率和网格质量之间的平衡,最终实现高稳健性、高效率、高优化率的网格质量优化;进而提高电磁模拟仿真的效率和准确度,从而降低产品在分析设计和数据验证中的成本。Therefore, if the traditional gradient descent method is modified and a three-dimensional tetrahedral mesh optimization algorithm is constructed, the amount of calculation can be reduced while ensuring robustness, while achieving a higher optimization rate, and a better balance between smoothing efficiency and mesh quality can be achieved, ultimately achieving mesh quality optimization with high robustness, high efficiency, and high optimization rate; thereby improving the efficiency and accuracy of electromagnetic simulation, thereby reducing the cost of products in analysis, design, and data verification.

发明内容Summary of the invention

针对上述存在问题或不足,为解决传统梯度下降法在平滑效率和网格质量间的平衡不佳的问题,本发明提供了一种基于概率模型的混合网格质量优化方法,通过建立概率模型,构造一种三维四面体网格优化算法,在保证稳健性的情况下降低计算量的同时达到更高的优化率,时间资源消耗更少,实现较好的平滑效率和网格质量之间的平衡,最终实现高稳健性、高效率、高优化率的网格质量优化;从而使得产品在分析设计和数据验证中成本降低。In view of the above-mentioned problems or shortcomings, and to solve the problem of poor balance between smoothing efficiency and mesh quality in the traditional gradient descent method, the present invention provides a hybrid mesh quality optimization method based on a probability model. By establishing a probability model, a three-dimensional tetrahedral mesh optimization algorithm is constructed. While ensuring robustness, the amount of calculation is reduced while achieving a higher optimization rate, consuming less time and resources, and achieving a better balance between smoothing efficiency and mesh quality, ultimately achieving mesh quality optimization with high robustness, high efficiency and high optimization rate; thereby reducing the cost of products in analysis, design and data verification.

一种基于概率模型的混合网格质量优化方法,包括以下步骤:A hybrid grid quality optimization method based on a probability model comprises the following steps:

步骤1、对目标进行建模离散,生成三维四面体网格。得到网格顶点信息与相应的拓扑信息,包括边界顶点、内部顶点信息,四面体网格拓扑信息与相邻网格信息。Step 1: Model and discretize the target to generate a three-dimensional tetrahedral mesh. Obtain mesh vertex information and corresponding topological information, including boundary vertices, internal vertex information, tetrahedral mesh topological information and adjacent mesh information.

其中边界顶点是参与构成模型表面三角形网格的网格顶点,而剩下的所有网格顶点称为内部顶点。所述四面体网格由4个不同的网格顶点组成,每个网格顶点拥有唯一且互不相同的编号,每个四面体网格同样拥有唯一且互不相同的编号。The boundary vertices are mesh vertices that participate in forming the triangular mesh of the model surface, and all the remaining mesh vertices are called internal vertices. The tetrahedral mesh is composed of 4 different mesh vertices, each mesh vertex has a unique and different number, and each tetrahedral mesh also has a unique and different number.

步骤2、对步骤1得到的网格,设置为初始网格,利用网格质量度量准则ρ计算初始网格质量,作为后续对比信息储存。Step 2: Set the grid obtained in step 1 as the initial grid, and use the grid quality criterion ρ to calculate the initial grid quality and store it as subsequent comparison information.

首先,对每个待优化顶点vfree构造局部优化域,局部优化域的具体定义如下:First, a local optimization domain is constructed for each vertex v free to be optimized. The specific definition of the local optimization domain is as follows:

在当前网格中查找所有以待优化顶点vfree为顶点的网格单元,这些网格单元构成一个类似于球体的三维实体,构成该三维实体表面的所有网格面叫做待优化顶点vfree的壳,壳内部空间称为待优化顶点vfree的局部优化域,即待优化顶点vfree的坐标约束空间。Search for all mesh cells with the vertex v free to be optimized as the vertex in the current mesh. These mesh cells constitute a three-dimensional entity similar to a sphere. All mesh faces constituting the surface of the three-dimensional entity are called the shell of the vertex v free to be optimized. The space inside the shell is called the local optimization domain of the vertex v free to be optimized, that is, the coordinate constraint space of the vertex v free to be optimized.

本发明使用的网格质量度量准则是纵横比ρ,具体如下式:The mesh quality metric used in the present invention is the aspect ratio ρ, which is specifically expressed as follows:

其中是当前待优化顶点vfree的坐标,其中x1、x2、x3分别表示三维笛卡尔坐标系的三个坐标轴上位置,(其中x1代表x坐标轴上位置,x2代表y坐标轴上位置,x3代表z坐标轴上位置);fi(x)是顶点vfree的局部优化域内第i个网格的网格质量函数,V是对应网格的体积,Sm是对应网格第m面的三角形面积,lh是四面体第h条边的边长,在该质量度量准则下,正四面体取得最大值1。in are the coordinates of the current vertex v free to be optimized, where x 1 , x 2 , and x 3 represent the positions on the three coordinate axes of the three-dimensional Cartesian coordinate system, respectively (where x 1 represents the position on the x-axis, x 2 represents the position on the y-axis, and x 3 represents the position on the z-axis); fi (x) is the mesh quality function of the i-th mesh in the local optimization domain of vertex v free , V is the volume of the corresponding mesh, S m is the triangular area of the m-th face of the corresponding mesh, and l h is the length of the h-th edge of the tetrahedron. Under this quality metric, the regular tetrahedron achieves the maximum value of 1.

步骤3、建立优化模型,设定错误函数、目标函数形式。Step 3: Establish an optimization model and set the error function and objective function.

优化算法一般是对最优化模型求最优解,也就是相应目标函数的最小值。在网格质量优化中一般是利用网格质量度量准则来建立目标函数,并且通用的最优网格类型为正四面体。而对于步骤2所表述的网格质量度量准则,其在正四面体下取得最大值1,不符合最优化模型的基本要求,因此建立错误函数e(x),如下式:The optimization algorithm generally seeks the optimal solution for the optimization model, that is, the minimum value of the corresponding objective function. In mesh quality optimization, the objective function is generally established using the mesh quality metric, and the universal optimal mesh type is a regular tetrahedron. However, for the mesh quality metric described in step 2, the maximum value of 1 is obtained under the regular tetrahedron, which does not meet the basic requirements of the optimization model. Therefore, the error function e(x) is established as follows:

此时当对应网格为正四面体时,错误函数e(x)取得最小值1,最优化模型得以建立。At this time, when the corresponding grid is a regular tetrahedron, the error function e(x) takes the minimum value 1, and the optimization model is established.

而目标函数A(x)的定义如下式The objective function A(x) is defined as follows:

其中n为待优化顶点vfree的局部优化域内网格数量。该目标函数形式旨在提升局部优化域的整体网格质量。Where n is the number of meshes in the local optimization domain of the vertex v free to be optimized. This objective function form aims to improve the overall mesh quality of the local optimization domain.

步骤4、建立整体迭代模型,设定最大整体迭代次数为K,定义其当前迭代次数为k。Step 4: Establish the overall iterative model, set the maximum overall iteration number as K, and define its current iteration number as k.

整体迭代模型即是对模型网格进行多轮次优化,在每轮优化中会首先查找需要优化的顶点,然后对每个顶点进行单独优化,所有顶点优化完毕后完成本轮优化进入下一轮优化或者退出。最大整体迭代次数也就是优化轮数,设定为K=3,而当前迭代次数首先设置为k=0。The overall iteration model is to optimize the model mesh in multiple rounds. In each round of optimization, the vertices that need to be optimized are first found, and then each vertex is optimized separately. After all vertices are optimized, the current round of optimization is completed and the next round of optimization or exit is entered. The maximum overall iteration number, that is, the number of optimization rounds, is set to K = 3, and the current iteration number is first set to k = 0.

步骤5、对于当前模型网格,利用步骤2所述的网格质量度量准则ρ计算所有网格质量,设定网格质量优化阈值τ,将网格质量低于该阈值的网格单元放入待优化网格单元容器ΦGStep 5: For the current model grid, use the grid quality metric criterion ρ described in step 2 to calculate the quality of all grids, set a grid quality optimization threshold τ, and put the grid cells with grid quality lower than the threshold into the grid cell container Φ G to be optimized.

网格质量优化阈值τ取值为0.1-0.6之间,数值越大每轮优化所涉及的网格顶点越多,优化效果越好,但时空消耗也会加剧。The mesh quality optimization threshold τ is between 0.1 and 0.6. The larger the value, the more mesh vertices are involved in each round of optimization, the better the optimization effect, but the time and space consumption will also increase.

步骤6、创建待优化网格顶点容器ΦV,遍历待优化网格单元容器ΦG,检查每个网格单元的4个组成顶点,若这些顶点是步骤1所描述的内部顶点,则加入容器ΦV,若是边界顶点则跳过。并剔除容器ΦV内重复网格顶点,得到最终待优化网格顶点容器ΦVStep 6: Create a mesh vertex container Φ V to be optimized, traverse the mesh unit container Φ G to be optimized, check the four constituent vertices of each mesh unit, and if these vertices are internal vertices described in step 1, add them to the container Φ V ; if they are boundary vertices, skip them. And remove the duplicate mesh vertices in the container Φ V to obtain the final mesh vertex container Φ V to be optimized.

跳过边界顶点是为了保证不对边界顶点进行移动,进而保持模型本身的形状以及装配体之间的拓扑一致性。The purpose of skipping boundary vertices is to ensure that the boundary vertices are not moved, thereby maintaining the shape of the model itself and the topological consistency between assemblies.

步骤7、遍历步骤6所得最终待优化网格顶点容器ΦV,对每个待优化顶点vfree构造局部优化域,建立目标函数A(x),通过基于概率模型的混合网格质量优化方法迭代求解目标函数最优值,最终完成一次网格质量优化的完整迭代。Step 7: traverse the final mesh vertex container Φ V to be optimized obtained in step 6, construct a local optimization domain for each vertex v free to be optimized, establish the objective function A(x), iteratively solve the optimal value of the objective function through the hybrid mesh quality optimization method based on the probability model, and finally complete a complete iteration of mesh quality optimization.

基于概率模型的混合网格质量优化方法的具体流程如下:The specific process of the hybrid grid quality optimization method based on the probability model is as follows:

对于每个待优化顶点vfree的最优值求解,首先利用修改的梯度下降法完成一次求解,使得顶点更接近最优解,然后建立随机方向迭代求解概率模型,进入顶点最优位置求解迭代过程,每次迭代根据概率随机选取顶点移动方向,然后根据目标函数变化调整各个方向概率,进入下一次迭代。设置随机方向迭代求解概率模型的最大迭代次数为A=200,定义其当前迭代次数为a。For the optimal value of each vertex v free to be optimized, first use the modified gradient descent method to complete a solution, so that the vertex is closer to the optimal solution, and then establish a random direction iterative solution probability model to enter the vertex optimal position solution iterative process. Each iteration randomly selects the vertex movement direction according to the probability, and then adjusts the probability of each direction according to the change of the objective function to enter the next iteration. Set the maximum number of iterations of the random direction iterative solution probability model to A = 200, and define its current number of iterations as a.

顶点最优位置求解迭代过程前的梯度下降法流程如下:The gradient descent process before the iterative process of solving the optimal vertex position is as follows:

计算待优化顶点vfree初始位置下的目标函数梯度则下降方向d定义如下:Calculate the objective function gradient at the initial position of the vertex v free to be optimized Then the descending direction d is defined as follows:

然后利用公知的弱Wolfe-Powell线搜索准则查找最优步长α,弱Wolfe-Powell线搜索准则定义如下:Then the well-known weak Wolfe-Powell line search criterion is used to find the optimal step size α. The weak Wolfe-Powell line search criterion is defined as follows:

满足上式的步长α满足弱Wolfe-Powell准则,其中c1,c2∈(0,1)为给定的常数,且c1<c2。步长α查找完毕后,对待优化顶点vfree位置进行更新,更新公式如下:The step length α that satisfies the above formula satisfies the weak Wolfe-Powell criterion, where c 1 ,c 2 ∈(0,1) are given constants and c 1 <c 2 . After the step length α is found, the position of the vertex v free to be optimized is updated, and the update formula is as follows:

xnew=x+c3αd (7)x new = x + c 3 αd (7)

xnew表示一次近似梯度下降完成后的待优化顶点vfree的新坐标位置,c3是修改的梯度下降权重,避免后续顶点最优位置求解迭代落入局部最优解,其中c3∈(0.3,0.8),较大的值能减少后续迭代步数的需求,但也容易落入局部最优解,导致最终优化效果一般。x new represents the new coordinate position of the vertex v free to be optimized after an approximate gradient descent is completed. c 3 is the modified gradient descent weight to prevent the subsequent vertex optimal position solution iteration from falling into the local optimal solution. Among them, c 3 ∈(0.3,0.8). A larger value can reduce the demand for subsequent iteration steps, but it is also easy to fall into the local optimal solution, resulting in mediocre final optimization effect.

利用上述修改的梯度下降法完成一次求解后,建立随机方向迭代求解概率模型,利用笛卡尔坐标系的三个坐标轴建立6个单位向量,也就是6个迭代方向dj(j=1,2,3,4,5,6),分别为:d1=(1,0,0)T、d2=(-1,0,0)T、d3=(0,1,0)T、d4=(0,-1,0)T、d5=(0,0,1)T和d6=(0,0,-1)T,6个迭代方向的选取概率设定为pj,初始情况下各个迭代方向选取概率相同,即利用顶点密度信息q设置每次迭代顶点移动距离L=c4q,其中c4∈(0.05,0.001),该数值定义了每次迭代顶点的移动距离,较小的值会取得更好的效果但最大迭代次数A也会随着增加,则在第a次迭代后,顶点位置为:After completing a solution using the modified gradient descent method, a random direction iterative solution probability model is established. Six unit vectors, i.e., six iteration directions dj (j=1, 2, 3, 4, 5, 6), are established using the three coordinate axes of the Cartesian coordinate system. They are: d1 =(1, 0, 0) T , d2 =(-1, 0, 0) T , d3 =(0, 1, 0) T , d4 =(0, -1, 0) T , d5 =(0, 0, 1) T , and d6 =(0, 0, -1) T . The selection probability of the six iteration directions is set to pj . Initially, the selection probability of each iteration direction is the same, i.e. The vertex density information q is used to set the vertex moving distance L = c 4 q for each iteration, where c 4 ∈ (0.05, 0.001). This value defines the moving distance of the vertex for each iteration. A smaller value will achieve better results, but the maximum number of iterations A will also increase. After the ath iteration, the vertex position is:

xa+1=xa+Lda (8)xa +1 = xa + Lda (8)

其中da为第a次迭代中的顶点移动方向,为dj中的任意一个。Where da is the vertex movement direction in the ath iteration, which is any one of dj .

进入顶点最优位置求解迭代过程,设置a=0。具体流程如下:Enter the iterative process of solving the optimal vertex position, and set a = 0. The specific process is as follows:

在每次迭代开始后,首先利用此时的迭代方向选取概率pj,随机选择本次迭代中顶点的移动方向da,对于该方向da,通过式(8)计算顶点的新位置xa+1并接受,比较顶点移动前后的目标函数值A(xa)和A(xa+1),若A(xa)<A(xa+1),即本次迭代后,局部优化域的网格质量降低,更新各个迭代方向的选取概率如下:At the beginning of each iteration, the iteration direction selection probability pj is first used to randomly select the moving direction da of the vertex in this iteration. For this direction da , the new position xa +1 of the vertex is calculated by equation (8) and accepted. The objective function values A( xa ) and A( xa+1 ) before and after the vertex movement are compared. If A( xa )<A( xa+1 ), that is, after this iteration, the mesh quality of the local optimization domain is reduced, the selection probability of each iteration direction is updated as follows:

若A(xa)≥A(xa+1),即本次迭代后,局部优化域的网格质量升高,更新各个迭代方向的选取概率如下:If A(x a )≥A(x a+1 ), that is, after this iteration, the mesh quality of the local optimization domain is improved, the selection probability of each iteration direction is updated as follows:

各个迭代方向的选取概率更新后,迭代次数a自加1,进入下一次迭代。且当a==A时,迭代终止,完成当前顶点的优化,进入下一个顶点优化过程,直到待优化网格顶点容器ΦV被遍历完毕。After the selection probability of each iteration direction is updated, the number of iterations a is incremented by 1 and the next iteration is entered. When a == A, the iteration is terminated, the optimization of the current vertex is completed, and the next vertex optimization process is entered until the mesh vertex container Φ V to be optimized is traversed.

步骤8、迭代次数k自加1,若k==K,则结束模型整体迭代优化,跳至步骤9;反之,回到步骤5继续模型整体迭代优化。Step 8: The number of iterations k is incremented by 1. If k == K, the overall iterative optimization of the model is terminated and the process goes to step 9. Otherwise, the process goes back to step 5 and the overall iterative optimization of the model is continued.

步骤9、对经过步骤8优化后的网格整体,利用步骤2所述的网格质量度量准则ρ更新所有网格单元质量,得到网格质量优化后的高质量网格并输出,同时输出优化前后的网格质量信息与网格质量优化时间消耗信息。Step 9: For the entire mesh optimized in step 8, use the mesh quality metric criterion ρ described in step 2 to update the quality of all mesh units, obtain a high-quality mesh after mesh quality optimization and output it, and at the same time output the mesh quality information before and after optimization and the mesh quality optimization time consumption information.

本发明首先利用修改的梯度下降法完成一次求解,使得顶点更接近最优解,然后建立随机方向迭代求解概率模型,进入顶点最优位置求解迭代过程,每次迭代开始时根据上次迭代结果,更新本次迭代各个迭代方向的选取概率,并根据该选取概率随机选取本次迭代顶点移动方向,然后更新顶点坐标,计算局部网格质量,进入下一次迭代。经典的梯度下降法每次迭代都会求解目标函数在当前顶点位置下的梯度,前几次的优化效果比较好,后续迭代则专注于收敛到局部最优解,利用更多时间换取整体网格质量上限的提升,这种思想在平滑效率和网格质量之间的平衡上并不完美。而本发明提出的方法则避免了后续在梯度上的求解,仅使用一次修改的梯度下降法来优化原始位置,然后不断通过概率模型迭代确定顶点的最优解,计算量大大降低,时间资源消耗更少,效率加快的同时网格质量也有所增加,平衡了平滑效率和网格质量之间的关系。The present invention first uses a modified gradient descent method to complete a solution, so that the vertex is closer to the optimal solution, and then establishes a random direction iterative solution probability model, enters the vertex optimal position solution iterative process, and at the beginning of each iteration, updates the selection probability of each iteration direction of this iteration according to the result of the previous iteration, and randomly selects the vertex movement direction of this iteration according to the selection probability, and then updates the vertex coordinates, calculates the local mesh quality, and enters the next iteration. The classic gradient descent method will solve the gradient of the objective function at the current vertex position at each iteration. The optimization effect of the first few times is relatively good, and the subsequent iterations focus on converging to the local optimal solution, using more time to exchange for the improvement of the upper limit of the overall mesh quality. This idea is not perfect in the balance between smoothing efficiency and mesh quality. The method proposed by the present invention avoids the subsequent solution on the gradient, only uses a modified gradient descent method to optimize the original position, and then continuously determines the optimal solution of the vertex through the probability model iteration, the amount of calculation is greatly reduced, the time resource consumption is less, the efficiency is accelerated, and the mesh quality is also increased, balancing the relationship between smoothing efficiency and mesh quality.

综上所述,本发明在保证稳健性的情况下降低计算量的同时达到更高的优化率,时间资源消耗更少,实现较好的平滑效率和网格质量之间的平衡,最终实现高稳健性、高效率、高优化率的网格质量优化。In summary, the present invention reduces the amount of calculation while ensuring robustness, achieves a higher optimization rate, consumes less time resources, achieves a better balance between smoothing efficiency and grid quality, and ultimately achieves grid quality optimization with high robustness, high efficiency, and high optimization rate.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本发明的流程图;Fig. 1 is a flow chart of the present invention;

图2是实施例的三维模型图;Fig. 2 is a three-dimensional model diagram of an embodiment;

图3是网格质量优化前、利用经典梯度下降法优化后与实施例的平均网格质量对比图。FIG3 is a comparison diagram of average mesh quality before mesh quality optimization, after optimization using the classical gradient descent method, and in the embodiment.

图4是利用经典梯度下降法优化与实施例所消耗的时间对比图。FIG4 is a comparison chart of the time consumed by optimizing using the classical gradient descent method and the embodiment.

具体实施方式Detailed ways

下面结合附图和实施例来详细说明本发明的技术方案。The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and embodiments.

一种基于Wolfe准则修正牛顿法的三维网格质量优化方法,参照图1,包括以下步骤:A three-dimensional mesh quality optimization method based on Wolfe criterion modified Newton method, referring to FIG1, comprises the following steps:

步骤1、对目标飞行器进行建模离散,利用公知的Delaunay三角剖分理论,生成三维四面体网格。得到网格顶点(边界顶点、内部顶点)信息与相应的拓扑信息(四面体网格拓扑信息与相邻网格信息)。Step 1: Model and discretize the target aircraft, and generate a three-dimensional tetrahedral mesh using the well-known Delaunay triangulation theory to obtain mesh vertex (boundary vertex, internal vertex) information and corresponding topological information (tetrahedral mesh topological information and adjacent mesh information).

本实施例以类X-51为例,建立如图2所示的模型结构,利用网格剖分工具对模型进行表面三角形网格剖分,后在表面三角形网格的基础上利用公知的Delaunay三角剖分理论对其进行内部的四面体网格剖分,再利用边界恢复等算法进一步完善模型,保证模型边界的完整性和模型不同划分区域间的拓扑相容性,最后得到类X-51模型的四面体网格剖分信息,包括所有网格顶点的坐标信息、模型表面三角形网格信息和模型内部四面体网格信息。This embodiment takes class X-51 as an example, establishes a model structure as shown in Figure 2, uses a mesh generation tool to perform surface triangular mesh generation on the model, and then uses the well-known Delaunay triangulation theory to perform internal tetrahedral mesh generation on the basis of the surface triangular mesh. The model is further improved using algorithms such as boundary recovery to ensure the integrity of the model boundary and the topological compatibility between different divided areas of the model. Finally, the tetrahedral mesh generation information of the class X-51 model is obtained, including the coordinate information of all mesh vertices, the model surface triangular mesh information, and the model internal tetrahedral mesh information.

其中边界顶点是参与构成模型表面三角形网格的网格顶点,而剩下的所有网格顶点称为内部顶点。所述四面体网格由4个不同的网格顶点组成,每个网格顶点拥有唯一且互不相同的编号,每个四面体网格同样拥有唯一且互不相同的编号。The boundary vertices are mesh vertices that participate in forming the triangular mesh of the model surface, and all the remaining mesh vertices are called internal vertices. The tetrahedral mesh is composed of 4 different mesh vertices, each mesh vertex has a unique and different number, and each tetrahedral mesh also has a unique and different number.

步骤2、对步骤1得到的网格,设置为初始网格,利用网格质量度量准则ρ计算初始网格质量,作为后续对比信息储存。Step 2: Set the grid obtained in step 1 as the initial grid, and use the grid quality criterion ρ to calculate the initial grid quality and store it as subsequent comparison information.

首先,对每个待优化顶点vfree构造局部优化域,局部优化域的具体定义如下:First, a local optimization domain is constructed for each vertex v free to be optimized. The specific definition of the local optimization domain is as follows:

在当前网格中查找所有以待优化顶点vfree为顶点的网格单元,这些网格单元构成一个类似于球体的三维实体,构成该三维实体表面的所有网格面叫做待优化顶点vfree的“壳”,“壳”内部空间称为待优化顶点vfree的局部优化域,即待优化顶点vfree的坐标约束空间。Search for all mesh cells with the vertex v free to be optimized as the vertex in the current mesh. These mesh cells constitute a three-dimensional entity similar to a sphere. All mesh faces constituting the surface of the three-dimensional entity are called the "shell" of the vertex v free to be optimized. The space inside the "shell" is called the local optimization domain of the vertex v free to be optimized, that is, the coordinate constraint space of the vertex v free to be optimized.

本发明使用的网格质量度量准则是纵横比ρ,具体如下式The grid quality metric used in the present invention is the aspect ratio ρ, which is expressed as follows:

其中是当前待优化顶点vfree的坐标,其中x1、x2、x3分别表示三维笛卡尔坐标系的三个坐标轴上位置,fi(x)是顶点vfree的局部优化域内第i个网格的网格质量函数,V是对应网格的体积,Sm是对应网格第m面的三角形面积,ln是四面体第n条边的边长,在该质量度量准则下,正四面体取得最大值1。in are the coordinates of the current vertex v free to be optimized, where x 1 , x 2 , and x 3 represent the positions on the three coordinate axes of the three-dimensional Cartesian coordinate system, respectively. fi (x) is the mesh quality function of the i-th mesh in the local optimization domain of vertex v free . V is the volume of the corresponding mesh. S m is the triangular area of the m-th face of the corresponding mesh. l n is the length of the n-th edge of the tetrahedron. Under this quality metric, the regular tetrahedron achieves the maximum value of 1.

步骤3、建立优化模型,设定错误函数、目标函数形式。Step 3: Establish an optimization model and set the error function and objective function.

优化算法一般是对最优化模型求最优解,也就是相应目标函数的最小值。在网格质量优化中一般是利用网格质量度量准则来建立目标函数,并且通用的最优网格类型为正四面体。而对于步骤2所表述的网格质量度量准则,其在正四面体下取得最大值1,不符合最优化模型的基本要求,因此建立错误函数e(x),如下式:The optimization algorithm generally seeks the optimal solution for the optimization model, that is, the minimum value of the corresponding objective function. In mesh quality optimization, the objective function is generally established using the mesh quality metric, and the universal optimal mesh type is a regular tetrahedron. However, for the mesh quality metric described in step 2, the maximum value of 1 is obtained under the regular tetrahedron, which does not meet the basic requirements of the optimization model. Therefore, the error function e(x) is established as follows:

此时当对应网格为正四面体时,错误函数e(x)取得最小值1,最优化模型得以建立。At this time, when the corresponding grid is a regular tetrahedron, the error function e(x) takes the minimum value 1, and the optimization model is established.

而目标函数A(x)的定义如下式The objective function A(x) is defined as follows:

其中n为待优化顶点vfree的局部优化域内网格数量。该目标函数形式旨在提升局部优化域的整体网格质量。Where n is the number of meshes in the local optimization domain of the vertex v free to be optimized. This objective function form aims to improve the overall mesh quality of the local optimization domain.

步骤4、建立整体迭代模型,设定最大整体迭代次数K,定义当前迭代次数k。Step 4: Establish the overall iterative model, set the maximum overall iteration number K, and define the current iteration number k.

整体迭代模型即是对模型网格进行多轮次优化,在每轮优化中会首先查找需要优化的顶点,然后对每个顶点进行单独优化,所有顶点优化完毕后完成本轮优化进入下一轮优化或者退出。最大整体迭代次数也就是优化轮数,设定为K=3,而当前迭代次数首先设置为k=0。The overall iteration model is to optimize the model mesh in multiple rounds. In each round of optimization, the vertices that need to be optimized are first found, and then each vertex is optimized separately. After all vertices are optimized, the current round of optimization is completed and the next round of optimization or exit is entered. The maximum overall iteration number, that is, the number of optimization rounds, is set to K = 3, and the current iteration number is first set to k = 0.

步骤5、对于当前模型网格,利用步骤2所述的网格质量度量准则ρ计算所有网格质量,在本实施例中设定τ=0.25,将网格质量低于该阈值的网格单元放入待优化网格单元容器ΦGStep 5: For the current model grid, the grid quality metric criterion ρ described in step 2 is used to calculate the quality of all grids. In this embodiment, τ=0.25 is set, and grid cells with grid quality lower than the threshold are placed in the grid cell container Φ G to be optimized.

步骤6、创建待优化网格顶点容器ΦV,遍历待优化网格单元容器ΦG,检查每个网格单元的4个组成顶点,若这些顶点是步骤1所描述的内部顶点,则加入容器ΦV,若是边界顶点则跳过。剔除容器ΦV内重复网格顶点,得到最终待优化网格顶点容器ΦVStep 6: Create a mesh vertex container Φ V to be optimized, traverse the mesh unit container Φ G to be optimized, check the four component vertices of each mesh unit, if these vertices are internal vertices described in step 1, add them to the container Φ V , if they are boundary vertices, skip them. Eliminate duplicate mesh vertices in the container Φ V to obtain the final mesh vertex container Φ V to be optimized.

跳过边界顶点是为了保证不对边界顶点进行移动,进而保持模型本身的形状以及装配体之间的拓扑一致性。The purpose of skipping boundary vertices is to ensure that the boundary vertices are not moved, thereby maintaining the shape of the model itself and the topological consistency between assemblies.

步骤7、遍历步骤6所得最终待优化网格顶点容器ΦV,对每个待优化顶点vfree构造局部优化域,建立目标函数A(x),通过基于概率模型的混合网格质量优化方法迭代求解目标函数最优值,最终完成一次网格质量优化的完整迭代。本实施例中设置c1=0.001,c2=0.9,c3=0.5,c4=0.002。Step 7, traverse the final mesh vertex container Φ V to be optimized obtained in step 6, construct a local optimization domain for each vertex v free to be optimized, establish the objective function A(x), iteratively solve the optimal value of the objective function through the hybrid mesh quality optimization method based on the probability model, and finally complete a complete iteration of mesh quality optimization. In this embodiment, c 1 =0.001, c 2 =0.9, c 3 =0.5, c 4 =0.002 are set.

步骤8、迭代次数k自加1,若k==K,则结束模型整体迭代优化,跳至步骤9;反之,回到步骤5继续模型整体迭代优化。Step 8: The number of iterations k is incremented by 1. If k == K, the overall iterative optimization of the model is terminated and the process goes to step 9. Otherwise, the process goes back to step 5 and the overall iterative optimization of the model is continued.

步骤9、对经过步骤8优化后的网格整体,利用步骤2所述的网格质量度量准则ρ更新所有网格单元质量,得到网格质量优化后的高质量网格并输出,同时输出优化前后的网格质量信息。Step 9: For the entire mesh optimized in step 8, use the mesh quality metric criterion ρ described in step 2 to update the quality of all mesh units, obtain a high-quality mesh after mesh quality optimization and output it, and at the same time output the mesh quality information before and after optimization.

图3是在不同网格密度下,针对类X-51模型为例(如图2所示),网格质量优化前、利用经典梯度下降法优化后与本发明方法优化后的平均网格质量对比图。对基于本发明方案对类X-51网格质量优化前后的数据进行分析,整体网格质量有显著提升,在500万网格单元数量下,优化前平均网格质量为0.633972,优化后平均网格质量为0.646157,整体网格优化率达到1.922%。并且与经典梯度下降法对相同网格的网格质量优化效果对比,本发明方案对比使用的经典梯度下降法对每个顶点的迭代次数设定为5,该方法优化后平均网格质量为0.646116,结果表明本发明方案对网格质量的优化效果要好,整体网格优化率更高。FIG3 is a comparison chart of average mesh quality before mesh quality optimization, after optimization using the classical gradient descent method, and after optimization using the method of the present invention, for a model of the X-51 type under different mesh densities (as shown in FIG2 ). The data before and after the optimization of the mesh quality of the X-51 type based on the scheme of the present invention are analyzed, and the overall mesh quality is significantly improved. Under the number of 5 million mesh units, the average mesh quality before optimization is 0.633972, and the average mesh quality after optimization is 0.646157, and the overall mesh optimization rate reaches 1.922%. In addition, compared with the mesh quality optimization effect of the classical gradient descent method on the same mesh, the scheme of the present invention sets the number of iterations for each vertex to 5 using the classical gradient descent method, and the average mesh quality after optimization by this method is 0.646116. The results show that the scheme of the present invention has a better optimization effect on mesh quality and a higher overall mesh optimization rate.

在时间上,如图4所示,在不同网格密度下,同样对类X-51模型在500万网格单元数量下,本发明方案消耗时间为99.5s,而经典梯度下降法消耗时间为140.8s,结果表明本发明方案在优化效果与经典梯度下降法相当甚至略微超越的情况下,时间消耗降低了41.3s,优化效率加快了29.33%。而对于经过本发明方案优化后的类X-51网格,可以进一步进行飞行器结构的模态仿真分析设计的后续操作。In terms of time, as shown in FIG4, under different grid densities, for the same X-51-like model with 5 million grid units, the solution of the present invention consumes 99.5 seconds, while the classic gradient descent method consumes 140.8 seconds. The results show that the solution of the present invention reduces the time consumption by 41.3 seconds and speeds up the optimization efficiency by 29.33% while the optimization effect is comparable to or even slightly exceeds that of the classic gradient descent method. For the X-51-like grid optimized by the solution of the present invention, the subsequent operation of modal simulation analysis and design of the aircraft structure can be further performed.

通过以上实施例可见,本发明首先对目标进行建模离散,生成三维四面体网格。得到网格顶点信息与相应的拓扑信息,包括边界顶点、内部顶点信息,四面体网格拓扑信息与相邻网格信息;确定网格单元质量度量准则,建立优化模型,设定错误函数、目标函数形式;然后建立整体迭代模型,设定最大整体迭代次数;检索低质量的网格单元,对其顶点分别构造局部优化域;通过基于概率模型的混合网格质量优化方法迭代求解目标函数最优值,完成网格质量优化。本发明对于每个待优化顶点的最优值求解,首先利用修改的梯度下降法完成一次求解,使得顶点更接近最优解,然后建立随机方向迭代求解概率模型,进入顶点最优位置求解迭代过程,时间资源消耗更少,效率加快的同时网格质量也有所增加,平衡了平滑效率和网格质量之间的关系,在保证稳健性的情况下降低计算量的同时达到更高的优化率,最终实现高稳健性、高效率、高优化率的网格质量优化。It can be seen from the above embodiments that the present invention first discretizes the target model and generates a three-dimensional tetrahedral mesh. Obtain mesh vertex information and corresponding topological information, including boundary vertices, internal vertex information, tetrahedral mesh topological information and adjacent mesh information; determine the quality metric of the mesh unit, establish an optimization model, set the error function and the objective function form; then establish an overall iteration model, set the maximum overall iteration number; retrieve low-quality mesh units, and construct local optimization domains for their vertices respectively; iteratively solve the optimal value of the objective function through a hybrid mesh quality optimization method based on a probability model to complete mesh quality optimization. For the optimal value solution of each vertex to be optimized, the present invention first uses a modified gradient descent method to complete a solution, so that the vertex is closer to the optimal solution, and then establishes a random direction iterative solution probability model, enters the vertex optimal position solution iterative process, consumes less time and resources, and the efficiency is accelerated while the mesh quality is also increased, balancing the relationship between smoothing efficiency and mesh quality, reducing the amount of calculation while ensuring robustness, and achieving a higher optimization rate, and finally achieving high robustness, high efficiency, and high optimization rate mesh quality optimization.

Claims (5)

1.一种基于概率模型的混合网格质量优化方法,其特征在于,包括以下步骤:1. A hybrid grid quality optimization method based on a probability model, characterized by comprising the following steps: 步骤1、对目标进行建模离散,生成三维四面体网格;得到网格顶点信息与相应的拓扑信息,包括边界顶点、内部顶点信息,四面体网格拓扑信息与相邻网格信息;Step 1: Model and discretize the target to generate a three-dimensional tetrahedral mesh; obtain mesh vertex information and corresponding topological information, including boundary vertices, internal vertex information, tetrahedral mesh topological information and adjacent mesh information; 其中边界顶点是参与构成模型表面三角形网格的网格顶点,而剩下的所有网格顶点称为内部顶点;所述四面体网格由4个不同的网格顶点组成,每个网格顶点拥有唯一且互不相同的编号,每个四面体网格同样拥有唯一且互不相同的编号;The boundary vertices are mesh vertices that participate in forming the triangular mesh of the model surface, and all the remaining mesh vertices are called internal vertices; the tetrahedral mesh is composed of 4 different mesh vertices, each mesh vertex has a unique and different number, and each tetrahedral mesh also has a unique and different number; 步骤2、对步骤1得到的网格,设置为初始网格,利用网格质量度量准则ρ计算初始网格质量,作为后续对比信息储存;Step 2: The grid obtained in step 1 is set as the initial grid, and the initial grid quality is calculated using the grid quality criterion ρ, which is stored as subsequent comparison information; 首先,对每个待优化顶点vfree构造局部优化域,局部优化域的具体定义如下:First, a local optimization domain is constructed for each vertex v free to be optimized. The specific definition of the local optimization domain is as follows: 在当前网格中查找所有以待优化顶点vfree为顶点的网格单元,这些网格单元构成一个类似于球体的三维实体,构成该三维实体表面的所有网格面叫做待优化顶点vfree的壳,壳内部空间称为待优化顶点vfree的局部优化域,即待优化顶点vfree的坐标约束空间;Find all mesh units with the vertex v free to be optimized as the vertex in the current mesh. These mesh units form a three-dimensional entity similar to a sphere. All mesh faces constituting the surface of the three-dimensional entity are called the shell of the vertex v free to be optimized. The space inside the shell is called the local optimization domain of the vertex v free to be optimized, that is, the coordinate constraint space of the vertex v free to be optimized. 网格质量度量准则为纵横比ρ,具体如下式:The mesh quality metric is the aspect ratio ρ, which is as follows: 其中是当前待优化顶点vfree的坐标,其中x1、x2、x3分别表示三维笛卡尔坐标系的三个坐标轴上位置,x1代表x坐标轴上位置,x2代表y坐标轴上位置,x3代表z坐标轴上位置;fi(x)是顶点vfree的局部优化域内第i个网格的网格质量函数,V是对应网格的体积,Sm是对应网格第m面的三角形面积,lh是四面体第h条边的边长,在该质量度量准则下,正四面体取得最大值1;in is the coordinate of the current vertex v free to be optimized, where x 1 , x 2 , and x 3 represent the positions on the three coordinate axes of the three-dimensional Cartesian coordinate system, x 1 represents the position on the x coordinate axis, x 2 represents the position on the y coordinate axis, and x 3 represents the position on the z coordinate axis; fi (x) is the mesh quality function of the i-th mesh in the local optimization domain of the vertex v free , V is the volume of the corresponding mesh, S m is the triangle area of the m-th face of the corresponding mesh, and l h is the length of the h-th edge of the tetrahedron. Under this quality metric, the regular tetrahedron achieves the maximum value of 1; 步骤3、建立优化模型,设定错误函数、目标函数形式;Step 3: Establish an optimization model and set the error function and objective function form; 建立错误函数e(x),如下式:Establish the error function e(x) as follows: 当对应网格为正四面体时,错误函数e(x)取得最小值1,最优化模型得以建立;When the corresponding mesh is a regular tetrahedron, the error function e(x) obtains the minimum value 1, and the optimization model is established; 而目标函数A(x)的定义如下式The objective function A(x) is defined as follows: 其中n为待优化顶点vfree的局部优化域内网格数量;Where n is the number of grids in the local optimization domain of the vertex v free to be optimized; 步骤4、建立整体迭代模型,设定最大整体迭代次数为K,定义其当前迭代次数为k;Step 4: Establish an overall iterative model, set the maximum overall iteration number as K, and define its current iteration number as k; 整体迭代模型是对模型网格进行多轮次优化,在每轮优化中会首先查找需要优化的顶点,然后对每个顶点进行单独优化,所有顶点优化完毕后完成本轮优化进入下一轮优化或者退出;最大整体迭代次数也就是优化轮数,设定为K=3,而当前迭代次数首先设置为k=0;The overall iterative model optimizes the model mesh in multiple rounds. In each round of optimization, the vertices that need to be optimized are first found, and then each vertex is optimized separately. After all vertices are optimized, the current round of optimization is completed and the next round of optimization or exit is entered; the maximum overall number of iterations, that is, the number of optimization rounds, is set to K = 3, and the current number of iterations is first set to k = 0; 步骤5、对于当前模型网格,利用步骤2所述的网格质量度量准则ρ计算所有网格质量,设定网格质量优化阈值τ,将网格质量低于该阈值的网格单元放入待优化网格单元容器ΦG,τ取值为0.1-0.6;Step 5: For the current model grid, use the grid quality metric criterion ρ described in step 2 to calculate the quality of all grids, set a grid quality optimization threshold τ, and put the grid cells with grid quality lower than the threshold into the grid cell container Φ G to be optimized, where τ takes a value of 0.1-0.6; 步骤6、创建待优化网格顶点容器ΦV,遍历待优化网格单元容器ΦG,检查每个网格单元的4个组成顶点,若这些顶点是步骤1所描述的内部顶点,则加入容器ΦV,若是边界顶点则跳过;并剔除容器ΦV内重复网格顶点,得到最终待优化网格顶点容器ΦVStep 6: Create a mesh vertex container Φ V to be optimized, traverse the mesh unit container Φ G to be optimized, check the four component vertices of each mesh unit, if these vertices are internal vertices described in step 1, add them to the container Φ V , if they are boundary vertices, skip them; and remove the repeated mesh vertices in the container Φ V to obtain the final mesh vertex container Φ V to be optimized; 步骤7、遍历步骤6所得最终待优化网格顶点容器ΦV,对每个待优化顶点vfree构造局部优化域,建立目标函数A(x),通过基于概率模型的混合网格质量优化方法迭代求解目标函数最优值,最终完成一次网格质量优化的完整迭代;Step 7, traverse the final mesh vertex container Φ V to be optimized obtained in step 6, construct a local optimization domain for each vertex v free to be optimized, establish the objective function A(x), iteratively solve the optimal value of the objective function through the hybrid mesh quality optimization method based on the probability model, and finally complete a complete iteration of mesh quality optimization; 基于概率模型的混合网格质量优化方法的具体流程如下:The specific process of the hybrid grid quality optimization method based on the probability model is as follows: 对于每个待优化顶点vfree的最优值求解,首先利用修改的梯度下降法完成一次求解,使得顶点更接近最优解,然后建立随机方向迭代求解概率模型,进入顶点最优位置求解迭代过程,每次迭代根据概率随机选取顶点移动方向,然后根据目标函数变化调整各个方向概率,进入下一次迭代;设置随机方向迭代求解概率模型的最大迭代次数为A=200,定义其当前迭代次数为a;For the optimal value solution of each vertex v free to be optimized, first use the modified gradient descent method to complete a solution, so that the vertex is closer to the optimal solution, then establish a random direction iterative solution probability model, and enter the vertex optimal position solution iterative process. Each iteration randomly selects the vertex movement direction according to the probability, and then adjusts the probability of each direction according to the change of the objective function to enter the next iteration; set the maximum number of iterations of the random direction iterative solution probability model to A = 200, and define its current number of iterations as a; 顶点最优位置求解迭代过程前的梯度下降法流程如下:The gradient descent process before the iterative process of solving the optimal vertex position is as follows: 计算待优化顶点vfree初始位置下的目标函数梯度▽A(x),则下降方向d定义如下:Calculate the objective function gradient ▽A(x) at the initial position of the vertex v free to be optimized, and the descent direction d is defined as follows: d=-▽A(x) (4)d=-▽A(x) (4) 利用弱Wolfe-Powell线搜索准则查找最优步长α,弱Wolfe-Powell线搜索准则定义如下:The optimal step size α is found using the weak Wolfe-Powell line search criterion, which is defined as follows: f(x+αd)≤f(x)+c1α▽f(x)Td (5)f(x+αd)≤f(x)+c 1 α▽f(x) T d (5) ▽f(x+αd)Td≥c2▽f(x)Td (6)满足上式的步长α满足弱Wolfe-Powell准则,其中c1,c2∈(0,1)为给定的常数,且c1<c2;步长α查找完毕后,对待优化顶点vfree位置进行更新,更新公式如下:▽f(x+αd) T d≥c 2 ▽f(x) T d (6) The step length α that satisfies the above formula satisfies the weak Wolfe-Powell criterion, where c 1 ,c 2 ∈(0,1) are given constants and c 1 <c 2 ; After the step length α is found, the position of the vertex v free to be optimized is updated, and the update formula is as follows: xnew=x+c3αd (7)x new = x + c 3 αd (7) xnew表示一次近似梯度下降完成后的待优化顶点vfree的新坐标位置,c3是修改的梯度下降权重,避免后续顶点最优位置求解迭代落入局部最优解,其中c3∈(0.3,0.8);x new represents the new coordinate position of the vertex v free to be optimized after an approximate gradient descent is completed, c 3 is the modified gradient descent weight to prevent the subsequent vertex optimal position solution from falling into the local optimal solution, where c 3 ∈(0.3,0.8); 利用上述修改的梯度下降法完成一次求解后,建立随机方向迭代求解概率模型,利用笛卡尔坐标系的三个坐标轴建立6个单位向量,也就是6个迭代方向dj(j=1,2,3,4,5,6),分别为:d1=(1,0,0)T、d2=(-1,0,0)T、d3=(0,1,0)T、d4=(0,-1,0)T、d5=(0,0,1)T和d6=(0,0,-1)T,6个迭代方向的选取概率设定为pj;初始情况下各个迭代方向选取概率相同,即利用顶点密度信息q设置每次迭代顶点移动距离L=c4q,其中c4∈(0.05,0.001),则在第a次迭代后,顶点位置为:After completing a solution using the modified gradient descent method, a random direction iterative solution probability model is established. Six unit vectors, i.e., six iteration directions dj (j=1, 2, 3, 4, 5, 6), are established using the three coordinate axes of the Cartesian coordinate system. They are: d1 =(1, 0, 0) T , d2 =(-1, 0, 0) T , d3 =(0, 1, 0) T , d4 =(0, -1, 0) T , d5 =(0, 0, 1) T , and d6 =(0, 0, -1) T . The selection probability of the six iteration directions is set to pj . Initially, the selection probability of each iteration direction is the same, i.e. Using vertex density information q, we set the vertex moving distance L = c 4 q for each iteration, where c 4 ∈ (0.05, 0.001). Then, after the ath iteration, the vertex position is: xa+1=xa+Lda (8)xa +1 = xa + Lda (8) 其中da为第a次迭代中的顶点移动方向,为dj中的任意一个;Where d a is the vertex moving direction in the ath iteration, which is any one of d j ; 进入顶点最优位置求解迭代过程,设置a=0,具体流程如下:Enter the iterative process of solving the optimal vertex position, set a = 0, and the specific process is as follows: 在每次迭代开始后,首先利用此时的迭代方向选取概率pj,随机选择本次迭代中顶点的移动方向da,对于该方向da,通过式(8)计算顶点的新位置xa+1并接受,比较顶点移动前后的目标函数值A(xa)和A(xa+1),若A(xa)<A(xa+1),本次迭代后,局部优化域的网格质量降低,更新各个迭代方向的选取概率如下:At the beginning of each iteration, the iteration direction selection probability pj is first used to randomly select the moving direction da of the vertex in this iteration. For this direction da , the new position xa +1 of the vertex is calculated by equation (8) and accepted. The objective function values A( xa ) and A( xa+1 ) before and after the vertex movement are compared. If A( xa ) < A( xa+1 ), after this iteration, the mesh quality of the local optimization domain is reduced, and the selection probability of each iteration direction is updated as follows: 若A(xa)≥A(xa+1),本次迭代后,局部优化域的网格质量升高,更新各个迭代方向的选取概率如下:If A(x a )≥A(x a+1 ), after this iteration, the mesh quality of the local optimization domain is improved, and the selection probability of each iteration direction is updated as follows: 各个迭代方向的选取概率更新后,迭代次数a自加1,进入下一次迭代;且当a==A时,迭代终止,完成当前顶点的优化,进入下一个顶点优化过程,直到待优化网格顶点容器ΦV被遍历完毕;After the selection probability of each iteration direction is updated, the number of iterations a is incremented by 1 and the next iteration is entered; and when a == A, the iteration is terminated, the optimization of the current vertex is completed, and the next vertex optimization process is entered until the mesh vertex container Φ V to be optimized is traversed; 步骤8、迭代次数k自加1,若k==K,则结束模型整体迭代优化,跳至步骤9;反之,回到步骤5继续模型整体迭代优化;Step 8, the number of iterations k is incremented by 1. If k == K, the overall iterative optimization of the model is terminated and the process goes to step 9. Otherwise, the process goes back to step 5 to continue the overall iterative optimization of the model. 步骤9、对经过步骤8优化后的网格整体,利用步骤2所述的网格质量度量准则ρ更新所有网格单元质量,得到网格质量优化后的高质量网格并输出,同时输出优化前后的网格质量信息与网格质量优化时间消耗信息。Step 9: For the entire mesh optimized in step 8, use the mesh quality metric criterion ρ described in step 2 to update the quality of all mesh units, obtain a high-quality mesh after mesh quality optimization and output it, and at the same time output the mesh quality information before and after optimization and the mesh quality optimization time consumption information. 2.如权利要求1所述基于概率模型的混合网格质量优化方法,其特征在于:所述步骤1中采用Delaunay三角剖分理论,生成三维四面体网格。2. The hybrid mesh quality optimization method based on a probability model as claimed in claim 1, characterized in that: in the step 1, Delaunay triangulation theory is used to generate a three-dimensional tetrahedral mesh. 3.如权利要求1所述基于概率模型的混合网格质量优化方法,其特征在于:所述步骤7中,c1=0.001,c2=0.9,c3=0.5,c4=0.002。3. The hybrid grid quality optimization method based on probability model according to claim 1, characterized in that: in said step 7, c1 = 0.001, c2 = 0.9, c3 = 0.5, c4 = 0.002. 4.如权利要求1所述基于概率模型的混合网格质量优化方法,其特征在于:所述τ=0.25。4. The hybrid grid quality optimization method based on probability model as claimed in claim 1, characterized in that: τ = 0.25. 5.如权利要求1所述基于概率模型的混合网格质量优化方法,其特征在于:将步骤9网格质量优化后的高质量网格用以进行电磁模拟仿真,进而进行目标产品的分析设计和数据验证。5. The hybrid mesh quality optimization method based on probability model as described in claim 1 is characterized in that the high-quality mesh after the mesh quality optimization in step 9 is used for electromagnetic simulation, and then the analysis, design and data verification of the target product are carried out.
CN202410394002.7A 2024-04-02 2024-04-02 A hybrid mesh quality optimization method based on probability model Pending CN118153450A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410394002.7A CN118153450A (en) 2024-04-02 2024-04-02 A hybrid mesh quality optimization method based on probability model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410394002.7A CN118153450A (en) 2024-04-02 2024-04-02 A hybrid mesh quality optimization method based on probability model

Publications (1)

Publication Number Publication Date
CN118153450A true CN118153450A (en) 2024-06-07

Family

ID=91298471

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410394002.7A Pending CN118153450A (en) 2024-04-02 2024-04-02 A hybrid mesh quality optimization method based on probability model

Country Status (1)

Country Link
CN (1) CN118153450A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120409146A (en) * 2025-07-02 2025-08-01 巨霖科技(上海)有限公司 Grid quality optimization method, computer equipment, program product and storage medium
CN120893129A (en) * 2025-09-30 2025-11-04 山东山大华天软件股份有限公司 Three-dimensional geometric modeling method and system for aircraft wing structures

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120409146A (en) * 2025-07-02 2025-08-01 巨霖科技(上海)有限公司 Grid quality optimization method, computer equipment, program product and storage medium
CN120893129A (en) * 2025-09-30 2025-11-04 山东山大华天软件股份有限公司 Three-dimensional geometric modeling method and system for aircraft wing structures

Similar Documents

Publication Publication Date Title
CN118153450A (en) A hybrid mesh quality optimization method based on probability model
CN107609650B (en) Particle genetic algorithm optimization method, device and system based on time load balancing
CN115081587B (en) Operation deployment method of impulse neural network on hardware in brain-like computer
CN108763827B (en) Transmission tower finite element model establishing method and device
CN112947480B (en) Mobile robot path planning method, storage medium and system
CN113239584B (en) Optimized additive manufacturing method and system
CN111780759A (en) A Path Planning Method for Mobile Robots Based on Improved Genetic Algorithm
CN110225096B (en) Server load balancing method based on genetic algorithm
CN118551399B (en) Parallel partitioning dynamic grid encryption optimization method and system for reactor flow field simulation
CN108537797A (en) The distortion of the mesh optimization method of deformable objects cutting simulation in a kind of virtual operation
CN109376941A (en) Building energy consumption simulation and optimization method based on artificial neural network and BIM
US11973662B1 (en) Intelligent mapping method for cloud tenant virtual network based on reinforcement learning model
CN108898257A (en) A kind of gray prediction method based on particle group optimizing
CN117634697A (en) Comprehensive energy scheduling method and system based on improved differential evolution whale optimization
CN116592890A (en) A picking robot path planning method, system, electronic equipment and medium
CN117151277A (en) Two-dimensional irregular layout method and application based on network migration and hybrid positioning
CN116150879A (en) An Optimal Design Method for Airfoil Profile of Fixed-wing Aircraft
CN119361035A (en) Neutron shielding material optimization method based on machine learning and chaos mapping NSGA-Ⅲ
CN114123216A (en) Economic load distribution method, system and medium for new energy power system
Zhang et al. A flexible and efficient optimization design framework for the shape of blend-wing-body underwater glider
CN117972834A (en) A method and system for intelligent design and topology optimization of key nodes of aerial building construction machine
CN109145449A (en) A kind of level of factory thermal power plant load distribution method
CN105069192B (en) A kind of improved method that power of fan parameter of curve model is solved based on genetic algorithm
CN116339973A (en) Computing Resource Scheduling Method for Digital Twin Cloud Platform Based on Particle Swarm Optimization Algorithm
CN103440540B (en) A kind of parallel method of land utilization space layout artificial immunity Optimized model

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination