A method, device, equipment and medium for automatically generating structured quadrilateral mesh

Through the combination of reinforcement learning and hyperlimit interpolation method, structured quadrilateral mesh is automatically generated, which solves the problem of insufficient flexibility in the generation of polygonal mesh in the existing technology, and realizes efficient and reliable automatic mesh generation and quality improvement. .

CN118799528BActive Publication Date: 2024-11-22CALCULATION AERODYNAMICS INST CHINA AERODYNAMICS RES & DEV CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411281322.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-11-22
Estimated Expiration
2044-09-13

AI Technical Summary

Technical Problem

The existing structured quadrilateral mesh generation method is not flexible enough to deal with complex or non-complex polygonal areas. The automation method has high requirements for area shape and topology, resulting in the unsatisfactory quality of the generated mesh and requires manual correction or re-issue. Dividing.

Method used

Using reinforcement learning-based method, the polygonal region is recursively divided through the pre-trained target reinforcement learning model, combined with the superlimit interpolation method to generate a structured quadrilateral mesh, and mesh assembly and optimization are performed to adaptively control the mesh density and distributed.

Benefits of technology

It realizes efficient and reliable automatic generation of structured quadrilateral mesh for polygonal areas of any degree of complexity, improves the efficiency and quality of mesh generation, and reduces manual intervention and subjectivity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799528B_ABST
    Figure CN118799528B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for automatically generating structured quadrilateral meshes, which relates to the field of computer technology, and includes: using a pre-trained target reinforcement learning model to divide a polygonal area to be processed into quadrilateral sub-areas to obtain multiple sub-areas; using each sub-area as a new polygonal area to be processed, and jumping back to the step of dividing the polygonal area to be processed into quadrilateral sub-areas, until multiple target sub-areas are obtained when the preset recursive division termination condition is met; generating structured quadrilateral meshes in each target sub-area based on the transfinite interpolation method; assembling the obtained multiple target structured quadrilateral meshes, and optimizing the obtained assembled meshes based on the preset mesh optimization rules to obtain the target mesh corresponding to the polygonal area to be processed. The method can efficiently and reliably realize the automatic generation of structured quadrilateral meshes for complex or non-complex polygonal areas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and medium for automatically generating a structured quadrilateral grid. Background Art

[0002] Structured quadrilateral meshes are widely used in finite element analysis (FEA), computational fluid dynamics (CFD) and other fields. Their regular topological structure and good unit quality can improve the accuracy and efficiency of numerical simulation.

[0003] However, the current generation of structured quadrilateral meshes mainly relies on manual division and interaction, which not only increases the workload of users, but also affects the efficiency of mesh generation. Existing automated methods, such as mapping method and advancement method, have high requirements on the shape and topological structure of the region, and it is difficult to handle irregular and concave and convex regions. In addition, although some methods based on central axis subdivision and cross field can handle relatively complex regions, the algorithms are complex, the quality of the generated mesh is not ideal, and manual correction or re-division of local areas is still required.

[0004] In general, the existing structured quadrilateral mesh generation methods are not flexible enough to meet the needs of engineering practice to generate meshes of different densities in different parts of an area. Therefore, how to efficiently and reliably realize the automatic generation of structured quadrilateral meshes for complex or non-complex polygonal areas is an urgent problem to be solved. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for automatically generating structured quadrilateral meshes, which can effectively realize the automatic generation of structured quadrilateral meshes of polygonal areas of any complexity and improve the efficiency and reliability of automatic generation of structured quadrilateral meshes. The specific scheme is as follows:

[0006] In a first aspect, the present application provides a method for automatically generating a structured quadrilateral mesh, comprising:

[0007] Obtaining a target reinforcement learning model that is pre-trained based on preset artificial experience information, and dividing the current polygonal area to be processed into corresponding quadrilateral sub-areas based on the target reinforcement learning model to obtain a plurality of sub-areas;

[0008] Each of the sub-regions is used as a new polygonal region to be processed, and the process is repeated to divide the current polygonal region to be processed into corresponding quadrilateral sub-regions based on the target reinforcement learning model until a preset recursive division termination condition is met to obtain a corresponding plurality of target sub-regions;

[0009] Based on the transfinite interpolation method, a corresponding structured quadrilateral grid is generated in each of the target sub-areas to obtain a plurality of target structured quadrilateral grids;

[0010] The plurality of target structured quadrilateral grids are meshed and the assembled grids are optimized based on preset grid optimization rules to obtain a target grid corresponding to the polygonal region to be processed.

[0011] Optionally, before obtaining the target reinforcement learning model pre-trained based on preset artificial experience information, the method further includes:

[0012] Randomly generate polygonal region data with different regional features based on a preset polygon production algorithm to obtain a corresponding data set; wherein the regional features include the number of edges, shape, and complexity;

[0013] Dividing the data set to obtain corresponding training sets and validation sets;

[0014] By modeling the Markov decision process for the polygonal region partition problem, the corresponding state representation definition operation, action design operation and reward function definition operation are completed to obtain the corresponding target expression; wherein the target expression includes a target state expression, a target action expression and a target function expression;

[0015] In the process of performing reinforcement learning on the constructed initial model based on the flexible action-evaluation algorithm, the training set and the target expression, training guidance is performed based on preset artificial experience information until the corresponding model training operation is completed;

[0016] The validation set is used to determine the model parameters with the best performance during the model training process to obtain the target reinforcement learning model.

[0017] Optionally, the training guidance based on preset artificial experience information includes:

[0018] Generate corresponding internal point samples based on the centroid coordinates of the triangular area in the training set, and use the internal point samples as positive samples for training guidance;

[0019] By using a preset experience template to generate segmentation samples corresponding to the quadrilateral area in the training set, corresponding training guidance is performed; wherein the preset experience template includes an O-type grid experience template and a C-type grid experience template;

[0020] By using a preset partition template to generate segmentation samples corresponding to the pentagonal and hexagonal areas in the training set, corresponding training guidance is performed.

[0021] Optionally, the current polygonal area to be processed is divided into corresponding quadrilateral sub-areas based on the target reinforcement learning model to obtain a plurality of sub-areas, including:

[0022] Determine whether the number of edges of the polygonal area to be processed is greater than a preset edge number threshold, and obtain a corresponding determination result;

[0023] When the judgment result indicates that the number of edges is greater than the preset edge number threshold, the polygonal area to be processed is correspondingly simplified based on the preset polygonal simplification rule, and the corresponding target state representation information is determined using the simplified area obtained;

[0024] When the judgment result shows that the number of edges is not greater than the preset edge number threshold, the corresponding target state representation information is determined based on the polygonal area to be processed;

[0025] By inputting the target state representation information into the target reinforcement learning model, dividing the action generation, so as to obtain the mean information and variance information of the action distribution output by the target reinforcement learning model;

[0026] Performing action value sampling based on the mean information and the variance information, and using the obtained action values ​​to determine corresponding target segmentation point positions and target internal point coordinates;

[0027] A corresponding segmentation line is generated based on the target segmentation point position and the target internal point coordinates, and the polygonal area to be processed is divided into corresponding quadrilateral sub-areas according to the segmentation line to obtain a plurality of sub-areas.

[0028] Optionally, the performing corresponding polygon simplification on the polygonal area to be processed based on a preset polygon simplification rule includes:

[0029] Obtaining the target centroid coordinates corresponding to the polygonal area to be processed by calculation;

[0030] Obtaining angle information of angles between each edge of the polygonal area to be processed and the line connecting the target centroid coordinates;

[0031] The angle information is sorted, and a corresponding number of edges is determined according to the sorting result and a preset edge number threshold, so as to obtain a corresponding simplified region.

[0032] Optionally, the step of re-jumping to the step of dividing the current polygonal area to be processed into corresponding quadrilateral sub-areas based on the target reinforcement learning model until a preset recursive division termination condition is met to obtain corresponding multiple target sub-areas includes:

[0033] Re-jumping to the step of determining the corresponding target state representation information based on the to-be-processed polygonal area, until a preset recursive depth condition or a preset mesh quality condition is met, and the corresponding recursive partitioning operation is completed;

[0034] If a polygon simplification operation exists in the recursive partitioning operation, a corresponding original polygon mapping operation is performed to obtain a corresponding plurality of target sub-regions.

[0035] Optionally, the generating of a corresponding structured quadrilateral mesh in each of the target sub-regions based on the transfinite interpolation method to obtain a plurality of target structured quadrilateral meshes includes:

[0036] Generating a preset number of boundary nodes on the boundary of each of the target sub-areas;

[0037] Based on the transfinite interpolation formula and the coordinates of a corresponding preset number of boundary nodes, the coordinate information of the corresponding internal grid nodes of the target sub-region is interpolated and calculated to complete the structured quadrilateral grid generation operation corresponding to each target sub-region.

[0038] In a second aspect, the present application provides a structured quadrilateral mesh automatic generation device, comprising:

[0039] A region division module is used to obtain a target reinforcement learning model that is pre-trained based on preset artificial experience information, and to divide the current polygonal region to be processed into corresponding quadrilateral sub-regions based on the target reinforcement learning model to obtain multiple sub-regions;

[0040] A recursive partitioning module, used to respectively use each of the sub-regions as a new polygonal region to be processed, and to jump back to the step of performing corresponding quadrilateral sub-region partitioning on the current polygonal region to be processed based on the target reinforcement learning model, until a preset recursive partitioning termination condition is met, thereby obtaining a corresponding plurality of target sub-regions;

[0041] A structured grid generation module, used for performing corresponding structured quadrilateral grid generation in each of the target sub-regions based on a transfinite interpolation method to obtain a plurality of target structured quadrilateral grids;

[0042] The mesh assembly and optimization module is used to assemble the multiple target structured quadrilateral meshes and optimize the assembled meshes based on preset mesh optimization rules to obtain a target mesh corresponding to the polygonal area to be processed.

[0043] In a third aspect, the present application provides an electronic device, including:

[0044] Memory, used to store computer programs;

[0045] The processor is used to execute the computer program to implement the steps of the aforementioned structured quadrilateral mesh automatic generation method.

[0046] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the steps of the aforementioned method for automatically generating a structured quadrilateral mesh.

[0047] It can be seen that in the present application, a target reinforcement learning model pre-trained based on preset artificial experience information is obtained, and the current polygonal area to be processed is divided into corresponding quadrilateral sub-areas based on the target reinforcement learning model to obtain multiple sub-areas; each of the sub-areas is used as a new polygonal area to be processed, and the step of dividing the current polygonal area to be processed into corresponding quadrilateral sub-areas based on the target reinforcement learning model is jumped again until the preset recursive division termination condition is met to obtain the corresponding multiple target sub-areas; based on the transfinite interpolation method, a corresponding structured quadrilateral mesh is generated in each of the target sub-areas to obtain multiple target structured quadrilateral meshes; the multiple target structured quadrilateral meshes are meshed, and the assembled meshes are optimized based on the preset mesh optimization rules to obtain the target mesh corresponding to the polygonal area to be processed. That is, in the present application, the division strategy of the polygonal area is automatically learned in advance using reinforcement learning and preset artificial experience information, which can improve efficiency while avoiding the subjectivity and inefficiency of manual division. Then, the polygonal area to be processed is recursively divided through the trained target reinforcement learning model, which can adaptively control the density and distribution of the grid to meet the grid quality requirements of different areas. Afterwards, a mature interpolation algorithm is applied to each target sub-area obtained after the recursive division to generate a structured grid, ensuring the shape and quality of the grid unit. Finally, the target grid corresponding to the polygonal area to be processed is obtained by assembling and optimizing the grid. In this way, the present application can effectively realize the automatic generation of structured quadrilateral grids of polygonal areas of arbitrary complexity by designing a unified processing flow, and improve the efficiency and reliability of the automatic generation of structured quadrilateral grids. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0049] Figure 1 A flow chart of a method for automatically generating a structured quadrilateral mesh provided in this application;

[0050] Figure 2 A specific flow chart of a method for automatically generating a structured quadrilateral mesh provided in this application;

[0051] Figure 3 A schematic diagram of a specific process of performing region division based on a target reinforcement learning module provided in this application;

[0052] Figure 4 A schematic diagram of the structure of a structured quadrilateral mesh automatic generation device provided in this application;

[0053] Figure 5 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] The current generation of structured quadrilateral meshes mainly relies on manual division and interaction, which not only increases the workload of users, but also affects the efficiency of mesh generation. Existing automation methods, such as mapping method, advancement method, etc., have high requirements on the shape and topological structure of the region, and it is difficult to handle irregular and concave and convex areas. In addition, although some methods based on central axis subdivision and cross field can handle relatively complex areas, the algorithms are complex, the quality of the generated mesh is not ideal, and manual correction or re-division of local areas is still required. In general, the existing structured quadrilateral mesh generation methods are not flexible enough and it is difficult to meet the needs of generating meshes of different densities in different parts of the region that often exist in engineering practice. To this end, the present application provides a structured quadrilateral mesh automatic generation scheme, which can effectively realize the automatic generation of structured quadrilateral meshes of polygonal areas of arbitrary complexity, and improve the efficiency and reliability of the automatic generation of structured quadrilateral meshes.

[0056] See also Figure 1 As shown, an embodiment of the present invention discloses a method for automatically generating a structured quadrilateral mesh, comprising:

[0057] Step S11, obtaining a target reinforcement learning model that is pre-trained based on preset artificial experience information, and dividing the current polygonal area to be processed into corresponding quadrilateral sub-areas based on the target reinforcement learning model to obtain multiple sub-areas.

[0058] It should be understood that, in a specific embodiment, when the polygonal region division task for aircraft simulation is processed, the polygonal region to be processed at this time may be a polygon related to the aircraft surface or the surface of aircraft-related components, so as to perform design based on the quadrilateral mesh obtained by division and complete the simulation of the aircraft. In a specific embodiment, when the polygonal region division task for building simulation is processed, the polygonal region to be processed at this time may be a polygon related to the surface of building parts or the structure of the building, so as to complete the simulation of the building using the mesh obtained by division.

[0059] Specifically, in this embodiment, before performing region division and automatic generation of structured quadrilateral meshes, a pre-trained model is first obtained. Figure 2 As shown, that is, before obtaining the target reinforcement learning model pre-trained based on preset artificial experience information, it also includes: randomly generating polygonal area data with different area features based on a preset polygon production algorithm to obtain a corresponding data set; wherein the area features include the number of edges, shape, and complexity; dividing the data set to obtain a corresponding training set and a verification set; by modeling the polygonal area division problem using a Markov decision process (MDP), completing corresponding state representation definition operations, action design operations, and reward function definition operations to obtain a corresponding target expression; wherein the target expression includes a target state expression, a target action expression, and an objective function expression; in the process of reinforcement learning the constructed initial model based on a soft action-evaluation algorithm (Soft Actor-Critic, SAC), the training set, and the target expression, training guidance is performed based on preset artificial experience information until the corresponding model training operation is completed; and the verification set is used to determine the model parameters with the best performance in the model training process to obtain a target reinforcement learning model.

[0060] Specifically, polygons are randomly generated first to prepare data. In this embodiment, a large number of polygonal areas with different numbers of sides, shapes and complexities are randomly generated by designing and implementing a polygon generation algorithm:

[0061] a) Randomly select the number of sides n of the polygon in the range [3, n max ]. Among them, n max is the preset maximum number of edges (which can be set according to actual needs. In a preferred embodiment, n max The value can be 6, but is not limited to this. ).

[0062] b) Randomly generate n points within the unit circle as the vertices of the polygon, and determine the shape of the polygon by the position and order of the vertices.

[0063] c) Control the shape complexity of the generated polygon by adjusting the distribution characteristics of the vertex positions.

[0064] Afterwards, the obtained dataset is divided into corresponding training set, validation set and test set.

[0065] It should be understood that, regarding the MDP modeling process, in this embodiment, the polygonal region partitioning problem is modeled as a Markov decision process:

[0066] a) State space: It is defined as a 2n+2-dimensional continuous space, where n is the number of sides of the polygon. The state expression is as follows:

[0067] ;

[0068] In the formula, e i ∈[0, 1], represents the interpolation ratio on the i-th edge of the polygon; ξ, η∈[0, 1] are the normalized coordinates of the internal points of the polygon.

[0069] b) Action space: It is defined as a 2n+2 dimensional continuous space, where action a=(a1,...,a n , a ξ , a η ).

[0070] Among them, a i ∈[0, 1], determines the splitting position on the i-th edge of the polygon; a ξ , a η ∈[0, 1] determines the normalized coordinates of the interior points.

[0071] c) Reward function: evaluates the quality of the generated quadrilateral mesh, defined as the reward function. The quality of the generated quadrilateral mesh is evaluated, and the reward function is defined as:

[0072] ;

[0073] ;

[0074] ;

[0075] Among them, q edge is the edge length quality measure, q angle is the angular quality measure. j is the length of the jth edge of the element; D max is the length of the longest diagonal of the quadrilateral; angle j is the degree of the jth interior angle of the quadrilateral; min j∈{0,1,2,3} {angle j} represents the angle angle j The angle value with the smallest value; max j∈{0,1,2,3} {angle j} represents the angle angle j The angle value with the largest value; min j∈{0,1,2,3} {l j} represents the side length l j The side length with the smallest value.

[0076] In addition, regarding the process of training guidance based on preset artificial experience information, in this embodiment, it specifically includes: generating corresponding internal point samples based on the centroid coordinates of the triangular area in the training set, and using the internal point samples as positive samples for training guidance to guide the model to learn reasonable internal point positions. By using a preset experience template to generate segmentation samples corresponding to the quadrilateral area in the training set, corresponding training guidance is performed; wherein the preset experience template includes an O-type grid experience template and a C-type grid experience template; by using a preset partitioning template to generate segmentation samples corresponding to the pentagonal and hexagonal areas in the training set, corresponding training guidance is performed to guide the model to learn partitioning strategies for different shapes. At the same time, when calculating the reward function, additional penalties are given to the segmentation lines that violate the preset artificial experience information, prompting the model to converge toward the partitioning method of human experts. In this way, by optimizing the reward function, higher quality sub-region partitioning is achieved.

[0077] It is further necessary to understand that, in this embodiment, regarding the process of model training and evaluation, the reinforcement learning SAC algorithm is used to train the policy network (ie, the initial model), and the partitioning strategy is continuously optimized through interaction with the environment.

[0078] a) Initialize the policy network and Q-value network Q θ1 , Q θ2 .in , Q θ1 , Q θ2 are the parameters to be learned. At the same time, the hyperparameters of the SAC algorithm are initialized, including learning rate, batch size, etc.

[0079] b) Adopt the diagonal Gaussian strategy, model the strategy as an independent Gaussian distribution in each dimension, and learn the corresponding mean and variance parameters. Introduce the entropy regularization term, and ensure the stability of exploration and learning through maximum entropy reinforcement learning.

[0080] c) Specifically, in each training round, starting from the initial state, a partitioning action is generated using the policy network according to the current state representation determined using the previously defined formula. The generated partitioning action is applied to the polygonal area to obtain a new state representation and the corresponding reward (grid quality). The quadruple of (state, action, reward, next state) is stored in the experience replay buffer. A batch of quadruple is randomly sampled from the experience replay buffer to update the parameters of the policy network and the Q-value network. The above training steps are repeated until the maximum number of steps is reached or the termination condition is met.

[0081] d) During the training process, the policy network and Q-value network are updated in sequence to maximize the expected reward and policy entropy. When updating the policy network, the reparameterization technique is used to sample actions from the Gaussian policy and calculate the policy gradient for parameter update. When updating the Q-value network, TD (Temporal Difference) error and least squares method are used for fitting. At the same time, during this training process, the average reward of the model on the validation set is regularly evaluated. Based on the evaluation results, the model hyperparameters and training strategies are adjusted to improve the performance and generalization ability of the model.

[0082] e) After the final training is completed, the model parameters with the best performance on the validation set are selected as the final segmentation strategy network, that is, the target reinforcement learning model, for subsequent polygonal area segmentation tasks.

[0083] Combination Figure 2 As shown, it can be understood that in this embodiment, when processing the current polygonal area division task, it is necessary to first determine the number of edges to determine whether the number of edges n of the current polygonal area to be processed exceeds the maximum number of edges n that the strategy network can process. max If n>n max , you need to simplify the polygon and convert it into a processable n max polygon, and then obtain the corresponding state representation. If n≤n max , then directly obtain the corresponding state representation. Then divide based on the obtained state identification and the target reinforcement learning model.

[0084] Specifically, the polygon simplification based on the preset polygon simplification rule includes: obtaining the target barycenter coordinates corresponding to the polygon area to be processed by calculation, and taking the barycenter as a reference point. Obtaining the angle information of the angle between each side of the polygon area to be processed and the line connecting the target barycenter coordinates. Sorting the angle information, and selecting n angles with the smallest angle according to the sorting result and the preset edge number threshold. max edges, forming a new n max The polygon, that is, the simplified area.

[0085] Regarding the acquisition of the state representation, in this embodiment, the number of edges m and the initial edge segmentation ratio e of the polygonal area to be processed (when polygon simplification is not required) or the simplified area (when polygon simplification is required) are extracted. i , forming a state vector s=(e1,...,e m , ξ, η). The state vector is normalized to the interval [0, 1] to facilitate the processing of the target reinforcement learning model. Then, the state vector s is input into the target reinforcement learning model The mean and variance of the action distribution are obtained. The specific action value a=(a1,...,a m , a ξ , a η ). The position of the segmentation point on the polygon edge and the internal point coordinates are determined according to the action value to generate a complete segmentation line, and the segmentation line is used to perform corresponding quadrilateral sub-region division to obtain multiple sub-regions. In this way, this embodiment, through the steps of polygon simplification, state representation, strategy network division, recursive division, etc., coupled with the introduction of experience, enables the model to adapt to polygonal regions of various types and high complexity.

[0086] Step S12: take each of the sub-regions as the new polygonal region to be processed, and jump again to the step of dividing the current polygonal region to be processed into corresponding quadrilateral sub-regions based on the target reinforcement learning model, until the preset recursive division termination condition is met, and obtain the corresponding multiple target sub-regions.

[0087] It is important to understand that, combined with Figure 2As shown, in this embodiment, a recursive partitioning strategy is adopted, and each sub-region obtained by the partitioning is used as a new polygonal region to be processed to perform the region partitioning step described in step S11. That is, the step of re-jumping to the step of performing corresponding quadrilateral sub-region partitioning on the current polygonal region to be processed based on the target reinforcement learning model until the preset recursive partitioning termination condition is met to obtain the corresponding multiple target sub-regions includes: re-jumping to the step of determining the corresponding target state representation information based on the polygonal region to be processed until the preset recursive depth condition or the preset grid quality condition is met, and the corresponding recursive partitioning operation is completed; if there is a polygon simplification operation in the recursive partitioning operation, the corresponding original polygon mapping operation is performed to obtain the corresponding multiple target sub-regions.

[0088] Furthermore, the preset recursive depth condition, that is, whether the number of recursions has reached a preset maximum value, is used to control the granularity of the division. As for the preset grid quality condition, since the region can use the Transfinite Interpolation (TFI) method to determine the corresponding quadrilateral structure grid quality, then it is determined whether the region is not less than the corresponding quality threshold to determine whether the preset grid quality condition is met. When either of these two conditions is met, all generated quadrilateral sub-regions are merged to obtain a complete division result, that is, multiple target sub-regions. If polygon simplification is performed before the first region division, the division result of the simplified polygon is mapped back to the original polygon, and then all quadrilateral sub-regions are merged to obtain the complete division result of the original polygon.

[0089] Step S13: generating a corresponding structured quadrilateral mesh in each of the target sub-regions based on the transfinite interpolation method to obtain a plurality of target structured quadrilateral meshes.

[0090] Specifically, in this embodiment, for each target sub-region, a structured grid is generated using the TFI method. That is, the corresponding structured quadrilateral grid generation is performed in each target sub-region based on the transfinite interpolation method to obtain multiple target structured quadrilateral grids, including: generating a preset number of boundary nodes on the boundary of each target sub-region; interpolating and calculating the coordinate information of the corresponding internal grid nodes of the target sub-region based on the transfinite interpolation formula and the corresponding preset number of boundary nodes, so as to complete the structured quadrilateral grid generation operation corresponding to each target sub-region.

[0091] Step S14: assemble the multiple target structured quadrilateral meshes, and optimize the assembled meshes based on preset mesh optimization rules to obtain a target mesh corresponding to the polygonal area to be processed.

[0092] In this embodiment, it is understandable that after the target structured quadrilateral network is generated, some optimization operations are performed before outputting the result in order to ensure the quality of the mesh. Specifically:

[0093] a) The target structured quadrilateral meshes of adjacent target sub-regions are spliced ​​to ensure the continuity of the meshes on the sub-region boundaries.

[0094] b) Perform local optimization and smoothing on the assembled mesh to eliminate possible deformed units and unreasonable transitions.

[0095] c) Use mesh quality metrics such as unit size and angle to evaluate the quality of the assembled mesh. If it is not satisfied, continue recursive partitioning.

[0096] In summary, in this embodiment, an adaptive polygonal region partitioning method based on reinforcement learning is provided. By randomly generating a large amount of polygonal data with different features and combining a small amount of expert partitioning suggestions, a model that can autonomously explore and optimize the partitioning strategy is trained. At the same time, a polygonal partitioning strategy combining recursive partitioning with local grid generation is also provided. By recursively dividing complex polygons into simple quadrilateral sub-regions and then generating structured grids for each sub-region, high-quality partitioning of any complex polygonal region is achieved. That is, in this embodiment, the overall framework and workflow of the adaptive polygonal region partitioning method based on reinforcement learning, that is, the system integration and collaborative optimization mechanism including data preparation, state representation design, action design, reward function design, model training, partitioning strategy, grid generation and other links, automatically generates structured quadrilateral grids.

[0097] It can be seen that in the embodiment of the present application, a target reinforcement learning model pre-trained based on preset artificial experience information is obtained, and the current polygonal area to be processed is divided into corresponding quadrilateral sub-areas based on the target reinforcement learning model to obtain multiple sub-areas; each of the sub-areas is used as a new polygonal area to be processed, and the step of dividing the current polygonal area to be processed into corresponding quadrilateral sub-areas based on the target reinforcement learning model is jumped again until the preset recursive division termination condition is met, and the corresponding multiple target sub-areas are obtained; based on the transfinite interpolation method, a corresponding structured quadrilateral mesh is generated in each of the target sub-areas to obtain multiple target structured quadrilateral meshes; the multiple target structured quadrilateral meshes are meshed, and the assembled meshes are optimized based on the preset mesh optimization rules to obtain the target mesh corresponding to the polygonal area to be processed. That is, in the present application, the division strategy of the polygonal area is automatically learned in advance using reinforcement learning and preset artificial experience information, which can improve efficiency while avoiding the subjectivity and inefficiency of manual division. Then, the polygonal area to be processed is recursively divided through the trained target reinforcement learning model, which can adaptively control the density and distribution of the grid to meet the grid quality requirements of different areas. Afterwards, a mature interpolation algorithm is applied to each target sub-area obtained after the recursive division to generate a structured grid, ensuring the shape and quality of the grid unit. Finally, the target grid corresponding to the polygonal area to be processed is obtained by assembling and optimizing the grid. In this way, the present application can effectively realize the automatic generation of structured quadrilateral grids of polygonal areas of arbitrary complexity by designing a unified processing flow, and improve the efficiency and reliability of the automatic generation of structured quadrilateral grids.

[0098] As can be seen from the previous embodiment, the present application automatically completes the sub-region division of the polygonal area to be processed based on the trained target reinforcement learning model. To this end, the present embodiment will describe in detail the process of completing the sub-region division based on the target reinforcement learning model. Figure 3 As shown, an embodiment of the present invention discloses a method for automatically generating a structured quadrilateral mesh, comprising:

[0099] Step S21, determine whether the number of edges of the polygonal area to be processed is greater than a preset edge number threshold, and obtain a corresponding determination result.

[0100] Step S22: When the judgment result indicates that the edge number is greater than the preset edge number threshold, the polygonal area to be processed is correspondingly simplified based on the preset polygonal simplification rule, and the corresponding target state representation information is determined using the simplified area.

[0101] Step S23: When the judgment result indicates that the edge number is not greater than the preset edge number threshold, the corresponding target state representation information is determined based on the polygonal area to be processed.

[0102] Step S24: input the target state representation information into the target reinforcement learning model to generate divided actions, so as to obtain mean information and variance information of the action distribution output by the target reinforcement learning model.

[0103] Step S25: performing action value sampling based on the mean information and the variance information, and using the obtained action values ​​to determine corresponding target segmentation point positions and target internal point coordinates.

[0104] Step S26: Generate a corresponding segmentation line based on the target segmentation point position and the target internal point coordinates, and divide the to-be-processed polygonal area into corresponding quadrilateral sub-areas according to the segmentation line to obtain a plurality of sub-areas.

[0105] Among them, the specific process of the above steps S21 to S26 can refer to the corresponding content disclosed in the above embodiments, and will not be repeated here.

[0106] It can be seen that in the embodiment of the present application, an adaptive polygonal area division method based on reinforcement learning is provided, which uses a target reinforcement learning model that is trained with preset artificial experience information and can autonomously explore and optimize the division strategy to automatically perform edge number judgment, simplification, state representation information acquisition, and division, thereby getting rid of dependence on artificial experience, reducing manual intervention, and improving the degree of automation.

[0107] See also Figure 4 As shown, the embodiment of the present application also discloses a structured quadrilateral mesh automatic generation device, including:

[0108] The region division module 11 is used to obtain a target reinforcement learning model that is pre-trained based on preset artificial experience information, and to divide the current polygonal region to be processed into corresponding quadrilateral sub-regions based on the target reinforcement learning model to obtain multiple sub-regions;

[0109] A recursive partitioning module 12 is used to respectively use each of the sub-regions as a new polygonal region to be processed, and to jump back to the step of performing corresponding quadrilateral sub-region partitioning on the current polygonal region to be processed based on the target reinforcement learning model, until a preset recursive partitioning termination condition is met, thereby obtaining a corresponding plurality of target sub-regions;

[0110] The structured grid generation module 13 is used to generate a corresponding structured quadrilateral grid in each of the target sub-regions based on the transfinite interpolation method to obtain a plurality of target structured quadrilateral grids;

[0111] The mesh assembly and optimization module 14 is used to assemble the multiple target structured quadrilateral meshes and optimize the assembled meshes based on preset mesh optimization rules to obtain a target mesh corresponding to the polygonal area to be processed.

[0112] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0113] It can be seen that in this application, the division strategy of polygonal areas is automatically learned in advance by using reinforcement learning and preset artificial experience information, which can improve efficiency while avoiding the subjectivity and inefficiency of manual division. Then, the polygonal area to be processed is recursively divided through the trained target reinforcement learning model, and the density and distribution of the grid can be adaptively controlled to meet the grid quality requirements of different areas. Afterwards, a mature interpolation algorithm is applied to each target sub-area obtained after the recursive division to generate a structured grid, which ensures the shape and quality of the grid unit. Finally, the target grid corresponding to the polygonal area to be processed is obtained by assembling and optimizing the grid. In this way, the present application can effectively realize the automatic generation of structured quadrilateral grids of polygonal areas of arbitrary complexity by designing a unified processing flow, and improve the efficiency and reliability of the automatic generation of structured quadrilateral grids.

[0114] In some specific embodiments, the structured quadrilateral mesh automatic generation device may further include:

[0115] A data set acquisition unit, used to randomly generate polygonal region data with different region characteristics based on a preset polygon production algorithm to obtain a corresponding data set; wherein the region characteristics include the number of edges, shape, and complexity;

[0116] A data set division unit, used for dividing the data set to obtain corresponding training sets and verification sets;

[0117] A Markov decision process modeling unit is used to perform Markov decision process modeling on the polygonal region partition problem, complete corresponding state representation definition operations, action design operations, and reward function definition operations, so as to obtain a corresponding target expression; wherein the target expression includes a target state expression, a target action expression, and a target function expression;

[0118] A training guidance unit, used to provide training guidance based on preset artificial experience information in the process of reinforcement learning of the constructed initial model based on the flexible action-evaluation algorithm, the training set and the target expression, until the corresponding model training operation is completed;

[0119] The target model determination unit is used to use the verification set to determine the model parameters with the best performance in the model training process to obtain the target reinforcement learning model.

[0120] In some specific embodiments, the training guidance unit may specifically include:

[0121] A first training guidance subunit, configured to generate corresponding internal point samples based on the centroid coordinates of the triangular area in the training set, and use the internal point samples as positive samples for training guidance;

[0122] A second training guidance subunit is used to generate segmentation samples corresponding to the quadrilateral area in the training set by using a preset experience template to perform corresponding training guidance; wherein the preset experience template includes an O-type grid experience template and a C-type grid experience template;

[0123] The third training guidance subunit is used to generate segmentation samples corresponding to the pentagonal and hexagonal areas in the training set by using a preset division template, and perform corresponding training guidance.

[0124] In some specific embodiments, the area division module 11 may specifically include:

[0125] A variable determination unit is used to determine whether the number of edges of the polygonal area to be processed is greater than a preset edge number threshold, and obtain a corresponding determination result;

[0126] A first target state representation information acquisition unit is used to perform corresponding polygon simplification on the polygon area to be processed based on a preset polygon simplification rule when the judgment result indicates that the number of edges is greater than the preset edge number threshold, and determine corresponding target state representation information using the simplified area obtained;

[0127] A second target state representation information acquisition unit is used to determine the corresponding target state representation information based on the polygonal area to be processed when the judgment result shows that the number of edges is not greater than the preset edge number threshold;

[0128] An information acquisition unit, configured to generate divided actions by inputting the target state representation information into the target reinforcement learning model, so as to obtain mean information and variance information of the action distribution output by the target reinforcement learning model;

[0129] An action value sampling unit, used for sampling action values ​​based on the mean information and the variance information, and determining corresponding target segmentation point positions and target internal point coordinates using the obtained action values;

[0130] The quadrilateral sub-region division unit is used to generate corresponding segmentation lines based on the target segmentation point position and the target internal point coordinates, and perform corresponding quadrilateral sub-region division on the polygonal region to be processed according to the segmentation lines to obtain multiple sub-regions.

[0131] In some specific embodiments, the first target state representation information acquisition unit may specifically include:

[0132] A center coordinate acquisition subunit, used for acquiring the target center of gravity coordinates corresponding to the polygonal area to be processed by calculation;

[0133] An angle acquisition subunit, used to obtain angle information of angles between each edge of the polygonal area to be processed and the line connecting the target centroid coordinates;

[0134] The sorting subunit is used to sort the angle information and determine the corresponding number of edges according to the sorting result and a preset edge number threshold to obtain the corresponding simplified area.

[0135] In some specific embodiments, the recursive partitioning module 12 may specifically include:

[0136] A step jump unit, used to jump back to the step of determining the corresponding target state representation information based on the to-be-processed polygonal area, until a preset recursive depth condition or a preset mesh quality condition is met, and the corresponding recursive partitioning operation is completed;

[0137] The polygon mapping unit is used to perform a corresponding original polygon mapping operation if a polygon simplification operation exists in the recursive partitioning operation, so as to obtain a corresponding plurality of target sub-regions.

[0138] In some specific embodiments, the structured grid generation module 13 may specifically include:

[0139] A boundary node generating unit, configured to generate a preset number of boundary nodes on the boundary of each target sub-region;

[0140] The structured quadrilateral mesh generation unit is used to interpolate and calculate the coordinate information of the corresponding internal mesh nodes of the target sub-region based on the transfinite interpolation formula and the coordinates of a corresponding preset number of boundary nodes, so as to complete the structured quadrilateral mesh generation operation corresponding to each target sub-region.

[0141] Furthermore, the present application also discloses an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0142] Figure 5 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the method for automatically generating a structured quadrilateral mesh disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0143] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0144] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0145] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and may be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the structured quadrilateral mesh automatic generation method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks.

[0146] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed structured quadrilateral mesh automatic generation method is implemented. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, and no further description will be given here.

[0147] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0148] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0149] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0150] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0151] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for automatically generating a structured quadrilateral mesh, characterized in that: include: Obtaining a target reinforcement learning model that is pre-trained based on preset artificial experience information, and dividing the current polygonal area to be processed into corresponding quadrilateral sub-areas based on the target reinforcement learning model to obtain a plurality of sub-areas; Each of the sub-regions is used as a new polygonal region to be processed, and the process is repeated to divide the current polygonal region to be processed into corresponding quadrilateral sub-regions based on the target reinforcement learning model until a preset recursive division termination condition is met to obtain a corresponding plurality of target sub-regions; Based on the transfinite interpolation method, a corresponding structured quadrilateral grid is generated in each of the target sub-areas to obtain a plurality of target structured quadrilateral grids; assembling the plurality of target structured quadrilateral grids, and optimizing the assembled grids based on a preset grid optimization rule to obtain a target grid corresponding to the polygonal region to be processed; Wherein, the current polygonal area to be processed is divided into corresponding quadrilateral sub-areas based on the target reinforcement learning model to obtain multiple sub-areas, including: Determine whether the number of edges of the polygonal area to be processed is greater than a preset edge number threshold, and obtain a corresponding determination result; When the judgment result indicates that the number of edges is greater than the preset edge number threshold, the polygonal area to be processed is correspondingly simplified based on the preset polygonal simplification rule, and the corresponding target state representation information is determined using the simplified area obtained; When the judgment result shows that the number of edges is not greater than the preset edge number threshold, the corresponding target state representation information is determined based on the polygonal area to be processed; By inputting the target state representation information into the target reinforcement learning model, dividing the action generation, so as to obtain the mean information and variance information of the action distribution output by the target reinforcement learning model; Performing action value sampling based on the mean information and the variance information, and using the obtained action values ​​to determine corresponding target segmentation point positions and target internal point coordinates; Generate a corresponding segmentation line based on the target segmentation point position and the target internal point coordinates, and divide the to-be-processed polygonal area into corresponding quadrilateral sub-areas according to the segmentation line to obtain a plurality of sub-areas; The generating of corresponding structured quadrilateral meshes in each of the target sub-regions based on the transfinite interpolation method to obtain a plurality of target structured quadrilateral meshes includes: Generating a preset number of boundary nodes on the boundary of each of the target sub-areas; Based on the transfinite interpolation formula and the coordinates of a corresponding preset number of boundary nodes, the coordinate information of the corresponding internal grid nodes of the target sub-region is interpolated and calculated to complete the structured quadrilateral grid generation operation corresponding to each target sub-region.

2. The method for automatically generating structured quadrilateral meshes according to claim 1, characterized in that: Before obtaining the target reinforcement learning model pre-trained based on preset artificial experience information, the method further includes: Randomly generate polygonal region data with different regional features based on a preset polygon production algorithm to obtain a corresponding data set; wherein the regional features include the number of edges, shape, and complexity; Dividing the data set to obtain corresponding training sets and validation sets; By modeling the Markov decision process for the polygonal region partition problem, the corresponding state representation definition operation, action design operation and reward function definition operation are completed to obtain the corresponding target expression; wherein the target expression includes a target state expression, a target action expression and a target function expression; In the process of performing reinforcement learning on the constructed initial model based on the flexible action-evaluation algorithm, the training set and the target expression, training guidance is performed based on preset artificial experience information until the corresponding model training operation is completed; The validation set is used to determine the model parameters with the best performance during the model training process to obtain the target reinforcement learning model.

3. The method for automatically generating structured quadrilateral meshes according to claim 2, characterized in that: The training guidance based on preset artificial experience information includes: Generate corresponding internal point samples based on the centroid coordinates of the triangular area in the training set, and use the internal point samples as positive samples for training guidance; By using a preset experience template to generate segmentation samples corresponding to the quadrilateral area in the training set, corresponding training guidance is performed; wherein the preset experience template includes an O-type grid experience template and a C-type grid experience template; By using a preset partition template to generate segmentation samples corresponding to the pentagonal and hexagonal areas in the training set, corresponding training guidance is performed.

4. The method for automatically generating structured quadrilateral meshes according to claim 1, characterized in that: The corresponding polygon simplification of the to-be-processed polygon area based on the preset polygon simplification rule includes: Obtaining the target centroid coordinates corresponding to the polygonal area to be processed by calculation; Obtaining angle information of angles between each edge of the polygonal area to be processed and the line connecting the target centroid coordinates; The angle information is sorted, and a corresponding number of edges is determined according to the sorting result and a preset edge number threshold, so as to obtain a corresponding simplified region.

5. The method for automatically generating structured quadrilateral meshes according to claim 1, characterized in that: The step of re-jumping to the step of dividing the current polygonal area to be processed into corresponding quadrilateral sub-areas based on the target reinforcement learning model until a preset recursive division termination condition is met to obtain corresponding multiple target sub-areas includes: Re-jumping to the step of determining the corresponding target state representation information based on the to-be-processed polygonal area, until a preset recursive depth condition or a preset mesh quality condition is met, and the corresponding recursive partitioning operation is completed; If a polygon simplification operation exists in the recursive partitioning operation, a corresponding original polygon mapping operation is performed to obtain a corresponding plurality of target sub-regions.

6. A structured quadrilateral mesh automatic generation device, characterized in that: include: A region division module is used to obtain a target reinforcement learning model that is pre-trained based on preset artificial experience information, and to divide the current polygonal region to be processed into corresponding quadrilateral sub-regions based on the target reinforcement learning model to obtain multiple sub-regions; A recursive partitioning module, used to respectively use each of the sub-regions as a new polygonal region to be processed, and to jump back to the step of performing corresponding quadrilateral sub-region partitioning on the current polygonal region to be processed based on the target reinforcement learning model, until a preset recursive partitioning termination condition is met, thereby obtaining a corresponding plurality of target sub-regions; A structured grid generation module, used for performing corresponding structured quadrilateral grid generation in each of the target sub-regions based on a transfinite interpolation method to obtain a plurality of target structured quadrilateral grids; A mesh assembly and optimization module, used for mesh assembly of the plurality of target structured quadrilateral meshes, and optimizing the obtained assembled meshes based on a preset mesh optimization rule to obtain a target mesh corresponding to the polygonal region to be processed; Wherein, the area division module includes: A variable determination unit is used to determine whether the number of edges of the polygonal area to be processed is greater than a preset edge number threshold, and obtain a corresponding determination result; A first target state representation information acquisition unit is used to perform corresponding polygon simplification on the polygon area to be processed based on a preset polygon simplification rule when the judgment result indicates that the number of edges is greater than the preset edge number threshold, and determine corresponding target state representation information using the simplified area obtained; A second target state representation information acquisition unit is used to determine the corresponding target state representation information based on the polygonal area to be processed when the judgment result shows that the number of edges is not greater than the preset edge number threshold; An information acquisition unit, configured to generate divided actions by inputting the target state representation information into the target reinforcement learning model, so as to obtain mean information and variance information of the action distribution output by the target reinforcement learning model; An action value sampling unit, used for sampling action values ​​based on the mean information and the variance information, and determining corresponding target segmentation point positions and target internal point coordinates using the obtained action values; A quadrilateral sub-region division unit, used for generating corresponding segmentation lines based on the target segmentation point position and the target internal point coordinates, and performing corresponding quadrilateral sub-region division on the to-be-processed polygonal region according to the segmentation lines to obtain a plurality of sub-regions; The structured grid generation module comprises: A boundary node generating unit, configured to generate a preset number of boundary nodes on the boundary of each target sub-region; The structured quadrilateral mesh generation unit is used to interpolate and calculate the coordinate information of the corresponding internal mesh nodes of the target sub-region based on the transfinite interpolation formula and the coordinates of a corresponding preset number of boundary nodes, so as to complete the structured quadrilateral mesh generation operation corresponding to each target sub-region.

7. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the method for automatically generating a structured quadrilateral mesh according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the method for automatically generating a structured quadrilateral mesh as described in any one of claims 1 to 5.