A finite element mesh graph structure construction method, system, terminal and medium
By segmenting mesh data based on tolerance-based coordinate matching and physical prior knowledge, high-dimensional node and edge feature vectors are constructed, solving the problems of inconsistent finite element mesh node coordinates and fluid data mixing. This achieves efficient finite element mesh graph construction and improves the stability and accuracy of graph neural network models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG UNIV
- Filing Date
- 2026-01-21
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, the inconsistency of finite element mesh node coordinates due to floating-point precision errors and differences in interpolation methods leads to node matching failures, physical field label mismatches, or data loss. Furthermore, in multiphysics simulations, fluid-related physical quantity data are mixed into the solid region, reducing the stability of model training and prediction accuracy. At the same time, graph structures are difficult to fully characterize the boundary characteristics of complex physical fields.
By using a tolerance-based coordinate matching algorithm and prior physical knowledge, the mesh data is segmented into a set of mesh vertex coordinates and a set of cell labels. The edge topology is constructed, the node material properties are identified, the fluid-related physical quantities are corrected, and the boundary semantics are enhanced by unique thermal encoding. High-dimensional node and edge feature vectors are generated to form a standard graph data object.
It improves the integrity and consistency of finite element mesh construction, enhances the ability of graph structures to represent complex physical fields, improves the stability and prediction accuracy of model training, and supports data reuse and model expansion under multiple operating conditions.
Smart Images

Figure CN121580754B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of engineering simulation data processing technology, specifically relating to a finite element mesh structure construction method, system, terminal, and medium. Background Technology
[0002] Finite element analysis (FEM) is a widely used numerical computation method in engineering simulation, applied extensively in scenarios such as power equipment, mechanical structures, and multiphysics coupling analysis. By discretizing the target object into a mesh and solving for the physical field variables at each mesh node or element, FEM can obtain high-precision simulation results. However, with the continuous increase in model size and the number of simulation conditions, traditional FEM simulation has gradually revealed its limitations in computational efficiency, exhibiting long computation times and high resource consumption, making it difficult to meet the demands of rapid prediction and multi-condition analysis. Graph neural networks, as a deep learning model capable of processing non-Euclidean structural data, are increasingly being introduced into the fields of engineering simulation acceleration and surrogate model construction. By mapping the finite element mesh to a graph structure and utilizing graph neural networks to learn and predict the physical field response, computational costs can be reduced and prediction efficiency improved to some extent.
[0003] In existing technologies, finite element simulation software typically exports mesh data and physical field data in text or tabular form. Mesh topology information (such as node coordinates and element connection relationships) and physical field response data are often stored separately in different files, and physical field data is mostly exported based on interpolation points or post-processing coordinates.
[0004] However, due to floating-point precision errors and differences in interpolation methods, the coordinates in the physical field data are not completely consistent with the coordinates of the original grid nodes. This can easily lead to problems such as node matching failure, physical field label mismatch, or data loss during data integration, affecting the integrity and accuracy of subsequent graph structure construction.
[0005] Furthermore, in multiphysics simulation scenarios, finite element models typically include both solid and fluid regions. Existing methods for exporting finite element data often output various physical quantities in a uniform data format, resulting in the presence of fluid-related physical quantity data within the solid region. If this data is directly input into the graph neural network as node features during graph structure construction, it can easily introduce redundant or noisy information inconsistent with actual physical laws, thereby reducing the stability of model training and prediction accuracy.
[0006] Existing methods for constructing graph structures based on finite element meshes mostly focus on establishing geometric topological relationships. They typically generate the edge structure of the graph only based on the node connection relationships, without distinguishing the physical semantics corresponding to the edges. Especially at the fluid-solid interface, the constructed graph structure is difficult to fully represent the boundary characteristics in complex physical fields. Summary of the Invention
[0007] This invention addresses the problems in existing technologies by providing a finite element mesh graph structure construction method, system, terminal, and medium. It solves the problem that in existing technologies, due to floating-point precision errors and differences in interpolation methods, the coordinates in the physical field data are not completely consistent with the coordinates of the original mesh nodes. This leads to problems such as node matching failures, mismatched physical field labels, or data loss during data integration. Furthermore, it addresses the issue that in multiphysics simulation scenarios, finite element models typically include both solid and fluid regions, resulting in fluid-related physical quantity data still existing in the solid region. Directly inputting this data as node features into the graph neural network during graph structure construction easily introduces redundant or noisy information inconsistent with actual physical laws, thereby reducing the stability of model training and prediction accuracy. Finally, it solves the problem that the lack of differentiation of the physical semantics corresponding to edges makes it difficult for the constructed graph structure to fully represent the boundary characteristics in complex physical fields.
[0008] The technical solution adopted in this invention is as follows:
[0009] Firstly, this application provides a method for constructing a finite element mesh structure, which includes the following steps:
[0010] Read the original full grid data and, based on the preset segmentation row numbers, segment the unstructured grid data into a set of grid vertex coordinates and a set of grid cell labels;
[0011] Among them, the grid vertex coordinate set contains the spatial coordinates of all grid points, and the grid cell label set contains the vertex index sequence that constitutes each grid cell;
[0012] Constructing the edge topology of the graph based on the set of grid cell labels;
[0013] Load the physical field data and the set of grid vertex coordinates, and use a tolerance-based coordinate matching algorithm to perform data fusion to complete the mapping of physical field labels and material properties to the corresponding grid nodes;
[0014] Complete the finite element mesh construction.
[0015] Furthermore, when constructing the edge topology of the graph based on the set of grid cell labels, the following steps are included:
[0016] Traverse all grid cells and extract the three edges that make up that cell;
[0017] Sort and remove duplicates from all extracted edges;
[0018] Calculate the Euclidean length of each edge as the initial edge weight feature to generate edge index data.
[0019] Furthermore, when using a tolerance-based coordinate matching algorithm for data fusion, the following steps are included:
[0020] Set a very small tolerance threshold;
[0021] The coordinates in the physical field data are compared with the coordinates of the grid vertex to obtain the matching index.
[0022] Furthermore, the construction method also includes using prior physical knowledge to refine node features:
[0023] Material identification markings for nodes;
[0024] When a node belongs to a solid region, its fluid-related physical quantities are initialized to 0.
[0025] When a node belongs to a fluid region, its original value is retained.
[0026] Furthermore, the construction method also includes semantic enhancement of the graph structure:
[0027] Construct a sparse adjacency matrix based on edge index;
[0028] Traverse all edges, check the material properties of the two nodes connected by the edge, and establish adjacency relationships;
[0029] If the two nodes are made of different materials, mark the edge as a fluid-structure interaction boundary.
[0030] If they are the same, mark them as internal edges;
[0031] Based on the geometric characteristics of the boundary edges, mark their direction attributes;
[0032] The discrete classification features are converted into one-hot encoded vectors. The discrete classification features include material type, boundary type and wall orientation.
[0033] The one-hot encoded vector is concatenated with continuous physical quantities to form the final high-dimensional node feature vector and edge feature vector.
[0034] Furthermore, the process of constructing the finite element mesh includes:
[0035] Using a graph neural network library, the processed high-dimensional node feature vector data, edge feature vector data, and adjacency relationships are read and encapsulated into a standard graph data object, which contains:
[0036] x: Node feature matrix;
[0037] edge_index: Index of the edge's connection relationship;
[0038] edge_attr: Edge feature matrix;
[0039] y: The physical field label corresponding to the node.
[0040] Furthermore, when loading physical field data and mesh vertex coordinate sets, for multi-condition scenarios, the data fusion is repeatedly performed using a tolerance-based coordinate matching algorithm to complete the mapping steps between physical field labels and material properties and corresponding mesh nodes.
[0041] By batch associating physical field response values under different working conditions with the same set of mesh topologies, a multi-working-condition label dataset is generated.
[0042] Secondly, this application provides a finite element mesh structure construction system for implementing the finite element mesh structure construction method as described in the first aspect. The system includes:
[0043] The data parsing module is used to segment the data derived from the original finite element method.
[0044] The topology extraction module is used to extract unique edges from cell labels and calculate edge lengths;
[0045] The feature fusion module is used to match coordinates based on tolerance and fuse physical attributes to nodes;
[0046] The knowledge correction module is used to zero out the fluid physical quantities in the solid region based on the material type.
[0047] The semantic enhancement module is used to identify boundary types and perform one-hot encoding;
[0048] The graph building module is used to instantiate processed data into graph objects usable by GNN.
[0049] Thirdly, this application provides a terminal, including:
[0050] The memory is used to store the finite element mesh structure construction program;
[0051] A processor is used to implement the steps of the finite element mesh structure construction method as described in the first aspect when executing the finite element mesh structure construction apparatus.
[0052] Fourthly, this application provides a computer-readable storage medium that stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes the finite element mesh structure construction method as described in the first aspect.
[0053] As can be seen from the above technical solutions, the advantages of the present invention are:
[0054] By performing structured analysis on the original full mesh data exported from the finite element software, the unstructured mesh text data is accurately segmented into a set of mesh vertex coordinates and a set of mesh element labels. A unique edge topology is then constructed based on the set of element labels. This allows for the complete restoration of the geometric topology of the finite element mesh without relying on the internal data structure of the original finite element software, ensuring the integrity and consistency of the subsequent graph structure construction.
[0055] In the process of fusing physical field data and mesh node data, a tolerance-based coordinate matching mechanism is introduced. By setting a very small tolerance threshold, the coordinates in the physical field data and the coordinates of the mesh vertices are matched with high precision. This effectively solves the problem of inconsistency of node coordinates caused by floating-point precision errors and differences in interpolation methods during the export of finite element simulation data. It also avoids mismatch or loss of physical field labels and significantly improves the correspondence accuracy between node features and physical field responses in the finite element mesh diagram.
[0056] By combining prior physical knowledge to correct node features, solid and fluid regions are distinguished based on the material identifier of the nodes, and the fluid-related physical quantities of nodes belonging to solid regions are initialized. This eliminates the noise information introduced by meaningless fluid physical quantities carried by solid regions in the finite element data, and ensures that the constructed finite element mesh remains consistent in a physical sense. This is beneficial to improving the stability of the subsequent training process based on graph neural network models and the reliability of prediction results.
[0057] In the process of constructing the finite element mesh graph, not only are basic geometric adjacency relationships established, but also the automatic identification and labeling of different boundary types are achieved by analyzing the material properties of the nodes connected by the edges. Furthermore, the directional attributes are extracted by combining the geometric features of the edges, and discrete semantic information such as material type, boundary type and wall direction are encoded. Together with continuous physical quantities, these are used to form high-dimensional node feature vectors and edge feature vectors. Thus, the constructed graph structure contains both geometric and physical semantic information, enhancing the graph structure's ability to express key physical features such as fluid-structure interaction boundaries.
[0058] For multi-condition application scenarios, by batch associating physical field response data corresponding to different conditions under the same set of mesh topology, unified management of multi-condition labels and single mesh structure is achieved, avoiding repeated graph structure construction operations and improving the reuse efficiency of finite element simulation data in multi-condition analysis and model training.
[0059] The processed node features, edge features, and adjacency relationships are encapsulated into standard graph data objects, enabling the constructed finite element mesh graph to be directly used as input data for graph neural networks. This forms a standardized data interface between finite element simulation data and graph neural network models, improving the versatility and scalability of converting engineering simulation data into intelligent prediction models. Attached Figure Description
[0060] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 This is a framework diagram of the finite element mesh structure construction method in the embodiment;
[0062] Figure 2 This is a structural diagram of the finite element mesh structure construction system in the embodiment. Detailed Implementation
[0063] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0064] Please see Figure 1 As shown, this application provides a method for constructing a finite element mesh structure, including the following steps:
[0065] Read the original full grid data and, based on the preset segmentation row numbers, segment the unstructured grid data into a set of grid vertex coordinates and a set of grid cell labels;
[0066] In a specific implementation, the original full mesh data can be a text file or data file exported from finite element simulation software, which contains both mesh node information and element connection information. By pre-determining segmentation line numbers or identifier lines to distinguish different data segments, the continuously stored unstructured data in the original file is split into data sets representing node coordinates and element composition relationships, thereby avoiding manual intervention in the analysis process and improving the automation level of data analysis. In one embodiment, the segmentation line numbers can be pre-configured according to the export format of the finite element software, enabling different types of mesh data to be accurately extracted.
[0067] Among them, the grid vertex coordinate set contains the spatial coordinates of all grid points, and the grid cell label set contains the vertex index sequence that constitutes each grid cell;
[0068] In a specific implementation, the set of grid vertex coordinates is stored in the form of node numbers and corresponding spatial coordinates, which can completely describe the positional relationships of all discrete nodes in the finite element model; the set of grid element labels records which nodes constitute each grid element, thereby characterizing the element topology of the grid. In one embodiment, the index sequence in the set of grid element labels can correspond to triangular elements or other types of element structures, which are used to derive the edge relationships in the graph structure from the element level.
[0069] Constructing the edge topology of the graph based on the set of grid cell labels;
[0070] In a specific implementation, by analyzing the node combination relationships of each element in the mesh element label set, the interconnected nodes within each element are considered as adjacent nodes in the graph structure, thereby establishing the initial edge topology of the graph. This process does not rely on the mesh representation method within the finite element software, but is derived entirely based on the element label information, thus ensuring the consistency of the constructed graph topology with the original finite element mesh in terms of geometric connectivity.
[0071] Load the physical field data and the set of grid vertex coordinates, and use a tolerance-based coordinate matching algorithm to perform data fusion to complete the mapping of physical field labels and material properties to the corresponding grid nodes;
[0072] In specific implementations, physical field data is typically exported by finite element software during the post-processing stage, and its coordinate information may have slight deviations from the original mesh node coordinates. By simultaneously loading the physical field data and the mesh vertex coordinate set, and introducing a tolerance-based coordinate matching algorithm, the coordinate correspondence is established within a very small allowable error range, thereby accurately mapping the physical field values and material properties to the corresponding mesh nodes. In one embodiment, this matching process can avoid node matching failures caused by differences in floating-point precision, improving the integrity of data fusion.
[0073] Complete the finite element mesh construction.
[0074] In a specific implementation, once the node coordinates, topology, physical field labels, and material properties are successfully fused, a finite element mesh structure containing node features, edge structure, and physical field response information can be obtained, providing a basic data object for subsequent modeling and analysis based on graph neural networks.
[0075] In some embodiments, when constructing the edge topology of a graph based on a set of grid cell labels, the following steps are included:
[0076] Traverse all grid cells and extract the three edges that make up that cell;
[0077] In a specific implementation, by reading the node index sequence corresponding to each grid cell one by one, the connection between any two adjacent nodes within the cell is regarded as a candidate edge, thereby extracting the set of edges contained in the cell. In one embodiment, for a cell consisting of three nodes, its three corresponding edges can be directly extracted as candidate edges.
[0078] Sort and remove duplicates from all extracted edges;
[0079] In specific implementations, since different grid cells may share the same edges, after summarizing all candidate edges, it is necessary to sort and deduplicate them to remove duplicate edge relationships, thereby ensuring that each edge in the graph structure is recorded only once. In one embodiment, duplicate edges are effectively identified by normalizing and sorting the node indices connected to the edges.
[0080] Calculate the Euclidean length of each edge as the initial edge weight feature to generate edge index data.
[0081] In a specific implementation, the geometric length of the edge is calculated based on the spatial coordinates of the nodes at both ends of the edge, and this length is used as a continuous feature describing the geometric relationship between nodes to characterize the spatial relative positional relationship between nodes. Simultaneously, edge index data describing the node connection relationships is generated, providing necessary topological information for subsequent graph structure instantiation.
[0082] In some embodiments, when using a tolerance-based coordinate matching algorithm for data fusion, the following steps are included:
[0083] Set a very small tolerance threshold;
[0084] In a specific implementation, a preset minimum tolerance threshold is set based on the accuracy requirements of the finite element simulation data to determine whether two coordinate points can be considered as the same physical location. This tolerance threshold balances matching accuracy and algorithm stability, avoiding misjudgments caused by numerical errors.
[0085] The coordinates in the physical field data are compared with the coordinates of the grid vertex to obtain the matching index.
[0086] In a specific implementation, by comparing the coordinates in the physical field data one by one with the coordinate set of the grid vertices, a correspondence is established when a tolerance threshold condition is met, thereby obtaining the mapping index from the physical field data to the grid nodes. In one embodiment, this mapping index is used to accurately assign physical field labels to the corresponding graph nodes in the subsequent process.
[0087] In some embodiments, the construction method further includes modifying node features using prior physical knowledge:
[0088] Material identification markings for nodes;
[0089] In a specific implementation, each mesh node is assigned a corresponding material identifier based on the material partitioning information defined in the finite element model, in order to distinguish regions with different physical properties.
[0090] When a node belongs to a solid region, its fluid-related physical quantities are initialized to 0.
[0091] In a specific implementation, when a node is identified as a solid region, its corresponding fluid-related physical quantities are initialized to eliminate fluid parameters that have no physical meaning in the solid region and avoid introducing redundant or noise information.
[0092] When a node belongs to a fluid region, its original value is retained.
[0093] In a specific implementation, for nodes belonging to the fluid region, the original physical field data exported from the finite element simulation are directly retained to fully reflect the true physical state of the fluid region.
[0094] In some embodiments, the construction method further includes semantic enhancement of the graph structure:
[0095] Construct a sparse adjacency matrix based on edge index;
[0096] In a specific implementation, the adjacency representation of the graph is constructed based on the aforementioned generated edge index data, so that the graph structure is stored in a sparse form, reducing storage overhead and improving subsequent processing efficiency.
[0097] Traverse all edges, check the material properties of the two nodes connected by the edge, and establish adjacency relationships;
[0098] In a specific implementation, the relationship between nodes corresponding to each edge is analyzed by reading the material identification information of the nodes at both ends of the edge, thus providing a basis for the semantic classification of the edge.
[0099] If the two nodes are made of different materials, mark the edge as a fluid-structure interaction boundary.
[0100] If they are the same, mark them as internal edges;
[0101] In a specific implementation, the edges are classified into fluid-structure interaction boundaries or internal connections based on whether the node materials are consistent, thereby explicitly distinguishing edge types with different physical meanings in the graph structure.
[0102] Based on the geometric characteristics of the boundary edges, mark their direction attributes;
[0103] In a specific implementation, by analyzing the directional characteristics of the edges in space, corresponding directional attributes are assigned to the edges to further describe the orientation relationship of the boundaries in physical space.
[0104] The discrete classification features are converted into one-hot encoded vectors. The discrete classification features include material type, boundary type and wall orientation.
[0105] In a specific implementation, the aforementioned discrete semantic information is encoded so that it can be used together with continuous numerical features as input features of the graph neural network.
[0106] The one-hot encoded vector is concatenated with continuous physical quantities to form the final high-dimensional node feature vector and edge feature vector.
[0107] In a specific implementation, semantic features and physical quantity features are represented in a unified manner by feature splicing, so that nodes and edges simultaneously possess geometric information, physical information and semantic information.
[0108] In some embodiments, the construction of the finite element mesh includes:
[0109] Using a graph neural network library, the processed high-dimensional node feature vector data, edge feature vector data, and adjacency relationships are read and encapsulated into a standard graph data object, which contains:
[0110] x: Node feature matrix;
[0111] edge_index: Index of the edge's connection relationship;
[0112] edge_attr: Edge feature matrix;
[0113] y: The physical field label corresponding to the node.
[0114] In a specific implementation, by calling the graph data interface provided by the existing graph neural network framework, node features, edge features, and topological relationships are uniformly encapsulated into standardized graph data objects, so that the constructed finite element mesh graph can be directly used as input data for the graph neural network model, thereby simplifying the subsequent model construction and training process.
[0115] In some embodiments, when loading physical field data and mesh vertex coordinate sets, for multi-condition scenarios, the data fusion is performed repeatedly using a tolerance-based coordinate matching algorithm to complete the mapping steps between physical field labels and material properties and corresponding mesh nodes.
[0116] By batch associating physical field response values under different working conditions with the same set of mesh topologies, a multi-working-condition label dataset is generated.
[0117] In a specific implementation, for the same finite element mesh structure, corresponding physical field data are exported under different operating conditions. By repeatedly executing coordinate matching and data fusion processes, the physical field responses under different operating conditions are uniformly mapped to the same set of mesh nodes, thereby achieving centralized management of multi-condition data. In one embodiment, this method can form a dataset containing multiple sets of physical field labels without repeatedly constructing the graph topology, improving data reuse efficiency.
[0118] In one embodiment, a specific implementation process is given for converting transformer COMSOL simulation data into graph data objects that can be processed by graph neural networks using the method of the present invention.
[0119] First, data preparation was performed. Temperature field simulation calculations of the target transformer were conducted using the multiphysics simulation software COMSOL, and a text file named "comsol mesh export.txt" containing complete finite element mesh information was exported after the simulation. This file is arranged in the default COMSOL export format, with the first 921,895 lines containing the three-dimensional spatial coordinates of all mesh nodes, followed by element label data describing the relationships between each finite element. The raw data obtained in this way fully reflects the geometric topology and physical calculation basis corresponding to the transformer temperature field simulation.
[0120] After data acquisition, segmentation and topology extraction are performed. Specifically, a pre-written data parsing script is run to read the "comsol mesh all export.txt" file line by line. At line 921895, a segmentation operation is performed, splitting the original file into "mesh vertex coordinates.txt" (storing mesh vertex coordinates) and "mesh element label.txt" (storing mesh element label information). The mesh element label data is then traversed and parsed, extracting the node index combinations that constitute each finite element element. Based on the relationships between adjacent nodes, all potential undirected edge relationships are identified, thus constructing the edge topology of the finite element mesh. During this process, duplicate edges are uniformly sorted and deduplicated. Furthermore, the Euclidean distance between the two nodes connected by each edge is calculated as the initial geometric feature of the edge, ultimately forming an edges.txt file containing approximately 2.7 million edge information entries, providing basic data support for subsequent graph structure construction.
[0121] After topology extraction, feature fusion and correction processing is performed. Specifically, the "physical field vertex coordinates.txt" file containing the physics simulation results and the "initial state parameters.txt" file describing the initial physical state parameters are read. To address the issue of different coordinate sources and minor accuracy errors between the physics data and the finite element mesh nodes, a tolerance-based coordinate matching algorithm is used for data fusion. In this embodiment, the MATLAB function `ismembertol` is called, and the tolerance threshold is set to 1×10⁻⁶. -10 This method achieves a one-to-one matching mapping between physical field data coordinates and mesh vertex coordinates. Through this approach, physical field values such as temperature, velocity components, and pressure are accurately mapped to their corresponding mesh nodes. Subsequently, a knowledge correction mechanism based on engineering physics priors is introduced to further process the node features: when a node's material ID is detected as 2, corresponding to the copper conductor region on the grid side, the fluid-related physical quantities Vx, Vy, and pressure P of that node are forcibly initialized to 0; while when the node's material ID is 0, corresponding to the oil medium region inside the transformer, its original simulation calculation results remain unchanged. Through the above correction processing, a 15-dimensional node feature vector containing information such as node spatial coordinates, thermal property parameters, and material properties is obtained, and the processing results are uniformly saved to the nodes.txt file.
[0122] After the node features are constructed, the graph structure undergoes further boundary semantic enhancement processing. Specifically, all edge information obtained in the aforementioned topology extraction stage is traversed, and the material properties of the two nodes connected to each edge are examined. When the material type of node A connected to an edge is oil medium, while the material type of node B is copper conductor, the edge is marked as an oil-copper fluid-structure interaction boundary; if the material properties of the nodes at both ends of the edge are the same, the edge is marked as an internal boundary type. Based on the above boundary identification results, discrete attributes such as material ID and boundary type are subjected to one-thermal encoding to expand the semantic dimension of node features and edge features, so that the graph structure not only reflects geometric topological relationships, but also explicitly represents the physical boundary information between fluid and solid regions.
[0123] After constructing node features, edge features, and topological relationships, graph object generation is performed. Specifically, a data processing script written in Python calls the Data interface in the graph neural network library torch_geometric to load the high-dimensional node features stored in nodes.txt into a node feature matrix x, and load the edge connectivity and edge weight information stored in edges.txt into edge_index and edge_attr tensors respectively. The corresponding physics field labels are also encapsulated as node supervision labels, generating a standard graph data object conforming to the graph neural network input specification. Finally, the constructed graph data object is saved as a .pt file for subsequent training, inference, and physics field prediction tasks based on the MFGAT model.
[0124] Please see Figure 2 As shown, in some embodiments, this application provides a finite element mesh structure construction system for implementing a finite element mesh structure construction method, the system comprising:
[0125] The data parsing module is used to segment the data derived from the original finite element method.
[0126] The topology extraction module is used to extract unique edges from cell labels and calculate edge lengths;
[0127] The feature fusion module is used to match coordinates based on tolerance and fuse physical attributes to nodes;
[0128] The knowledge correction module is used to zero out the fluid physical quantities in the solid region based on the material type.
[0129] The semantic enhancement module is used to identify boundary types and perform one-hot encoding;
[0130] The graph building module is used to instantiate processed data into graph objects usable by GNN.
[0131] In this embodiment, the finite element mesh graph structure construction system is deployed and runs on a general-purpose computing platform. The system can run as an independent data preprocessing program or be integrated into a simulation analysis platform or a graph neural network training platform to achieve automated conversion of finite element simulation data to graph structure data. The modules of the system are sequentially connected through preset data interfaces, with the output of the previous module serving as the input of the next module, thus forming a complete data processing pipeline.
[0132] In this embodiment, the data parsing module is configured to receive the raw full data file exported by the finite element simulation software. This raw data file contains node coordinate data and element label data, and the two types of data are stored consecutively in the same file according to a preset order. During operation, the data parsing module parses the raw data file line by line, splitting it into a mesh vertex coordinate dataset and a mesh element label dataset based on pre-defined line numbers or data format identifiers, and storing them as independent data files or data objects respectively. This method avoids repeated parsing of unstructured raw data in subsequent processing, improving overall processing efficiency.
[0133] In this embodiment, the topology extraction module is communicatively connected to the data parsing module and is used to traverse the mesh element label dataset. When parsing each finite element element, the topology extraction module extracts the node index combinations that constitute that element and identifies the connecting edges between nodes based on the node index relationships. For identical edge relationships that appear repeatedly in different elements, the topology extraction module performs sorting and deduplication operations to ensure that each edge is recorded only once in the topology structure. Simultaneously, the topology extraction module calculates the corresponding geometric length based on the spatial coordinate information of the nodes at both ends of the edge and stores this length as the initial attribute of the edge, thereby constructing a complete and non-redundant finite element mesh edge topology structure.
[0134] In this embodiment, the feature fusion module is configured to load physical field simulation data and mesh vertex coordinate data. Since the physical field data and finite element mesh nodes may originate from different computational processes during generation, resulting in slight numerical deviations in the coordinates, the feature fusion module employs a tolerance-based coordinate matching strategy. It compares the physical field data coordinates with the mesh vertex coordinates one by one, establishing a mapping relationship under the condition of meeting a preset tolerance threshold. Through this mapping relationship, physical field attributes such as temperature, velocity, and pressure are accurately fused into the corresponding mesh node features, ensuring that each node simultaneously possesses both geometric and physical field information.
[0135] In this embodiment, the knowledge correction module is connected to the feature fusion module and is used to correct the physical rationality of node features after the physical property mapping is completed. The knowledge correction module determines the physical region to which a node belongs based on its material type identifier. When a node is identified as belonging to a solid region, the knowledge correction module uniformly sets the fluid-related physical quantities of that node to zero according to the physical prior rules of fluid-structure interaction; when a node belongs to a fluid region, its physical field values remain unchanged. This correction mechanism avoids the erroneous introduction of fluid physical quantities into solid regions, thereby improving the physical consistency and reliability of node features in the graph structure.
[0136] In this embodiment, the semantic enhancement module is used to further introduce boundary semantic information based on the topology and node features. The semantic enhancement module traverses all edge connections, reads the material properties of the nodes at both ends of each edge, and determines whether the edge is a boundary between different physical regions based on the material combination relationship. Edges connecting nodes of different material types are marked as fluid-structure interaction boundaries or material interface edges; edges connecting nodes of the same material type are marked as internal boundaries. Subsequently, the semantic enhancement module performs one-hot encoding on discrete attributes such as material type and boundary type, and incorporates the encoding results as additional semantic features into the node feature vector or edge feature vector to enhance the graph structure's ability to express physical boundary relationships.
[0137] In this embodiment, the graph construction module is configured to receive node feature data, edge index data, and edge feature data processed by the aforementioned module, and encapsulate them uniformly according to the input specifications of the graph neural network framework. The graph construction module organizes node features into a node feature matrix, edge connections into an edge index data structure, and edge geometric and semantic attributes into an edge feature matrix, thereby generating a standardized graph data object. The generated graph data object can be directly used as input to a graph neural network model for subsequent physics prediction, simulation acceleration, or multi-condition learning tasks.
[0138] In some embodiments, this application provides a terminal, including:
[0139] The memory is used to store the finite element mesh structure construction program;
[0140] A processor is used to execute the steps of the finite element mesh structure construction method when the finite element mesh structure construction system is used.
[0141] In some embodiments, this application provides a computer-readable storage medium that stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes the finite element mesh structure construction method.
[0142] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the protection scope of one or more embodiments of this specification.
Claims
1. A method for constructing a finite element mesh structure, characterized in that, Includes the following steps: Read the original full grid data and, based on the preset segmentation row numbers, segment the unstructured grid data into a set of grid vertex coordinates and a set of grid cell labels; Among them, the grid vertex coordinate set contains the spatial coordinates of all grid points, and the grid cell label set contains the vertex index sequence that constitutes each grid cell; Constructing the edge topology of the graph based on the set of grid cell labels; When constructing the edge topology of a graph based on a set of grid cell labels, the following steps are included: Traverse all grid cells and extract the set of edges that make up the grid cells; Sort and remove duplicates from all extracted edges; Calculate the Euclidean length of each edge as the initial edge weight feature, and generate edge index data based on the initial edge weight feature; Load the physical field data and the set of grid vertex coordinates, and use a tolerance-based coordinate matching algorithm to perform data fusion to complete the mapping of physical field labels and material properties to the corresponding grid nodes; The construction method includes semantic enhancement of the graph structure: Construct a sparse adjacency matrix based on edge index data; Traverse all edges, check the material properties of the two nodes connected by the edge, and establish adjacency relationships; If the two nodes are made of different materials, mark the edge as a fluid-structure interaction boundary. If they are the same, mark them as internal edges; Based on the geometric characteristics of the boundary edges, mark their direction attributes; The discrete classification features are converted into one-hot encoded vectors. The discrete classification features include material type, boundary type and wall orientation. The one-hot encoded vector is concatenated with continuous physical quantities to form the final high-dimensional node feature vector and edge feature vector; The process of constructing the finite element mesh includes: Using a graph neural network library, we read the processed high-dimensional node feature vector data, edge feature vector data, and adjacency relationships, and encapsulate all the data into a standard graph data object. Complete the finite element mesh construction.
2. The finite element mesh structure construction method according to claim 1, characterized in that, When using a tolerance-based coordinate matching algorithm for data fusion, the following steps are included: Set a very small tolerance threshold; The coordinates in the physical field data are compared with the coordinates of the grid vertex to obtain the matching index.
3. The finite element mesh structure construction method according to claim 1 or 2, characterized in that, The construction method also includes using prior physical knowledge to refine node features: Material identification markings for nodes; When a node belongs to a solid region, its fluid-related physical quantities are initialized to 0. When a node belongs to a fluid region, its original value is retained.
4. The finite element mesh structure construction method according to claim 3, characterized in that, Standard graph data objects include: x: Node feature matrix; edge_index: Index of the edge's connection relationship; edge_attr: Edge feature matrix; y: The physical field label corresponding to the node.
5. The finite element mesh structure construction method according to claim 1, characterized in that, When loading physical field data and mesh vertex coordinate sets, for multiple working scenarios, the data fusion is performed repeatedly using a tolerance-based coordinate matching algorithm to complete the mapping steps between physical field labels and material properties and corresponding mesh nodes. By batch associating physical field response values under different working conditions with the same set of mesh topologies, a multi-working-condition label dataset is generated.
6. A finite element mesh structure construction system, used to implement the finite element mesh structure construction method as described in claim 1, characterized in that, The system includes: The data parsing module is used to segment the data derived from the original finite element method. The topology extraction module is used to extract unique edges from cell labels and calculate edge lengths; The feature fusion module is used to match coordinates based on tolerance and fuse physical attributes to nodes; The knowledge correction module is used to zero out the fluid physical quantities in the solid region based on the material type. The semantic enhancement module is used to identify boundary types and perform one-hot encoding; The graph building module is used to instantiate processed data into graph objects usable by GNN.
7. A terminal, characterized in that, include: The memory is used to store the finite element mesh structure construction program; A processor is configured to implement the steps of the finite element mesh structure construction method as described in claim 1 when executing the finite element mesh structure construction program.
8. A computer-readable storage medium, characterized in that, The storage medium stores computer instructions. When the computer reads the computer instructions from the storage medium, the computer executes the finite element mesh structure construction method as described in claim 1.