Adaptive grid generation method and system based on reinforcement learning

By employing an adaptive mesh generation method based on reinforcement learning, utilizing information transfer neural networks and supervised training networks, and combining curvature and proximity feature analysis, this method addresses the problems of existing technologies where mesh generation relies on manual intervention and deep learning ignores scale control. It achieves high-quality adaptive mesh generation, thereby improving the accuracy and efficiency of numerical simulation.

CN121389802APending Publication Date: 2026-01-23BEIJING TECH & BUSINESS UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511694302.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-18
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Existing technologies rely heavily on manual intervention in the mesh generation process and cannot automatically adjust the mesh density. Furthermore, deep learning methods ignore scale control, resulting in low-quality generated meshes that fail to meet the accuracy and stability requirements of numerical simulations.

Method used

An adaptive mesh generation method based on reinforcement learning is adopted. The size field of the model is predicted by the information transmission neural network, and adaptive meshes are generated by combining supervised training network and reinforcement learning. The analysis includes curvature features and proximity features. The front advancement method is used for training to ensure topological correctness and mesh quality.

Benefits of technology

This achieves an enhanced level of intelligence in adaptive mesh generation, ensuring the correctness and quality of the generated mesh topology, reducing the waste of computational resources, and improving the accuracy and efficiency of numerical simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121389802A_ABST
    Figure CN121389802A_ABST
Patent Text Reader

Abstract

The invention provides an adaptive grid generation method and system based on reinforcement learning, and belongs to the field of computer graphics and computational geometry, and the method comprises the steps: S1, according to the input of a known model, constructing a background grid, calculating the curvature characteristics and proximity characteristics of the known model, and generating a corresponding size field; s2, inputting a to-be-predicted unknown model into the information transfer neural network, and predicting to obtain a discrete size field of the unknown model; carrying out interpolation processing on the discrete size field to obtain a continuous size field of the unknown model; and S3, according to the continuous size field and the known model, introducing reinforcement learning, using a leading-edge propulsion method to generate an adaptive grid as a training data set for training the supervised training network, and generating an adaptive grid of an unknown model through the leading-edge propulsion method. On the premise of ensuring the rationality and geometric quality of the grid topological structure, the method remarkably improves the grid precision and overall generalization ability of the key area, and has a wide application prospect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer graphics and computational geometry, and specifically relates to an adaptive mesh generation method and system based on reinforcement learning. Background Technology

[0002] With the continuous advancement of computer equipment and computational algorithms, numerical simulation plays an increasingly important role in various fields. Through numerical simulation, relatively accurate scientific predictions can be made for a large number of theoretical and experimental data efficiently and at low cost. Mesh generation is the process of discretizing a continuous physical space into a finite number of sub-regions, thereby enabling the discrete solution of continuous governing equations. Therefore, mesh generation is the most critical step in numerical simulation, and the fineness of the mesh directly affects the computational efficiency and accuracy of the analysis results.

[0003] In existing technologies, a mainstream approach relies on explicit geometric modeling and mathematical rules to delineate the computational domain, such as Delaunay triangulation and the advancing front method, using basic geometric information to decompose complex regions into regular or irregular mesh elements according to fixed algorithmic strategies. However, this approach is highly dependent on manual intervention, especially when dealing with complex geometries or multi-physics coupled problems. Users need to manually specify key parameters such as geometric boundaries, feature points, and locally refined regions, and often need to manually check and repair low-quality elements such as distorted elements, overlapping elements, or isolated nodes to meet the accuracy and stability requirements of subsequent numerical simulations. Furthermore, traditional methods generally lack the ability to perceive the characteristics of physical fields.

[0004] Another approach attempts to introduce deep learning into the mesh generation process, constructing an intelligent mesh generation system with "experience-based learning" capabilities. These methods typically use neural network models to learn geometric structures and size distribution patterns from historical expert meshes, thereby predicting local mesh sizes and topologies in new geometric scenarios. However, most current models simplify the mesh generation process to an end-to-end prediction from geometry to topology, neglecting the introduction of the crucial intermediate physical quantity of the size field. This results in a lack of clear scale control for the generated mesh, an inability to automatically adjust mesh density based on the model's geometric characteristics, and an over-allocation of computational resources to non-critical areas, while insufficient resolution is achieved in truly important regions. Furthermore, the fitting results prioritize "formal similarity," emphasizing visual similarity to expert meshes. However, this learning strategy often neglects strict control over mesh quality and topological correctness. This leads to generated meshes that may contain topological errors, fail to meet physical boundary conditions, and exhibit excessive discrepancies between numerical simulation and experimental results, rendering them ineffective for prediction. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention provides an adaptive mesh generation method based on reinforcement learning, comprising the following steps:

[0006] Step S1: Based on the input known model, construct a background mesh, calculate the curvature and proximity features of the known model, and generate the corresponding size field;

[0007] Step S2: Input the unknown model to be predicted into the neural network to predict the discrete size field of the unknown model; and perform interpolation on the discrete size field to obtain the continuous size field of the unknown model.

[0008] Step S3: Based on the continuous size field and the known model, reinforcement learning is introduced, and an adaptive mesh is generated using the front-edge push method as a training dataset for training a supervised training network. The supervised training network includes two classification networks and two regression networks. The four networks jointly learn to generate an adaptive mesh for an unknown model using the front-edge push method.

[0009] Beneficial effects:

[0010] 1. This invention provides an adaptive mesh generation method based on reinforcement learning, which designs an information transmission network for predicting the size field of the model and for displaying the size of the guiding mesh elements, thereby improving the intelligence level of adaptive mesh generation.

[0011] 2. This invention designs a supervised training network, which uses supervised learning to fit the steps of the frontier array method for mesh generation, ensuring the topological correctness of the generated mesh.

[0012] 3. This invention introduces a reinforcement learning framework, which uses an exploration and trial-and-error strategy to enable the agent to discover grid partitioning results of higher quality than those of expert grids. Attached Figure Description

[0013] Figure 1 This is a schematic diagram of the process of an adaptive mesh generation method based on reinforcement learning according to the present invention;

[0014] Figure 2 A schematic diagram illustrating the prediction performance of an information transmission neural network;

[0015] Figure 3 This is a schematic diagram of a supervised training network architecture based on reinforcement learning.

[0016] Figure 4 This is a flowchart illustrating the adaptive mesh generation method based on reinforcement learning.

[0017] Figure 5 This is a schematic diagram of the adaptive mesh generation result of the present invention;

[0018] Figure 6 This is a block diagram of an adaptive mesh generation system based on reinforcement learning according to the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0020] Example 1

[0021] like Figure 1 As shown in the figure, an adaptive mesh generation method based on reinforcement learning provided by an embodiment of the present invention includes the following steps:

[0022] Step S1: Based on the input known model, construct a background mesh, calculate the curvature and proximity features of the known model, and generate the corresponding size field;

[0023] Step S2: Input the unknown model to be predicted into the neural network to predict the discrete size field of the unknown model; and perform interpolation on the discrete size field to obtain the continuous size field of the unknown model.

[0024] Step S3: Based on the continuous size field and the known model, reinforcement learning is introduced, and an adaptive mesh is generated using the front-edge push method as a training dataset for training the supervised training network. The supervised training network includes two classification networks and two regression networks. The four networks jointly learn to generate an adaptive mesh for the unknown model using the front-edge push method.

[0025] In one embodiment, step S1 above—constructing a background mesh based on the input known model, calculating the curvature and proximity features of the known model, and generating the corresponding size field—specifically includes:

[0026] Step S11: Input Model Construct the bounding box of its corresponding geometric model, calculate the maximum and minimum coordinates of the geometric boundary, and expand it to form a bounding box slightly larger than the model. spatial region Based on the preset global dimensions ,Will The grid is divided into a structured, regular mesh, forming a background mesh composed of equally spaced nodes, and an initial size value is assigned to each node. ;

[0027] The background mesh generated in this step is not used directly for calculation, but rather serves as a carrier of size field information;

[0028] In numerical computation, regions of high curvature and fine features in a model often represent areas of high gradient values. Mesh sizes in these regions require smaller element sizes to ensure computational accuracy; otherwise, excessive errors or gradient explosion may occur, rendering the results unusable. Therefore, this invention designs a size field calculation method based on geometric features, which automatically allocates smaller target element sizes in regions of high curvature or fine structure.

[0029] Step S12: For curvature features: Calculation model On the parametric surface, let the principal curvatures be such that the radius of curvature corresponding to the maximum principal curvature is denoted as . Then the size value of that point Defined as;

[0030] (1)

[0031] in, The curvature control parameter limits the target size value along the curve boundary. The radius of curvature corresponding to the maximum principal curvature , and This indicates the maximum and minimum curvature of the surface at that point in two orthogonal directions. If a point belongs to multiple surfaces, the radius corresponding to the maximum absolute principal curvature is used.

[0032] For proximity features, point proximity and curve proximity are calculated to quantify fine structures, specifically the size value at that point. Defined as:

[0033] (2)

[0034] (3)

[0035] Formula (2) represents updating the dimension value using curve proximity. , The nearest neighbor distance of an edge is estimated based on the median method; As a proximity distance control parameter, the expected size value is limited to the proximity distance; Formula (3) is used to calculate the point proximity. The value of the shortest side connecting this point;

[0036] All dimension values ​​are calculated based on the curvature and proximity characteristics at that point. For general nodes, the dimension values ​​are... The size field of the model is obtained by traversing and calculating all nodes;

[0037] Since the size field calculated in step S12 may contain narrow slit structures or thin voids, if these areas are covered by the background mesh, it will result in low-quality mesh cells, which will seriously affect the accuracy of numerical calculation. Therefore, it is necessary to re-mesh the background mesh in this area.

[0038] Step S13: Detect whether there are narrow slit structures or thin-layer voids in the dimensional field. The steps are as follows:

[0039] First, the ray casting method is used to calculate close-range face-to-face interactions. For each triangular element in the background mesh, two rays are emitted, with directions either the same as or opposite to the normal direction. The ray form is as follows:

[0040] (4)

[0041] in, The center of the triangular element, For unit normal vector, Used for directional control. The ray step size is defined by the maximum and minimum lengths.

[0042] If the ray hits another surface within the defined detection range, it indicates the presence of a slit structure at that location, and a smaller size value is defined. Continue testing until no narrow slit structures or thin-layer voids exist in the size field, thus obtaining the initial size function. ;

[0043] The initial size function obtained in step S13 Although the size can be adaptively reduced at specific geometric features, some adjacent regions may have excessive differences in mesh size and gradient of the size function, which can lead to a decrease in mesh quality or even distortion. Therefore, it is necessary to smooth the size function and limit its gradient.

[0044] Step S14: Apply the initial size function Smoothing is performed to limit its gradient:

[0045] Adjust the size of the elements on each node The value is obtained by iterating through all line segments in the background mesh, and considering the two endpoints of each edge. and Determine whether the following conditions are met: , For custom gradient control parameters, if the threshold is exceeded, the corresponding size value will be adjusted. Continue until all nodes meet the conditions to generate the final size field. .

[0046] To achieve accurate characterization of multi-scale geometric structures in the model, this invention constructs a size function with geometric adaptability in the background mesh. To address potential high-curvature regions and proximity features within the known model, curvature-aware and geometric proximity analysis mechanisms are introduced. In curvature feature processing, the principal curvature of the model is calculated, the corresponding radius of curvature is estimated, and local minimum size values ​​are generated by combining control parameters. In proximity feature processing, based on the geometric relationships between points, edges, and faces, potential narrow slit structures around nodes are identified, and the target size of this region is compressed using a distance control function. To ensure the continuity and smoothness of the size function in space, gradient constraint rules are introduced to perform global smoothing of the size function, thereby improving the quality of the size field in subsequent applications.

[0047] The size field of a large number of known models obtained in step S1 The training dataset is used to train an information delivery network that can predict the size field of an unknown model, guiding the size of grid elements in a specific region.

[0048] In one embodiment, step S2 above, which involves inputting the unknown model to be predicted into a neural network to predict the discrete size field of the unknown model, and then interpolating the discrete size field to obtain the continuous size field of the unknown model, specifically includes:

[0049] Step S21: For the unknown model to be predicted Using the same method as step S11, a background mesh is generated to obtain a mesh file. ;

[0050] Step S22: Input information is passed to a neural network to obtain predictions. Discrete size field;

[0051] Among them, the information transmission neural network is constructed based on the graph neural network. First, the information transmission neural network is constructed based on the graph neural network. Using graph structures Represents a set of nodes. For the set of vertices and edges of the grid The edges of the mesh are bidirectionally connected; each vertex and edge has unique characteristics, including vertex characteristics. and the characteristics of its neighboring nodes Includes geometric location, whether it is a singular point, and edge features. Includes side length, direction, and number of connecting points.

[0052] Use information-passing neural networks to continuously update information in the graph structure:

[0053] For each edge Update the eigenvectors of the edges:

[0054] (5)

[0055] in, It is a multilayer perceptron used to learn the transformations of information at the edges. Representing edge features, and These represent the node features and the features of its neighboring nodes, respectively. Indicates the current floor number;

[0056] For each node It aggregates information from its neighbors and updates its own parameters accordingly.

[0057] (6)

[0058] in, These are aggregation operations, including summation, averaging, and maximization. It is a multilayer sensor used to integrate neighbor information;

[0059] After L layers of iterations, each node Having a final representation The predicted value of the node is obtained using a decoder. Finally use The transformation ensures that the size is positive, resulting in the final predicted discrete size field. ,in, It is a non-linear activation function;

[0060] In obtaining discrete size fields Then, in order for the information transmission network to accurately predict the size field of the unknown model, a supervision signal is constructed for it through the following steps;

[0061] Step S23: For the size field obtained in step S14 Since the function is continuous, regressing a continuous function on arbitrary geometric structures is impractical. This invention uses a sampling method to progressively predict based on the model's geometric structure and detailed features, which helps generate high-quality prediction results and enables continuous size field prediction. Recalculated as an element-level size function:

[0062] (7)

[0063] in, For point The volume of an element in a given location represents its area in two dimensions. For geometric dimensions; Formula (7) is based on The defined mesh element dimensions are used to calculate the corresponding element volume, which is then converted into an approximate expression of the average side length to be used as the network's supervision signal. This formula transforms the network's regression task on geometrically continuous functions into a regression task on the side lengths of a specific region.

[0064] Will Mapping to discrete size field Above: For each vertex in it If the point is located One of the elements Internally, the element's The monitoring target is determined by a point-to-point correspondence method. It is mapped to the predicted size field;

[0065] Step S24: Construct the MSE loss function Calculate pointwise loss:

[0066] (8)

[0067] in, The size value of node j predicted by the information transmission neural network in step S22. For the process in step S23 The predicted size value of node j is calculated;

[0068] After obtaining the value of the MSE loss function, the network propagates backward along the neural network structure, calculating the gradient of each parameter with respect to the loss function layer by layer until the gradient of the input layer is calculated. The network parameters are updated based on the calculated gradients, and then predictions are performed again using the new parameters. Steps S22-S24 are repeated until... The value is continuously reduced until a threshold is reached, at which point the final predicted discrete-size field is output. ;

[0069] Given the uncertainty of the number and spatial distribution of grid nodes within the model, the discrete size field data is interpolated using the following steps to construct a continuously defined size function throughout the entire model region;

[0070] Step S25: Interpolate the discrete size field data to construct a continuous size field across the entire model region. The interpolation function is as follows:

[0071] (9)

[0072] (10)

[0073] in, For the first The basis functions of each vertex are used to perform interpolation within the elements. Return the index value that minimizes the objective function. For nodes geometric coordinates Let be any point within the domain.

[0074] Generally, this interpolation function takes a value of 1 at each corresponding vertex and 0 at other vertices through each basis function, varying linearly within the mesh cells connecting these vertices. By weighted combining these basis functions to predict vertex values, a continuously varying size field is constructed across the entire geometric domain. This method is not only computationally efficient but also highly compatible with finite element mesh structures, capable of finely representing size variations, and is a key step in achieving high-quality adaptive mesh generation.

[0075] The prediction effect diagram of the information transmission neural network is shown below. Figure 2 As shown.

[0076] In one embodiment, step S3 above: Based on the continuous size field and the known model, reinforcement learning is introduced, and an adaptive mesh is generated using the front-edge propulsion method as a training dataset for training a supervised training network. The supervised training network includes: two classification networks and two regression networks. The four networks jointly learn to generate an adaptive mesh for an unknown model using the front-edge propulsion method, specifically including:

[0077] Step S31: Based on the continuous size field With model An adaptive grid is generated using the frontier advance method and used as the training dataset.

[0078] The leading-edge method is a technique commonly used for high-quality mesh generation, especially suitable for situations requiring complex boundaries and non-uniform dimensions. First, the model... The boundary is discretized according to the size field to form initial boundary nodes, and all current boundary nodes are considered as the "front edge" of the mesh. During mesh generation, a reference point is selected from the current front edge. ,according to around The information determination strategy for each point generates a quadrilateral mesh, which includes four strategies: two direct connection strategies and two strategies for inserting new nodes. Once a new quadrilateral mesh is generated, the "front edge" advances to the boundary of the quadrilateral, and the above steps are repeated until the "front edge" disappears.

[0079] Step S32: Input the training dataset into the supervised training network, which includes: two classification networks and two regression networks. These four networks jointly learn how to generate the model's mesh using the frontier advance method. Specifically, this includes:

[0080] Step S321: Train a supervised training network to predict the next decision, wherein the supervised training network includes: a binary classification network. Select reference point A four-class classification network Determine the generation strategy using two regression networks. and Output the location information of the newly added point;

[0081] Step S322: First, use a binary classification network. Used to determine whether a vertex on the front can be selected as a reference point. Each sample's input contains local information about the area around that point, including the current candidate point. The four consecutive adjacent points to the left of the point on the front edge The four consecutive adjacent points to the right of the point on the front edge ,Leave The three most recent points The network outputs binary classification probabilities:

[0082] (11)

[0083] (12)

[0084] in, To accept this point as The probability, To refuse this point The probability when; A point will only be selected as a reference point after its probability reaches a predetermined threshold. ;

[0085] Because the proportion of candidate point samples in the training dataset is small and the positive and negative samples are imbalanced, therefore, using Instead of cross-entropy loss, it reduces the weight of easily classified samples and focuses on difficult-to-classify samples:

[0086] (13)

[0087] in, The total number of samples, For category weights, As a focusing factor, For the first The predicted probability of each sample;

[0088] Step S323: After determining the reference point, use a four-class classification network. The next mesh generation strategy is determined by four update strategies: two directly add new edges to the existing front to form new quadrilateral cells without adding new nodes; the other two require adding new nodes to form new cells with the front, and one or two new nodes can be added. The input to this network is local information around the selected reference point, and... If the results are the same, the output becomes a four-class classification network:

[0089] (14)

[0090] (15)

[0091] Each probability Both represent an update strategy that the network will use. As the next step;

[0092] This network also uses As a loss function:

[0093] (16)

[0094] in, The total number of samples, For category weights, For the sample The true category, for Type weight;

[0095] Step S324: When When the network determines that an update strategy of adding a new point should be adopted, a regression network is used. Predicting new nodes Location; Input data and Same, output polar coordinate position Using polar coordinates to represent position is better than using Cartesian coordinates because polar coordinates better reflect the position of a point relative to a reference point. A natural description; the loss function uses mean squared error:

[0096] (17)

[0097] in, The total number of samples, and For the first The true angle and radius of each sample and For the predicted angle and radius;

[0098] Step S325: When When the network determines that an update strategy of adding two new points should be adopted, it uses... The network predicts the locations of these two new nodes. Output polar coordinate position and polar coordinate position Accordingly, the loss function is:

[0099] (18).

[0100] The four supervised learning networks mentioned above together constitute a data-driven frontier propulsion strategy agent, laying the foundation for the subsequent reinforcement learning stage.

[0101] Step S33: Freeze the parameters of the four trained networks and introduce them into the reinforcement learning framework as fixed policy modules in transfer learning. The four networks together constitute an agent used to predict the next generation action in the frontier advancement mesh generation process, ultimately generating a high-quality adaptive mesh. Specifically, this includes:

[0102] Step S331: Reinforcement learning models the frontier propulsion grid generation process as a partially observable Markov decision process, including the following core elements:

[0103] state This represents the current frontier local information, which is the input of the four supervision networks;

[0104] action Four grid update operations based on network decision-making;

[0105] environment The evolution of the current mesh boundary includes the size field, front edge, boundary nodes, and the generated mesh.

[0106] award The quality of newly generated mesh cells and the reward / penalty for outliers;

[0107] intelligent agent The supervised training network trained in step S3;

[0108] First, set the initialization state. ,according to Using intelligent agents Predicting actions After execution, new grid cells are generated, and the reward is calculated. Repeat the above process until the frontal zone is closed;

[0109] Step S332: The reward function is based on mesh shape quality and structural quality, and uses a combination of local quadrilateral quality reward and outlier penalty to measure the overall quality.

[0110] The local quadrilateral quality bonus measures how close the generated mesh cells are to squares, and is defined as:

[0111] (19)

[0112] in, These are the four interior angles of the quadrilateral. The lengths of the four sides are as close to a square as possible. The higher the value, the higher the reward the network will receive;

[0113] In a mesh cell, the number of adjacent elements of a point is equal to the number of polygon cells it connects to. In an ideal quadrilateral mesh, an interior point should have 4 adjacent elements, and a boundary point should have 2. Points that do not conform to this rule are called outliers. Outlier penalties are used to reduce the number of outliers in the mesh and are defined as follows:

[0114] (20)

[0115] in, This indicates the number of outliers in the grid. This indicates the number of adjacent outliers. This represents the total number of nodes;

[0116] The total reward function is constructed as follows:

[0117] (twenty one)

[0118] The goal of the overall reward function is to maximize the average reward while minimizing the local reward, balancing global and local quality. When the current round... When the current best result is exceeded, the resulting grid is used as training data to update the policy and initiate a new round of learning. Through continuous iteration of reinforcement learning, a higher quality grid structure than supervised training can be automatically generated, especially by significantly reducing outliers and irregular units, resulting in a high-quality adaptive grid.

[0119] Figure 3 This is a schematic diagram of a supervised training network architecture based on reinforcement learning.

[0120] Figure 4 This is a flowchart illustrating an adaptive mesh generation method based on reinforcement learning.

[0121] Figure 5The diagrams shown are the adaptive mesh generation results of the present invention, where (a) is the overall effect diagram and (b), (c), (d), and (e) are the detailed effect diagrams.

[0122] Example 2

[0123] like Figure 6 As shown, this embodiment of the invention provides an adaptive mesh generation system based on reinforcement learning, comprising the following modules:

[0124] The size field calculation module 41 is used to construct a background mesh based on the input known model, calculate the curvature characteristics and proximity characteristics of the known model, and generate the corresponding size field.

[0125] The size field prediction module 42 is used to input the unknown model to be predicted into the neural network, predict the discrete size field of the unknown model, and perform interpolation processing on the discrete size field to obtain the continuous size field of the unknown model.

[0126] The adaptive mesh generation module 43 is used to introduce reinforcement learning based on the continuous size field and the known model, and use the front-edge push method to generate an adaptive mesh as a training dataset for training a supervised training network. The supervised training network includes two classification networks and two regression networks. The four networks jointly learn to generate an adaptive mesh for an unknown model using the front-edge push method.

[0127] An adaptive mesh generation device based on reinforcement learning includes one or more electronic devices, wherein the one or more electronic devices are used to implement the adaptive mesh generation method based on reinforcement learning.

[0128] An electronic device includes: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement an adaptive mesh generation method based on reinforcement learning.

[0129] A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to implement an adaptive mesh generation method based on reinforcement learning.

[0130] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. An adaptive mesh generation method based on reinforcement learning, characterized in that, include: Step S1: Based on the input known model, construct a background mesh, calculate the curvature and proximity features of the known model, and generate the corresponding size field; Step S2: Input the unknown model to be predicted into the neural network to predict the discrete size field of the unknown model; and perform interpolation on the discrete size field to obtain the continuous size field of the unknown model. Step S3: Based on the continuous size field and the known model, reinforcement learning is introduced, and an adaptive mesh is generated using the front-edge push method as a training dataset for training a supervised training network. The supervised training network includes two classification networks and two regression networks. The four networks jointly learn to generate an adaptive mesh for an unknown model using the front-edge push method.

2. The adaptive mesh generation method based on reinforcement learning according to claim 1, characterized in that, Step S1: Based on the input known model, construct a background mesh, calculate the curvature and proximity features of the known model, and generate the corresponding size field, specifically including: Step S11: Input Model Construct the bounding box of its corresponding geometric model, calculate the maximum and minimum coordinates of the geometric boundary, and expand it to form a bounding box slightly larger than the model. spatial region Based on the preset global dimensions ,Will The grid is divided into a structured, regular mesh, forming a background mesh composed of equally spaced nodes, and an initial size value is assigned to each node. ; Step S12: For curvature features: Calculation model On the parametric surface, let the principal curvatures be such that the radius of curvature corresponding to the maximum principal curvature is denoted as . Then the size value of that point Defined as; (1) in, The curvature control parameter limits the target size value along the curve boundary. The radius of curvature corresponding to the maximum principal curvature , and This indicates the maximum and minimum curvature of the surface at that point in two orthogonal directions. If a point belongs to multiple surfaces, the radius corresponding to the maximum absolute principal curvature is used. For proximity features, point proximity and curve proximity are calculated to quantify fine structures, specifically the size value at that point. Defined as: (2) (3) Formula (2) represents updating the dimension value using curve proximity. , The nearest neighbor distance of an edge is estimated based on the median method; As a proximity distance control parameter, the expected size value is limited to the proximity distance; Formula (3) is used to calculate the point proximity. The length of the shortest side connecting this point; All dimension values ​​are calculated based on the curvature and proximity characteristics at that point. For general nodes, the dimension values ​​are... The size field of the model is obtained by traversing and calculating all nodes; Step S13: Detect whether the size field has narrow slit structures or thin-layer voids, the steps are as follows: First, the ray casting method is used to calculate close-range face-to-face interactions. For each triangular element in the background mesh, two rays are emitted, with directions either the same as or opposite to the normal direction. The ray form is as follows: (4) in, The center of the triangular element, For unit normal vector, Used for directional control. The ray step size is defined by the maximum and minimum lengths. If the ray hits another surface within the defined detection range, it indicates the presence of a slit structure at that location, and a smaller size value is defined. Continue testing until the size field no longer contains narrow slit structures or thin-layer voids, thus obtaining the initial size function. ; Step S14: Apply the initial size function Smoothing is performed to limit its gradient: Adjust the size of the elements on each node The value is obtained by iterating through all line segments in the background mesh, and considering the two endpoints of each edge. and Determine whether the following conditions are met: , For custom gradient control parameters, if the threshold is exceeded, the corresponding size value will be adjusted. Continue until all nodes meet the conditions to generate the final size field. .

3. The adaptive mesh generation method based on reinforcement learning according to claim 2, characterized in that, Step S2: The unknown model to be predicted is input into a neural network to predict the discrete size field of the unknown model; and the discrete size field is interpolated to obtain the continuous size field of the unknown model, specifically including: Step S21: For the unknown model to be predicted Using the same method as step S11, a background mesh is generated to obtain a mesh file. ; Step S22: Input information is passed to a neural network to obtain predictions. Discrete size field; The information transmission neural network is constructed based on a graph neural network. First, the information transmission neural network is constructed based on a graph neural network. Using graph structures Represents a set of nodes. For the set of vertices and edges of the grid The edges are the grid edges, and the edges use bidirectional connections; The aforementioned information-transferring neural network is used to continuously update the information in the graph structure: For each edge Update the eigenvectors of the edges: (5) in, It is a multilayer perceptron used to learn the transformations of information at the edges. Representing edge features, and These represent the node features and the features of its neighboring nodes, respectively. Indicates the current floor number; For each node It aggregates information from its neighbors and updates its own parameters accordingly. (6) in, These are aggregation operations, including summation, averaging, and maximization. It is a multilayer sensor used to integrate neighbor information; After L layers of iterations, each node Having a final representation The predicted value of the node is obtained using a decoder. Finally use The transformation ensures that the size is positive, resulting in the final predicted discrete size field. ,in, It is a non-linear activation function; Step S23: For the size field obtained in step S14 The function is continuous, and it is impractical to revert to a continuous function on arbitrary geometric structures. This leads to the need for a continuous size field. Recalculated as an element-level size function: (7) in, For point The volume of an element in a given location represents its area in two dimensions. For geometric dimensions; Will Mapping to discrete size field Above: For each vertex in it If the point is located One of the elements Internally, the element's The monitoring target is determined by a point-to-point correspondence method. It is mapped onto the predicted size field; Step S24: Construct the MSE loss function Calculate pointwise loss: (8) in, The size value of node j predicted by the information transmission neural network in step S22. For the process in step S23 The predicted size value of node j is calculated; Repeat steps S22~S24, so that The value is continuously reduced until a threshold is reached, at which point the final predicted discrete-size field is output. ; Step S25: Perform interpolation processing on the discrete size field data to construct a continuous size field across the entire model region. The interpolation function is as follows: (9) (10) in, For the first The basis functions of each vertex are used to perform interpolation within the elements. Return the index value that minimizes the objective function. For nodes geometric coordinates Let be any point within the domain.

4. The adaptive mesh generation method based on reinforcement learning according to claim 3, characterized in that, Step S3: Based on the continuous size field and the known model, reinforcement learning is introduced, and an adaptive mesh is generated using the forward propulsion method as a training dataset to train a supervised training network. The supervised training network includes two classification networks and two regression networks. The four networks jointly learn to generate an adaptive mesh for an unknown model using the forward propulsion method. Specifically, this includes: Step S31: Based on the continuous size field With model An adaptive grid is generated using the frontier advance method and used as the training dataset. Step S32: Input the training dataset into the supervised training network, which includes two classification networks and two regression networks. The four networks learn together how to generate the model's grid using the frontier advance method. Step S33: Freeze the parameters of the four trained networks and introduce them into the reinforcement learning framework as fixed policy modules in transfer learning. The four networks together constitute an agent, which is used to predict the next generation action in the frontier advancement method grid generation process, and finally generate a high-quality adaptive grid.

5. The adaptive mesh generation method based on reinforcement learning according to claim 4, characterized in that, Step S32: Input the training dataset into the supervised training network, including: two classification networks and two regression networks, the four networks jointly learn how to generate the model's mesh using the frontier advance method, specifically including: Step S321: Train a supervised training network to predict the next decision, wherein the supervised training network comprises: a binary classification network. Select reference point A four-class classification network Determine the generation strategy using two regression networks. and Output the location information of the newly added point; Step S322: First, use a binary classification network. Used to determine whether a vertex on the front can be selected as a reference point. Each sample's input contains local information about the area around that point, including the current candidate point. The four consecutive adjacent points to the left of the point on the front edge The four consecutive adjacent points to the right of the point on the front edge ,Leave The three most recent points The network outputs binary classification probabilities: (11) (12) in, To accept this point as The probability, To refuse this point The probability when; A point will only be selected as a reference point after its probability reaches a predetermined threshold. ; Because the proportion of candidate point samples in the training dataset is small and the positive and negative samples are imbalanced, therefore, using Instead of cross-entropy loss, it reduces the weight of easily classified samples and focuses on difficult-to-classify samples: (13) in, The total number of samples, For category weights, As a focusing factor, For the first The predicted probability of each sample; Step S323: After determining the reference point, use a four-class classification network. The next mesh generation strategy is determined by four update strategies: two directly add new edges to the existing front to form new quadrilateral cells without adding new nodes; the other two require adding new nodes to form new cells with the front, and one or two new nodes can be added. The input to this network is local information around the selected reference point, and... If the results are the same, the output becomes a four-class classification network: (14) (15) Each probability Both represent an update strategy that the network will use. As the next step; This network also uses As a loss function: (16) in, The total number of samples, For category weights, For the sample The true category, for Type weight; Step S324: When When the network determines that an update strategy of adding a new point should be adopted, a regression network is used. Predicting new nodes Location; Input data and Same, output polar coordinate position Using polar coordinates to represent position is better than using Cartesian coordinates because polar coordinates better reflect the position of a point relative to a reference point. A natural description; the loss function uses mean squared error: (17) in, The total number of samples, and For the first The true angle and radius of each sample and For the predicted angle and radius; Step S325: When When the network determines that an update strategy of adding two new points should be adopted, it uses... The network predicts the locations of these two new nodes. Output polar coordinate position and polar coordinate position Accordingly, the loss function is: (18)。 6. The adaptive mesh generation method based on reinforcement learning according to claim 4, characterized in that, Step S33: Freeze the parameters of the four trained networks and introduce them into the reinforcement learning framework as fixed policy modules in transfer learning. The four networks together constitute an agent used to predict the next generation action in the frontier advancement mesh generation process, ultimately generating a high-quality adaptive mesh. Specifically, this includes: Step S331: Reinforcement learning models the frontier propulsion grid generation process as a partially observable Markov decision process, including the following core elements: state This represents the current frontier local information, which is the input of the four supervision networks; action Four grid update operations based on network decision-making; environment The evolution of the current mesh boundary includes the size field, front edge, boundary nodes, and the generated mesh. award The quality of newly generated mesh cells and the reward / penalty for outliers; intelligent agent The supervised training network trained in step S3; First, set the initialization state. ,according to Using intelligent agents Predicting actions After execution, new grid cells are generated, and the reward is calculated. Repeat the above process until the frontal zone is closed; Step S332: The reward function is based on mesh shape quality and structural quality, and uses a combination of local quadrilateral quality reward and outlier penalty to measure the overall quality. The local quadrilateral quality bonus measures how close the generated mesh cells are to squares, and is defined as: (19) in, These are the four interior angles of the quadrilateral. The lengths of the four sides are as close to a square as possible. The higher the value, the higher the reward the network will receive; Outlier penalty is designed to reduce the number of outliers in the mesh and is defined as: (20) in, This indicates the number of outliers in the grid. This indicates the number of adjacent outliers. This represents the total number of nodes. The total reward function is constructed as follows: (21) The goal of the total reward function is to maximize the average reward while minimizing the local reward, thus balancing global and local quality.

7. An adaptive grid generation system based on reinforcement learning, characterized in that, Includes the following modules: The size field calculation module is used to construct a background mesh based on the input known model, calculate the curvature and proximity features of the known model, and generate the corresponding size field. The size field prediction module is used to input the unknown model to be predicted into the neural network, predict the discrete size field of the unknown model, and perform interpolation processing on the discrete size field to obtain the continuous size field of the unknown model. An adaptive mesh generation module is used to introduce reinforcement learning based on the continuous size field and the known model, and use the front-edge propulsion method to generate an adaptive mesh as a training dataset for training a supervised training network. The supervised training network includes two classification networks and two regression networks. The four networks jointly learn to generate an adaptive mesh for an unknown model using the front-edge propulsion method.

8. An adaptive mesh generation device based on reinforcement learning, characterized in that, It includes one or more electronic devices, wherein the one or more electronic devices are used to implement the method of any one of claims 1 to 6.

9. An electronic device, characterized in that, include: One or more processors; A memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method of any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, It stores executable instructions that, when executed by a processor, cause the processor to perform the method described in any one of claims 1 to 6.

Citation Information

Cited By

  • Automatic polygon and quadrilateral mesh subdivision method based on deep reinforcement learning

    CN122066802A