Physical field gradient calculation method and system based on graph neural network
By constructing a learnable gradient operator space through a graph neural network and combining it with a directional decoupling dynamic gating mechanism, the problems of mesh defect compensation and gradient calculation accuracy are solved, achieving high-precision gradient estimation for unstructured meshes, which is suitable for simulating complex physical fields.
Patent Information
- Application Number
- CN202511505127.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-10-21
AI Technical Summary
Existing technologies cannot adaptively compensate for mesh defects. There is an imbalance between the robustness and accuracy of gradient calculation in unstructured meshes. Traditional gradient estimation methods rely on mesh quality and have poor gradient estimation performance in boundary regions.
A learnable gradient operator space is constructed using a graph neural network. The gradient operator message passing process is optimized through a direction decoupling dynamic gating mechanism. Boundary constraints are strengthened by combining a partition loss function, thereby improving the robustness and accuracy of gradient calculation on unstructured grids.
It significantly reduces the gradient estimation error of grids with different quality and density. The optimized gradient operator reduces the derivative error by more than 33.19% in all directions and at all orders, and demonstrates high-precision gradient estimation capability in transient heat conduction equations, making it suitable for complex physical field coupling simulations.
Smart Images

Figure CN120995887A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of physical field gradient analysis, and in particular to a physical field gradient calculation method and system based on a graph neural network. BACKGROUND
[0002] In numerical analysis of fluid mechanics and structural mechanics, unstructured grids have become the core tool for numerical simulation of physical fields due to their high efficiency in discretizing complex geometric topologies. However, traditional gradient estimation methods, such as Green-Gauss method and weighted least squares method, have the following problems: The accuracy of gradient estimation is highly dependent on grid quality, and low-quality grids can significantly increase errors; The gradient estimation effect in the boundary region is poor, and the error is concentrated.
[0003] Graph neural networks (GNN) provide a new data-driven paradigm for physical field modeling, and their graph structure representation capability is naturally compatible with unstructured grids, creating conditions for building gradient operator optimization models based on specific function spaces. However, existing graph neural network methods cannot dynamically correct grid geometry defects, and the isotropic feature aggregation mechanism conflicts with the direction sensitivity of physical field gradients, resulting in loss of direction resolution.
[0004] In summary, there is an urgent need for a new physical field gradient calculation method and system based on graph neural networks. SUMMARY
[0005] The main purpose of the present application is to provide a physical field gradient calculation method and system based on a graph neural network, which aims to solve the technical problems that the existing technology cannot adaptively compensate for grid defects, and the robustness and accuracy of unstructured grid gradient calculation are imbalanced.
[0006] To achieve the above purpose, the present application provides a physical field gradient calculation method based on a graph neural network, which comprises the following steps: Obtain physical field data, which includes physical field information and grid topology relationship of the physical field, and the physical field at least includes the stress field of the engineering member; Based on the grid topology relationship, obtain the original gradient operator; Update the physical field data based on the graph neural network, and obtain the first gradient operator based on the grid topology relationship and the original gradient operator of the updated physical field data; Decouple different directions of the physical field to set corresponding direction training weights; Obtain the second gradient operator based on the original gradient operator, the first gradient operator and the direction training weight; The gradient of the physical field is calculated based on the second gradient operator.
[0007] Preferably, the process of obtaining the original gradient operator based on the grid topology relationship includes: The gradient of each triangular unit is reconstructed in discrete form based on Green's-Gauss theorem; The vertex gradient is reconstructed by using an area-weighted average of the gradients of all adjacent cells of the vertex, thus approximating the continuous gradient field by the discrete grid gradient. The weight coefficient matrix of the discrete grid gradient is separated from the response field input, and the decomposed discrete grid gradient weight coefficient matrix is denoted as the initial gradient operator; The physical field grid includes at least an unstructured grid, and a directed graph is constructed based on the unstructured grid as follows: in: For a set of nodes and , For node features, based on the node features Encoding the initial gradient operator ; For edge set and Represents node connectivity and edge features. The mesh topology relationships between the encoded nodes.
[0008] Preferably, the method of updating the physical field data based on a graph neural network includes: Based on the sending node Receive node and edge features before update Through multilayer perceptron Output the updated edge features: in, The updated edge features; Aggregation Node All adjacent edge features Combined with the original node features Through multilayer perceptron Output the updated node features: in, This refers to the updated node features.
[0009] Preferably, the first gradient operator is obtained based on the grid topology relationship of the updated physical field data and the original gradient operator, including: The directed graph is updated based on the updated edge features and the updated node features, resulting in the following updated directed graph: in: The updated node set is obtained based on the updated node features, and the first gradient operator is encoded based on the updated node set. ; The updated edge set is obtained based on the updated edge features.
[0010] Preferably, the decoupling of different directions of the physical field to set corresponding direction training weights includes: The mesh structure is as follows direction and Direction, for The first direction training weight is set to... Set the training weights for the second direction.
[0011] Preferably, the process of obtaining the second gradient operator based on the original gradient operator, the first gradient operator, and the direction training weights includes: The initial gradient operator and the first gradient operator are adjusted based on the directional decoupling dynamic gating formula to obtain the second gradient operator; wherein, the directional decoupling dynamic gating formula is: in, For the second gradient operator, The weights are trained for the first direction. These are the training weights for the second direction.
[0012] Preferably, the method further includes the following steps: Based on the boundary region of the physical field, a partition loss function is obtained; The physical field gradient is calculated based on the partition loss function and the second gradient operator iterative optimization.
[0013] Preferably, the partitioning loss function is as follows: in, The weighting parameters are the mean square error of the boundary nodes. The weighting parameter for the mean square error of the internal nodes. For boundary loss, This is an internal loss.
[0014] Preferably, the boundary loss and the internal loss are specifically as follows: in, The number of boundary nodes of the grid. The number of internal nodes of the grid. For gradient operators and functions gradient prediction value, This is for analytical gradient solutions or high-precision numerical gradient solutions.
[0015] To achieve the above objectives, the present invention also provides a physical field gradient calculation system based on graph neural networks, which applies the physical field gradient calculation method based on graph neural networks as described above. The system includes: The field data acquisition module is used to acquire physical field data, which includes physical field information and mesh topology relationships of the physical field, and the physical field includes at least the stress field of the engineering component; The original gradient operator module is used to obtain the original gradient operator based on the mesh topology relationship; The first gradient operator module is used to update the physical field data based on the graph neural network, and to obtain the first gradient operator based on the grid topology relationship of the updated physical field data and the original gradient operator. The decoupling module is used to decouple different directions of the physical field in order to set corresponding directional training weights; The second gradient operator module is used to obtain the second gradient operator based on the original gradient operator, the first gradient operator, and the direction training weights; The gradient calculation optimization module is used to perform gradient calculation of the physical field based on the second gradient operator.
[0016] Beneficial effects: (1) It has a significant effect on meshes of different quality and density, and the gradient estimation error of each derivative in each direction is reduced by more than 33.19%; (2) The optimized second gradient operator exhibits an effective spatial frequency adaptation range of 0.88~1.94Hz; (3) In the solution framework of the transient heat conduction equation, the second gradient operator obtained based on the present invention has good time stability, laying a high-precision gradient estimation foundation for the coupled simulation of complex physical fields. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1A flowchart of the physical field gradient calculation method based on graph neural networks provided in this embodiment of the invention. Figure 1 ; Figure 2 A flowchart of the physical field gradient calculation method based on graph neural networks provided in this embodiment of the invention. Figure 2 ; Figure 3 A schematic diagram of a low-quality unstructured mesh provided in an embodiment of the present invention; Figure 4 The traditional gradient operator method based on low-quality unstructured meshes provided in this embodiment of the invention The first-order gradient results in the direction; where (a) is the true value, (b) is the value calculated by the traditional gradient method, and (c) is the error value; Figure 5 The traditional gradient operator method based on low-quality unstructured meshes provided in this embodiment of the invention The first-order gradient results in the direction; where (a) is the true value, (b) is the value calculated by the traditional gradient method, and (c) is the error value; Figure 6 The traditional gradient operator method based on low-quality unstructured meshes provided in this embodiment of the invention The second-order gradient results in the direction; where (a) is the true value, (b) is the value calculated by the traditional gradient method, and (c) is the error value; Figure 7 The traditional gradient operator method based on low-quality unstructured meshes provided in this embodiment of the invention The second-order gradient results in the direction; where (a) is the true value, (b) is the value calculated by the traditional gradient method, and (c) is the error value; Figure 8 The method based on low-quality unstructured mesh provided in this embodiment of the invention The first-order gradient results in the direction; where (a) is the true value, (b) is the calculated value in this embodiment, and (c) is the error value; Figure 9 The method based on low-quality unstructured mesh provided in this embodiment of the invention The first-order gradient results in the direction; where (a) is the true value, (b) is the calculated value in this embodiment, and (c) is the error value; Figure 10 The method based on low-quality unstructured mesh provided in this embodiment of the invention The second-order gradient results in the direction; where (a) is the true value, (b) is the calculated value in this embodiment, and (c) is the error value; Figure 11The method based on low-quality unstructured mesh provided in this embodiment of the invention The second-order gradient results in the direction; where (a) is the true value, (b) is the calculated value in this embodiment, and (c) is the error value; Figure 12 A structural block diagram of a physical field gradient calculation system based on a graph neural network provided in an embodiment of the present invention; Figure 13 This is a schematic diagram of a mesh and a comparison diagram of its corresponding gradient operators provided in an embodiment of the present invention; wherein, (a) is The first-order gradient result in the direction is (b) The first-order gradient result in the direction is (c) The second-order gradient result in the direction is (d) The second-order gradient result in the direction; Figure 14 The effect of the physics field gradient calculation method based on graph neural networks provided in this embodiment of the invention in a certain scenario. Figure 1 ; where (a) is The first-order gradient result in the direction is (b) The first-order gradient result in the direction is (c) The second-order gradient result in the direction is (d) The second-order gradient result in the direction; Figure 15 The effect of the physics field gradient calculation method based on graph neural networks provided in this embodiment of the invention in a certain scenario. Figure 2 ; where (a) is The first-order gradient field in the direction, (b) is The first-order gradient field in the direction, (c) is The second-order gradient field in the direction, (d) is Second-order gradient field in the direction; Figure 16 The effect of the physics field gradient calculation method based on graph neural networks provided in this embodiment of the invention in scenario two. Figure 1 ; where (a) is The first-order gradient result in the direction is (b) The first-order gradient result in the direction is (c) The second-order gradient result in the direction is (d) The second-order gradient result in the direction; Figure 17 The effect of the physics field gradient calculation method based on graph neural networks provided in this embodiment of the invention in scenario two. Figure 2 ; where (a) is The first-order gradient field in the direction, (b) is The first-order gradient field in the direction, (c) is The second-order gradient field in the direction, (d) is Second-order gradient field in the direction; Figure 18 The flowchart illustrates the optimization of gradient computation power based on graph neural networks and the strengthening of boundary constraints based on partitioning loss functions, as provided in this embodiment of the invention.
[0019] The implementation, functional features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0021] To address the technical challenges of adaptive compensation for mesh defects and the imbalance between robustness and accuracy in gradient computation for unstructured meshes in existing technologies, current techniques employ mesh-specific gradient computation optimization. This typically focuses on optimizing gradient operator generation, such as the Green-Gaussian method and weighted least squares, aiming to provide a more accurate operator for a given mesh. However, these methods address the mesh itself and do not consider the varying accuracy of gradient operators under different functional contexts. Furthermore, traditional methods often perform poorly on mesh models with very low quality, placing high demands on the quality of the generated mesh. Some techniques combine graph neural networks with mesh computation, but these tend to focus on generating better meshes using graph neural networks and mesh quality evaluation methods, rather than optimizing an existing low-quality mesh.
[0022] To address the aforementioned problems and phenomena, this embodiment proposes a graph neural network architecture that integrates physical priors, constructs a learnable gradient operator space, optimizes the gradient operator message passing process through a directional decoupling dynamic gating mechanism, achieves adaptive compensation for mesh defects, and improves the robustness and accuracy of gradient calculation for unstructured meshes. This solves the problem that gradient estimation accuracy is highly dependent on mesh quality, and low-quality meshes can lead to a significant increase in error.
[0023] like Figure 1 As shown in the figure, this embodiment discloses a method for calculating the physical field gradient based on a graph neural network. The method includes the following steps: S1: Acquire physical field data, which includes physical field information and mesh topology relationships. The physical field must include at least the stress field of the engineering component. S2: Based on the grid topology, the original gradient operator is obtained; S3: Update the physical field data based on the graph neural network, and obtain the first gradient operator based on the grid topology relationship of the updated physical field data and the original gradient operator; S4: Decouple different directions of the physical field to set corresponding training weights for the direction; S5: Based on the original gradient operator, the first gradient operator, and the orientation training weights, the second gradient operator is obtained; S6: Calculate the gradient of the physical field based on the second gradient operator.
[0024] In this embodiment, node features and edge features are obtained based on physical field data; Node features encode physical field information and grid topology relationships. The grid topology relationships include at least coordinates, and the physical field information includes at least scalar field values. Edge features are fused with mesh topological relationships and local geometric vectors to represent the spatial relationships between nodes. The local geometric vectors include at least the normal difference.
[0025] Specifically, based on the grid topology, the original gradient operator is obtained, including: The gradient of each triangular unit is reconstructed in discrete form based on Green's-Gauss theorem; The vertex gradient is reconstructed by using an area-weighted average of the gradients of all adjacent cells of the vertex, thus approximating the continuous gradient field by the discrete grid gradient. The weight coefficient matrix of the discrete grid gradient is separated from the response field input, and the decomposed discrete grid gradient weight coefficient matrix is denoted as the initial gradient operator; The physical field's mesh includes at least an unstructured mesh, and a directed graph is constructed based on the unstructured mesh as follows: in: For a set of nodes and , For node features, based on node features Encoding the initial gradient operator ; For edge set and Represents node connectivity and edge features. The mesh topology relationships between encoding nodes.
[0026] Specifically, updating physical field data based on graph neural networks includes: Based on the sending node Receive node and edge features before update Through multilayer perceptron Output the updated edge features: in, The updated edge features; Aggregation Node All adjacent edge features Combined with the original node features Through multilayer perceptron Output the updated node features: in, This refers to the updated node features.
[0027] In this embodiment, the above update is based on GNN Block, and the iterative execution of equations (1)-(2) can achieve the extraction of deep features.
[0028] Specifically, based on the updated physical field data's grid topology and the original gradient operator, the first gradient operator is obtained, including: The directed graph is updated based on the updated edge features and node features, resulting in the following updated directed graph: in: The updated node set is obtained based on the updated node features, and the first gradient operator is encoded based on the updated node set. ; This is the updated edge set obtained based on the updated edge features.
[0029] In this embodiment, the initial gradient operator of the discrete grid is first... As a fundamental physical constraint; secondly, based on the initial gradient operator. The first gradient operator is constructed using a message passing process with a graph neural network to connect the high-precision gradient field response. In particular, node features encode mesh geometric properties and physical field information, such as coordinates and scalar field values, while edge features fuse topological connectivity relationships and local geometric vectors, such as normal differences, together forming the data foundation of the graph structure.
[0030] Specifically, decoupling different directions of the physical field to set corresponding directional training weights includes: Set the grid structure as direction and Direction, for The first direction training weight is set to... Set the training weights for the second direction.
[0031] Specifically, based on the original gradient operator, the first gradient operator, and the direction training weights, the second gradient operator is obtained, including: The second gradient operator is obtained by adjusting the initial gradient operator and the first gradient operator based on the directional decoupling dynamic gating formula; wherein, the directional decoupling dynamic gating formula is: in, For the second gradient operator, The weights are trained for the first direction. The weights are used for training in the second direction.
[0032] In this embodiment, the design of the directional decoupling dynamic gating formula aims to dynamically balance the contradiction between global physical constraints and local data-driven approaches, which is key to improving the robustness and adaptability of gradient computation on unstructured meshes. To balance the synergistic optimization of global physical constraints and local data-driven approaches and enhance the adaptability of spatial operators to complex meshes and multi-physics fields, this embodiment proposes a directional decoupling dynamic gating formula in the gradient operator update stage. This formula independently assigns trainable weights to each spatial direction, dynamically adjusting the contribution ratio between the traditional gradient operator and the modified gradient operator. Finally, the optimized second gradient operator is generated through a gating weighting mechanism. ,accomplish direction and Cooperative optimization of the first and second derivatives of the direction.
[0033] Furthermore, considering that the quality of gradient operators in the grid boundary region is usually poor and gradient estimation is prone to distortion, in order to solve the problem of poor gradient estimation effect and error concentration in the boundary region, this embodiment proposes a technical solution to construct the loss function by using partitioned weighted mean square error.
[0034] Specifically, such as Figure 2 As shown, the method also includes the following steps: S51: Based on the grid-based boundary region, the partitioning loss function is obtained; S61: Physics gradient calculation based on partition loss function and second gradient operator iterative optimization.
[0035] Specifically, the partitioning loss function is as follows: in, The weighting parameters are the mean square error of the boundary nodes. The weighting parameter for the mean square error of the internal nodes. For boundary loss, This is an internal loss.
[0036] Specifically, boundary loss and internal loss are as follows: in, The number of boundary nodes of the grid. The number of internal nodes of the grid. For gradient operators and functions gradient prediction value, This is for analytical gradient solutions or high-precision numerical gradient solutions.
[0037] It should be noted that this embodiment uses the Adam optimizer to minimize the loss. Initial learning rate momentum coefficient and The values are 0.9 and 0.999 respectively, with a weight decay coefficient of 0.
[0038] To verify the effectiveness of the above technical solution, this embodiment generates a low-quality unstructured mesh with 500 elements, an average mesh quality of 0.420, and a minimum mesh quality of 0.232. Figure 3 As shown.
[0039] like Figure 3 The gradient calculation results of the Green's Gaussian method based on the traditional gradient operator method are as follows for the low-quality unstructured mesh shown: The first-order gradient results in the direction include the true value, the value calculated by the traditional gradient method, and the error value, such as... Figure 4 As shown, (a) shows the true value, (b) shows the value calculated by the conventional gradient method, and (c) shows the error value.
[0040] The first-order gradient results in the direction include the true value, the value calculated by the traditional gradient method, and the error value, such as... Figure 5 As shown, (a) shows the true value, (b) shows the value calculated by the conventional gradient method, and (c) shows the error value.
[0041] The second-order gradient results in the direction include the true value, the value calculated by the traditional gradient method, and the error value, such as... Figure 6 As shown, (a) shows the true value, (b) shows the value calculated by the conventional gradient method, and (c) shows the error value.
[0042] The second-order gradient results in the direction include the true value, the value calculated by the traditional gradient method, and the error value, such as... Figure 7 As shown, (a) shows the true value, (b) shows the value calculated by the conventional gradient method, and (c) shows the error value.
[0043] like Figure 3 The gradient calculation results based on the technical solution of this embodiment under the low-quality unstructured mesh shown are as follows: The first-order gradient result in the direction includes the true value, the calculated value in this embodiment, and the error value, such as... Figure 8 As shown, (a) shows the actual value, (b) shows the calculated value in this embodiment, and (c) shows the error value.
[0044] The first-order gradient result in the direction includes the true value, the calculated value in this embodiment, and the error value, such as... Figure 9 As shown, (a) shows the actual value, (b) shows the calculated value in this embodiment, and (c) shows the error value.
[0045] The second-order gradient results in the direction include the true value, the calculated value in this embodiment, and the error value, such as... Figure 10 As shown, (a) shows the actual value, (b) shows the calculated value in this embodiment, and (c) shows the error value.
[0046] The second-order gradient results in the direction include the true value, the calculated value in this embodiment, and the error value, such as... Figure 11 As shown, (a) shows the actual value, (b) shows the calculated value in this embodiment, and (c) shows the error value.
[0047] based on Figures 4 to 11 By comparison, we draw the following conclusions: using the technical solution of this embodiment for gradient calculation can slightly reduce the first-order gradient error and significantly reduce the second-order gradient error.
[0048] To solve the above technical problems, such as Figure 12 As shown, this embodiment also discloses a physical field gradient calculation system based on graph neural networks. Applying the above-described graph neural network-based physical field gradient calculation method, the system includes: The field data acquisition module is used to acquire physical field data, which includes physical field information and mesh topology relationships. The physical field includes at least the stress field of the engineering component. The primitive gradient operator module is used to obtain the primitive gradient operator based on the mesh topology. The first gradient operator module is used to update the physical field data based on the graph neural network. The first gradient operator is obtained based on the grid topology relationship of the updated physical field data and the original gradient operator. The decoupling module is used to decouple different directions of the physical field in order to set the corresponding directional training weights. The second gradient operator module is used to obtain the second gradient operator based on the original gradient operator, the first gradient operator, and the orientation training weights; The gradient calculation optimization module is used to calculate the gradient of the physical field based on the second gradient operator.
[0049] It should be noted that the physical field gradient calculation system based on graph neural networks in this embodiment corresponds to the aforementioned physical field gradient calculation method based on graph neural networks. Therefore, any content not specifically described in the physical field gradient calculation method based on graph neural networks in this embodiment, including but not limited to functional definitions, working principles, and technical effects, can be referred to the description in the aforementioned physical field gradient calculation method based on graph neural networks, and will not be repeated here.
[0050] To verify the generalization ability of the technical solution in this embodiment in actual physical field simulation, we embed a typical partial differential equation (PDE) solution process. Based on, Figure 13 The grid shown and the corresponding second gradient operator are used to study the effect of the technical solution in this embodiment on the correction of spatial derivatives under unstructured grids and complex boundary conditions. The initial response field and initial gradient field of the high-precision PDE reference solution are calculated using a refined grid to ensure physical consistency.
[0051] based on Figure 13 The grid shown on the left, based on a preset test set, yields (a) as shown. The first-order gradient result in the direction, as shown in (b) The first-order gradient result in the direction, as shown in (c) The second-order gradient results in the direction and (d) are shown. The result of the second-order gradient in the direction.
[0052] Scenario 1: Simulation of transient heat conduction in a temperature stress field based on the transient heat conduction equation based on Figure 13 The grid shown is used to verify the applicability of the technical solution in this embodiment to actual physical field simulation. This study first examines the transient heat conduction problem. The governing equation is defined as: in: For temperature field; Thermal diffusivity reflects the rate at which heat diffuses within a material; aluminum is used as the material parameter. Thermal conductivity, For material density, For constant pressure heat capacity. Computational domain. Using Mode8 medium-density grid ( Apply Dirichlet boundary conditions to the boundary. , This indicates the final moment of the temperature field change.
[0053] Subsequently, based on the obtained temperature field and its gradient, the temperature stress is calculated using the thermoelastic constitutive relation: in: C is the stress tensor; C is the elasticity matrix; For strain tensor; The coefficient of thermal expansion. High-precision temperature gradient. This is a prerequisite for accurately calculating thermal strain and ultimately obtaining a reliable temperature stress field. The unit tensor is used to measure the scalar expansion rate. Transform it into a tensor form that is independent of the coordinate axis direction.
[0054] Numerical experiments show that the technical solution of this embodiment exhibits significant gradient calculation optimization capabilities in transient heat conduction-temperature stress coupled fields. In the gradient estimation process of transient heat conduction problems, the mesh Mode8 performs significantly better than the initial gradient operator of the traditional Green-Gaussian operator. The optimized second gradient operator It can significantly reduce the estimation error of spatial derivatives of different orders and in different directions. For example... Figure 14 and Figure 15 As shown in Figure (14), (a) illustrates First derivative of direction The MAE error decreased by 41.93%, as shown in (b). First derivative of direction The MAE error decreased by 33.19%, as shown in (c). Second derivative of direction The MAE error decreased by 92.65%, as shown in (d). Second derivative of direction The MAE error decreased by 91.19%. In the trained graph network, in scenario one, the orientation weight parameters... , This optimization is particularly significant in regions with drastic changes in boundary curvature, indicating that the directional decoupling gating mechanism adaptively enhances geometric defect compensation, providing high-precision gradient input for subsequent accurate calculations of temperature stress, and fundamentally improving the reliability of thermo-mechanical coupling analysis. Spatiotemporal stability analysis further reveals that, as... Figure 15 As shown, (a) is The true value of the direction, the first-order gradient field corresponding to the traditional gradient method and the method in this embodiment, (b) is The true value of the direction, the first-order gradient field corresponding to the traditional gradient method and the method in this embodiment, (c) is The true value of the direction, the second-order gradient field corresponding to the traditional gradient method and the method in this embodiment, (d) is The true value of the direction, the traditional gradient method, and the second-order gradient field corresponding to the method in this embodiment, when using The response field at time t is used as input, and the following is adopted: When the spatial gradient field at time step is used as the loss during training, the optimization operator is within the time range. The fact that the error reduction rate remained stable within the internal range proves that the technical solution of this embodiment is applicable to the calculation scenario of temperature stress caused by a gradually changing temperature field.
[0055] Scenario 2: Establishing a two-dimensional Poisson equation test scenario to meet the needs of steady-state physical field simulation. based on Figure 13 For the grid shown, we establish a two-dimensional Poisson equation test scenario, with the governing equations as follows: in, The physical field to be solved, such as electric potential and temperature field; For the source term frequency parameter, and , The value is 3.14. A Mode8 mesh is used, and the optimized second gradient operator is verified through variable frequency source terms. Frequency adaptability.
[0056] Numerical experiments show that the technical solution in this embodiment exhibits significant gradient estimation optimization capabilities and adaptability to variable-frequency source terms in the two-dimensional Poisson equation. The sparse mesh Mode8, in the gradient estimation process of the two-dimensional Poisson problem, compared with the initial gradient operator of the traditional Green-Gaussian operator... The optimized second gradient operator It can significantly reduce the estimation error of spatial derivatives of different orders and in different directions. For example... Figure 16 and Figure 17 As shown, at time 1, at Figure 16 In the middle, (a) shows First derivative of direction The MAE error decreased by 32.71%, as shown in (b). First derivative of direction The MAE error decreased by 34.66%, as shown in (c). Second derivative of direction The MAE error decreased by 97.06%, as shown in (d). Second derivative of direction The MAE error decreased by 89.76%. In the trained graph network, in the two-dimensional Poisson equation test scenario, the orientation weight parameters... , This optimization is particularly significant in regions with drastic changes in boundary curvature, indicating that the directional decoupling gating mechanism adaptively enhances the compensation for geometric defects, especially significantly reducing the estimation error of higher-order derivatives of functions. Frequency adaptation analysis shows that, as Figure 17As shown, (a) is The true value of the direction, the first-order gradient field corresponding to the traditional gradient method and the method in this embodiment, (b) is The true value of the direction, the first-order gradient field corresponding to the traditional gradient method and the method in this embodiment, (c) is The true value of the direction, the second-order gradient field corresponding to the traditional gradient method and the method in this embodiment, (d) is The true value of the direction, the second-order gradient field corresponding to the traditional gradient method and the method in this embodiment, when the response field of a single-frequency source term is used as input and the spatial gradient field of the single-frequency source term is used as the loss loss for training, the optimization operator maintains the stability of error reduction within the range, which verifies the adaptability of the technical solution of this embodiment to different frequency spatial source terms, and provides a high-precision gradient estimation basis for physical field simulation with variable spatial source term input.
[0057] Figure 18 This embodiment illustrates the process of optimizing gradient computation based on graph neural networks and strengthening boundary constraints based on partitioning loss functions.
[0058] Based on the above, this embodiment makes the following creative optimizations to the existing gradient calculation: Construct a learnable gradient operator space and reconstruct traditional static operators into trainable components of GNN (Graph Neural Network) to achieve dynamic correction; Execution direction decoupling dynamic gating, along direction and Direction-independent weight optimization solves the direction sensitivity problem; Construct a partition loss function to strengthen boundary constraints and improve the accuracy of boundary gradient estimation.
[0059] It integrates physical priors with data-driven approaches, guided by global physical constraints and corrected by local data, balancing accuracy and generalization.
[0060] Based on the above optimizations, this embodiment achieves at least the following technical effects: This embodiment has a significant effect on meshes of different qualities and densities, with a reduction of more than 33.19% in gradient estimation error for derivatives of all orders in all directions.
[0061] The optimized second gradient operator exhibits an effective spatial frequency adaptation range of 0.88 to 1.94 Hz.
[0062] In the solution framework of the transient heat conduction equation, the second gradient operator obtained based on this embodiment has good time stability, which lays a high-precision gradient estimation foundation for the coupled simulation of complex physical fields, and thus provides an accurate data foundation for structural analysis and other scenarios in civil engineering applications.
[0063] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.
[0064] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0065] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0066] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0067] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for calculating the gradient of a physical field based on a graph neural network, characterized in that, The method includes the following steps: Acquire physical field data, which includes physical field information and mesh topology relationships, and the physical field includes at least the stress field of the engineering component; Based on the aforementioned grid topology, the original gradient operator is obtained; The physical field data is updated based on the graph neural network, and the first gradient operator is obtained based on the grid topology relationship of the updated physical field data and the original gradient operator. Decouple the different directions of the physical field to set corresponding directional training weights; Based on the original gradient operator, the first gradient operator, and the direction training weights, the second gradient operator is obtained; The gradient of the physical field is calculated based on the second gradient operator.
2. The physical field gradient calculation method based on graph neural networks as described in claim 1, characterized in that, The process of obtaining the original gradient operator based on the grid topology includes: The gradient of each triangular unit is reconstructed in discrete form based on Green's-Gauss theorem; The vertex gradient is reconstructed by using an area-weighted average of the gradients of all adjacent cells of the vertex, thus approximating the continuous gradient field by the discrete grid gradient. The weight coefficient matrix of the discrete grid gradient is separated from the response field input, and the decomposed discrete grid gradient weight coefficient matrix is denoted as the initial gradient operator; The physical field grid includes at least an unstructured grid, and a directed graph is constructed based on the unstructured grid as follows: in: For a set of nodes and , For node features, based on the node features Encoding the initial gradient operator ; For edge set and Represents node connectivity and edge features. The mesh topology relationships between the encoded nodes.
3. The physical field gradient calculation method based on graph neural networks as described in claim 2, characterized in that, The method of updating the physical field data based on a graph neural network includes: Based on the sending node Receive node and edge features before update Through multilayer perceptron Output the updated edge features: in, The updated edge features; Aggregation Node All adjacent edge features Combined with the original node features Through multilayer perceptron Output the updated node features: in, This refers to the updated node features.
4. The physical field gradient calculation method based on graph neural networks as described in claim 3, characterized in that, The first gradient operator is obtained based on the updated physical field data, the grid topology, and the original gradient operator, including: The directed graph is updated based on the updated edge features and the updated node features, resulting in the following updated directed graph: in: The updated node set is obtained based on the updated node features, and the first gradient operator is encoded based on the updated node set. ; The updated edge set is obtained based on the updated edge features.
5. The physical field gradient calculation method based on graph neural networks as described in claim 4, characterized in that, The method of decoupling different directions of the physical field to set corresponding direction training weights includes: The mesh structure is as follows direction and Direction, for The first direction training weight is set to... Set the training weights for the second direction.
6. The physical field gradient calculation method based on graph neural networks as described in claim 5, characterized in that, The process of obtaining the second gradient operator based on the original gradient operator, the first gradient operator, and the direction training weights includes: The initial gradient operator and the first gradient operator are adjusted based on the directional decoupling dynamic gating formula to obtain the second gradient operator; wherein, the directional decoupling dynamic gating formula is: in, For the second gradient operator, The weights are trained for the first direction. These are the training weights for the second direction.
7. The physical field gradient calculation method based on graph neural networks as described in claim 1, characterized in that, The method also includes the following steps: Based on the boundary region of the physical field, a partition loss function is obtained; The physical field gradient is calculated based on the partition loss function and the second gradient operator iterative optimization.
8. The physical field gradient calculation method based on graph neural networks as described in claim 7, characterized in that, The partitioning loss function is specifically as follows: in, The weighting parameters are the mean square error of the boundary nodes. The weighting parameter is the mean square error of the internal nodes. For boundary loss, This is an internal loss.
9. The physical field gradient calculation method based on graph neural networks as described in claim 8, characterized in that, The boundary loss and the internal loss are specifically as follows: in, The number of boundary nodes of the grid. The number of internal nodes of the grid. For gradient operators and functions gradient prediction value, This is for analytical gradient solutions or high-precision numerical gradient solutions.
10. A physical field gradient calculation system based on a graph neural network, employing the physical field gradient calculation method based on a graph neural network as described in any one of claims 1-9, characterized in that, The system includes: The field data acquisition module is used to acquire physical field data, which includes physical field information and mesh topology relationships of the physical field, and the physical field includes at least the stress field of the engineering component; The original gradient operator module is used to obtain the original gradient operator based on the mesh topology relationship; The first gradient operator module is used to update the physical field data based on the graph neural network, and to obtain the first gradient operator based on the grid topology relationship of the updated physical field data and the original gradient operator. Decoupling module, used to decouple different directions of the physical field in order to set corresponding directional training weights; The second gradient operator module is used to obtain the second gradient operator based on the original gradient operator, the first gradient operator, and the direction training weights; The gradient calculation optimization module is used to perform gradient calculation of the physical field based on the second gradient operator.
Citation Information
Patent Citations
Complex geometry meshless adaptive discretization method and system
CN117556557A
Network topology intelligent generation method and system based on deep learning and topology analysis
CN120416056A
Variational principle-based neural operator training and partial differential equation system solving integrated method, medium, and product
WO2024198599A1