Grid data processing method, device, electronic device and storage medium
By parsing and lightweight processing the original geometric model files, a universal grid data structure is generated, which solves the problem of separate storage of geometric models and grid data and diverse data structures, and realizes lightweight storage and fast query of grid data. Adapt format output to different solvers.
Patent Information
- Application Number
- CN202311648732.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2043-12-04
AI Technical Summary
In the existing technology, geometric models and grid data are stored separately, and the data structures are diverse, which makes unified storage, query and management difficult, and it is difficult to meet the format requirements of different solvers.
By obtaining the original geometric model file, parsing the original mesh data, performing lightweight processing to generate lightweight mesh data, discretizing the data to generate spatial discrete unit data, and coupling them to form a target mesh with a universal mesh data structure. Data to achieve unified organization of geometric models and mesh data.
It realizes lightweight storage and fast query of grid data, facilitates the format output of different solvers, and improves the management efficiency and query speed of grid data.
Smart Images

Figure CN117785869B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for processing grid data. Background Art
[0002] Numerical simulation technology is an important means to promote the development of aero-engines. The pre-processing stage includes geometric pre-processing and meshing. In the process of computer data processing, it is necessary to reasonably express the mesh data. At the same time, in order to hand over the mesh data to the solver for calculation, it is necessary to output an intermediate file in a specific format for a specific solver type.
[0003] However, in the related art, the geometric model and mesh data are generally stored separately, and the data structure of the mesh data is diverse, which is not conducive to unified storage, query and management. Summary of the invention
[0004] In view of this, exemplary embodiments of the present disclosure provide a method, device, electronic device and storage medium for processing grid data to solve the problems existing in the related art.
[0005] According to a first aspect of the exemplary embodiments of the present disclosure, a method for processing grid data is provided, the method comprising:
[0006] Acquire an original geometric model file of the target object, and parse the original geometric model file to obtain original mesh data;
[0007] Performing lightweight processing on the original mesh data according to a preset lightweight rule to obtain lightweight mesh data; generating a target geometric model of the target object based on the lightweight mesh data;
[0008] Discretizing the target geometric model to generate spatial discrete unit data;
[0009] The first characteristic data of the target geometric model and the second characteristic data of the spatial discrete unit data are coupled to generate target grid data.
[0010] According to a second aspect of the exemplary embodiments of the present disclosure, there is provided a grid data processing device, the device comprising:
[0011] An acquisition module is used to acquire the original geometric model file of the target object;
[0012] A parsing module, used for parsing the original geometric model file to obtain original mesh data;
[0013] A first processing module is used to perform lightweight processing on the original mesh data according to a preset lightweight rule to obtain lightweight mesh data; and generate a target geometric model of the target object based on the lightweight mesh data;
[0014] A second processing module is used to discretize the target geometric model to generate spatial discrete unit data;
[0015] The generating module is used to couple the first characteristic data of the target geometric model and the second characteristic data of the spatial discrete unit data to generate target mesh data.
[0016] According to a third aspect of the exemplary embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor; a memory for storing at least one processor executable instruction; wherein the at least one processor is used to execute instructions to implement the steps of the above method.
[0017] According to a fourth aspect of the exemplary embodiments of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the steps of the above method.
[0018] At least one of the above-mentioned technical solutions adopted in the exemplary embodiment of the present disclosure can achieve the following beneficial effects: by acquiring the original geometric model file of the target object and parsing the original geometric model file, the original mesh data is obtained; the original mesh data is lightweight processed according to the preset lightweight rules to obtain lightweight mesh data; the target geometric model of the target object is generated based on the lightweight mesh data; the target geometric model is discretized to generate spatial discrete unit data; the first characteristic data of the target geometric model and the second characteristic data of the spatial discrete unit data are coupled to generate the target mesh data, and the target mesh data with a general mesh data structure can be generated. The target mesh data not only includes the first characteristic data of the target geometric model, but also includes the second characteristic data of the spatial discrete unit data. While lightweighting the original mesh data, the geometric model and the mesh data are unified and organized, which facilitates the rapid query and indexing of the geometric model and the mesh data. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the exemplary embodiments of the present disclosure, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1A schematic flow chart of a method for processing grid data provided by an exemplary embodiment of the present disclosure is shown;
[0021] Figure 2 A schematic diagram showing the structure of a grid data processing device provided by an exemplary embodiment of the present disclosure is shown;
[0022] Figure 3 A schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present disclosure is shown;
[0023] Figure 4 A schematic diagram of the structure of a computer system provided by an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0024] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0025] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0026] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0027] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0028] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0029] An exemplary embodiment of the present disclosure provides a method for processing mesh data. A general mesh data structure that couples a unified geometric model with mesh data is designed based on mesh features. The method can conveniently express a variety of mesh data and realize the organization, lightweight, fast query and indexing of geometric models and mesh data. At the same time, based on the general mesh data structure, after the mesh data is generated, the mesh data file required by any solver can be directly output in the memory according to the mesh data file format that is quickly set in any solver, so as to prepare for the simulation solution stage.
[0030] The mesh data processing method provided by the exemplary embodiments of the present disclosure may be executed by a terminal or by a chip applied to the terminal.
[0031] Exemplarily, the above-mentioned terminal may include one or more of a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), and a wearable device based on augmented reality (AR) and / or virtual reality (VR) technology, etc., and the exemplary embodiments of the present disclosure do not impose specific limitations on this.
[0032] Figure 1 FIG. 2 is a flow chart showing a method for processing grid data provided by an exemplary embodiment of the present disclosure. Figure 1 As shown, the grid data processing method includes:
[0033] S101, obtaining an original geometric model file of a target object and parsing the original geometric model file to obtain original mesh data;
[0034] S102, performing lightweight processing on the original mesh data according to a preset lightweight rule to obtain lightweight mesh data; generating a target geometric model of the target object based on the lightweight mesh data;
[0035] S103, discretizing the target geometric model to generate spatial discrete unit data;
[0036] S104, coupling the first characteristic data of the target geometric model and the second characteristic data of the spatial discrete unit data to generate target mesh data.
[0037] Specifically, the original geometric model file can be an original file formed after modeling the target object using any modeling software (such as CAD), and the original geometric model file can be used for numerical simulation. The format of the original geometric model file can be one of the formats such as x_t, step and sat, and the exemplary embodiment of the present disclosure does not specifically limit this. The exemplary embodiment of the present disclosure can parse the original geometric model file using a geometry engine to obtain original mesh data.
[0038] Since the original mesh data contains a large amount of data, and some of the data is not necessary for the subsequent formation of spatial discrete unit data and numerical simulation applications, in order to lightweight the original mesh data, the exemplary embodiment of the present disclosure can perform lightweight processing on the original mesh data according to a preset lightweight rule, remove the data that is not necessary for the subsequent formation of spatial discrete unit data and numerical simulation applications, and obtain lightweight mesh data. These lightweight mesh data can include all the geometric properties required for mesh generation and numerical simulation.
[0039] Here, the preset lightweight rule may be determined according to the requirement of subsequently generating spatial discrete unit data, and the exemplary embodiment of the present disclosure does not specifically limit this.
[0040] Based on this, the exemplary embodiment of the present disclosure can generate a target geometric model of a target object based on lightweight mesh data; then, discretize the target geometric model to generate spatial discrete unit data; couple the first characteristic data of the target geometric model and the second characteristic data of the spatial discrete unit data to generate target mesh data. The target mesh data has a general mesh data structure, which includes not only the first characteristic data of the target geometric model, but also the second characteristic data of the spatial discrete unit data. While lightweighting the original mesh data, it realizes the unified arrangement of the geometric model and the mesh data, and facilitates the rapid acquisition and indexing of the geometric model and the mesh data.
[0041] According to the technical solution of the exemplary embodiment of the present disclosure, the original geometric model file of the target object is obtained and the original geometric model file is parsed to obtain the original mesh data; the original mesh data is lightweight processed according to the preset lightweight rule to obtain the lightweight mesh data; the target geometric model of the target object is generated based on the lightweight mesh data; the target geometric model is discretized to generate spatial discrete unit data; the first characteristic data of the target geometric model and the second characteristic data of the spatial discrete unit data are coupled to generate the target mesh data, and the target mesh data with a general mesh data structure can be generated, and the target mesh data not only includes the first characteristic data of the target geometric model, but also includes the second characteristic data of the spatial discrete unit data. While lightweighting the original mesh data, the unified organization of the geometric model and the mesh data is realized, which facilitates the rapid acquisition and indexing of the geometric model and the mesh data.
[0042] In some embodiments, performing lightweight processing on the original mesh data according to a preset lightweight rule to obtain lightweight mesh data may include:
[0043] Target geometric attribute information is extracted from the original mesh data according to a preset lightweight rule; the target geometric attribute information is used as lightweight mesh data, and the target geometric attribute information is related to points, lines, and surfaces of the target object.
[0044] Specifically, the preset lightweight rules here can refer to the above text and will not be repeated here. In the method of the exemplary embodiment of the present disclosure, the process of obtaining lightweight mesh data can be regarded as a screening process of the original mesh data, and unnecessary data in the original mesh data is filtered, and the target geometric attribute information that meets the preset lightweight rules in the original mesh data is extracted as lightweight mesh data. Among them, the target geometric attribute information can be the original mesh data related to the points, lines and surfaces of the target object.
[0045] According to the technical solution of the example embodiment of the present disclosure, by extracting target geometric attribute information from the original mesh data according to preset lightweight rules; using the target geometric attribute information as lightweight mesh data, the target geometric attribute information is related to the points, lines and surfaces of the target object, the original mesh data can be lightweight processed, and the target geometric attribute information in the original mesh data that meets the preset lightweight rules can be extracted as lightweight mesh data, thereby facilitating lightweight storage and management of mesh data.
[0046] In some embodiments, the spatial discrete unit data may include multiple spatial discrete units, and discretizing the target geometric model to generate the spatial discrete unit data may include:
[0047] The target geometric model is meshed according to a preset mesh generation rule to obtain mesh data of at least one shape; and a plurality of spatial discrete units are generated based on the mesh data of at least one shape.
[0048] Specifically, when discretizing the target geometric model, the exemplary embodiment of the present disclosure may use a mesh generation algorithm to mesh the target geometric model to obtain mesh data of at least one shape. Here, the mesh data of at least one shape includes one or more of triangular mesh data, quadrilateral mesh data, tetrahedral mesh data, and hexahedral mesh data, etc., and the exemplary embodiment of the present disclosure does not specifically limit this. The mesh order of the mesh data of at least one shape may include linear units, second-order units, etc.; the mesh type of the mesh data of at least one shape may include one-dimensional meshes, two-dimensional meshes, three-dimensional meshes, etc. The spatial discrete unit can determine the coordinate information of all mesh nodes through the unique identifier of the mesh node.
[0049] Then, the exemplary embodiment of the present disclosure can generate multiple spatial discrete units based on the mesh data of at least one shape. At this time, the target geometric model of the target object can be formed by multiple spatial discrete units. The target geometric model can be generated by mesh data of the same shape or by mesh data of multiple shapes, which is not specifically limited by the exemplary embodiment of the present disclosure.
[0050] According to the technical solution of the exemplary embodiment of the present disclosure, the spatial discrete unit data may include multiple spatial discrete units, and the grid data of at least one shape is obtained by gridding the target geometric model according to a preset grid generation rule; multiple spatial discrete units are generated based on the grid data of at least one shape, and the target geometric model can be discretized into multiple spatial discrete units generated by the grid data of at least one shape, and the target grid data can be characterized by the second characteristic data of these spatial discrete units.
[0051] In some embodiments, the first feature data may include points, edges, surfaces, and volumes; the method may further include:
[0052] The target grid data is marked to obtain a target identifier of the target grid data; the first characteristic data of the target geometric model included in the target grid data is obtained according to a preset acquisition rule using the target identifier, and the preset acquisition rule satisfies the principle of top-down one-way search and two-way surjection.
[0053] Specifically, the first characteristic data of the target geometric model may include points, edges, surfaces and volumes.
[0054] In practical applications, the target grid data may be marked to obtain a target identifier corresponding to the target grid data; then, when it is necessary to obtain the first characteristic data of the target geometric model included in the target grid data, the target identifier may be used for query.
[0055] When querying the first characteristic data of the target geometric model included in the target mesh data, the data can be acquired according to a preset acquisition rule. Here, the preset acquisition rule satisfies the principle of top-down one-way search and two-way surjection.
[0056] When querying the first characteristic data of the target geometric model included in the target mesh data, the data hierarchy structure of the target geometric model included in the target mesh data can be set to components (such as several geometric models), entities (target geometric models), faces, lines, and points. This data hierarchy structure not only meets the universality, but also meets the lightweight requirements, and facilitates the query and indexing of the target geometric model.
[0057] According to the technical solution of the example embodiment of the present disclosure, the first feature data may include points, edges, faces and volumes, and the target identification of the target mesh data is obtained by marking the target mesh data; using the target identification, the first feature data of the target geometric model included in the target mesh data is obtained according to the preset acquisition rules. The preset acquisition rules satisfy the principles of top-down one-way search and two-way surjection, and can realize fast query and indexing of the first feature data of the target geometric model included in the target mesh data.
[0058] In some embodiments, the second feature data may include nodes, units, line sets, surface sets, and volume sets; the method may also include:
[0059] Create a one-way linked list of spatial discrete unit data; use the target identifier to obtain the one-way linked list of spatial discrete unit data corresponding to the target grid data; and obtain the second characteristic data of the spatial discrete unit data according to the one-way linked list.
[0060] Specifically, the second characteristic data of the spatial discrete unit data may include nodes, units, line sets, surface sets, and volume sets.
[0061] For any set of target grid data, the exemplary embodiments of the present disclosure need to create a one-way linked list for the spatial discrete unit data corresponding to the target grid data, so as to query or obtain the second characteristic data of the spatial discrete unit data.
[0062] Exemplarily, based on nodes and units, the exemplary embodiment of the present disclosure designs a node data structure, constructs triangular face units, tetrahedral units, quadrilateral face units, hexahedral units, and triangular prism units with nodes as the smallest units, and constructs line sets, face sets, and volume sets based on units, forming a universal grid data structure.
[0063] Exemplarily, the data hierarchy structure of the spatial discrete unit data included in the target mesh data is realized by creating a one-way linked list, which is used to store the mesh nodes and mesh cells of the target object. Different geometric faces or different geometric features create different one-way linked lists. Each one-way linked list stores the mesh nodes and mesh cells corresponding to a geometric feature (geometric vertices, geometric edges, geometric faces), thereby facilitating the subsequent retrieval of data.
[0064] Exemplarily, the one-way linked list of spatial discrete unit data may include the following class members: the total number of nodes in the grid (i.e., the spatial discrete unit in the previous text), the total number of grid cells, the total grid node list (traversable), the total grid cell list (traversable), grid attributes, etc., and the target identifier of the target grid data bound to the grid.
[0065] The node list traversal method is to construct a one-way linked list, which contains three parts: the address pointing to the previous linked list node; the address pointing to the next linked list node; and the data contained in the node. In the exemplary embodiment of the present disclosure, the address pointing to the next linked list node is empty, so the linked list is only a one-way linked list.
[0066] Exemplarily, the unique identifier of the target geometric model bound to the spatial discrete unit data (also called a grid set) represents the unique identifier of the geometric feature bound to the current grid set. A group of grid sets is bound to each geometric feature. A group of grid sets is expressed by a one-way linked list. A one-way linked list consists of a subordinate address (address) and its own grid unit data (data). The subordinate address points to the memory address where the next grid unit is located. Through the one-way linked list, it is possible to traverse from the first grid unit on the geometric feature to the last grid unit. The own grid data, namely the grid attribute data, contains information such as the unique identifier of the grid node and the node coordinates. The grid unit contains information such as the unique identifier of the unit, the unique identifier of the grid node, the grid type, the grid order, and the grid shape.
[0067] Exemplarily, all generated mesh data (information such as unique identification of the mesh, mesh shape, mesh type, etc.) can be uniformly stored in an intermediate data structure in the memory to facilitate subsequent reading and writing.
[0068] According to the technical solution of the example embodiment of the present disclosure, the second characteristic data may include nodes, units, line sets, surface sets and volume sets; by creating a one-way linked list of spatial discrete unit data; using a target identifier to obtain a one-way linked list of spatial discrete unit data corresponding to the target grid data; obtaining the second characteristic data of the spatial discrete unit data according to the one-way linked list, it is possible to quickly query and index the second characteristic data of the spatial discrete unit data included in the target grid data through the one-way linked list.
[0069] In practical applications, the exemplary embodiments of the present disclosure can design the topological association and data association between the target geometric model and the spatial discrete unit data to form a one-to-one mapping, so that the second characteristic data of the spatial discrete unit data can be queried in the target geometric model, and the first characteristic data of the target geometric model can be queried in the spatial discrete unit data, thereby constructing a unified and universal general data structure that couples the target geometric model with the spatial discrete unit data.
[0070] In some embodiments, the method may further include:
[0071] Determine a target conversion format of the target grid data; and convert the target grid data into a target grid data file in the target conversion format.
[0072] Specifically, taking the target conversion format as a bdf file as an example, after the target mesh data of the pre-processing stage is stored in the general data structure, the data is written into the bdf file according to the order of material properties, mesh units, and mesh nodes. After confirming the file format to be written, the target mesh data in the general mesh data structure can be directly written in the format required by the solver. For example, the information required by the bdf file is as follows: mesh unit attribute card, mesh node attribute card, mesh material attribute card, etc.
[0073] Exemplarily, in the process of writing mesh unit data, it is necessary to determine the content of the calculation file to be written according to the mesh unit type. For example, for a bdf file, if it is judged to be a 0-dimensional unit, that is, a mass scalar unit, it is necessary to write the bdf keyword PMASS / CMASS1; if it is judged to be a one-dimensional unit, the bdf keyword to be written is PBAR / CBAR; if it is judged to be a two-dimensional unit and the unit type is a triangular mesh, and the unit order is first-order, it is necessary to write the bdf keyword PSHELL / CTRIA3, if it is second-order, the keyword is PSHELL / CTRIA6; if the mesh type is a quadrilateral and the mesh order is first-order, the keyword is PSHELL / CQUAD4, if it is second-order, the keyword is PSHELL / CQUAD8; if it is judged to be a three-dimensional unit, according to the shape of the three-dimensional unit, such as a tetrahedron, a triangular pyramid, and a hexahedron, the bdf keywords are written as PSOLID / CTETRA, PSOLID / CPENTA, and PSOLID / CHEXA respectively.
[0074] If it contains a judgment statement on whether the grid unit and node data are written correctly, a status value is returned for each write statement. If the status value is 0, it is written correctly. If the status value is not 0, it means that the writing process is wrong.
[0075] Through the above processing, unified expression of pre-processed grid data and standardized output interface are achieved.
[0076] According to the technical solution of the exemplary embodiment of the present disclosure, by determining the target conversion format of the target grid data; converting the target grid data into a target grid data file in the target conversion format, the target grid data with a general grid data structure can be converted into a target grid data file in the target conversion format, which is convenient for the needs of numerical simulation software, realizes unified management of grid data, and prepares for the solution calculation stage.
[0077] The scheme of the exemplary embodiment of the present disclosure is further illustrated below with complete examples.
[0078] 1. Parse the geometric model file (x_t / step / sat) of numerical simulation according to the geometry engine, and according to the requirements of the mesh generation algorithm, lightweight standard geometric model, associate geometric data, and form all geometric properties that can be used for mesh generation and numerical simulation.
[0079] 1.1. Input geometric data and split the geometric information into multiple part information through the geometric file path; obtain the part type through the geometric engine interface function. If the type is a monomer, store it directly in the body list. If the type is an assembly, perform the following operations: First, read the instance information contained in the assembly through the Parasolid interface. The instance information contains the part information, transformation matrix information and assembly information. If the part in the instance is judged to be an assembly, repeat the above steps to iteratively read the part information.
[0080] 1.2. Save entities as solid class, where solid class contains the following class member variables: vertex list, edge list, face list, mesh seeds on vertices, mesh seeds on edges, mesh seeds on faces, existing mesh unit information, existing mesh node information, RGB information, etc.
[0081] 2. Use a self-developed mesh generation algorithm to form spatial discrete units composed of triangles, quadrilaterals, tetrahedrons, and hexahedrons. In order to meet the calculation requirements of geometric points, edges, faces, bodies, and mesh nodes, units, line sets, face sets, and body sets, determine the elements contained in the general data structure;
[0082] 2.1. Each grid set needs to be bound to a geometry ID. Similarly, each geometric feature is bound to a grid set. A grid set is expressed by a one-way linked list. A one-way linked list consists of a subordinate address (address) and its own grid unit data (data). The subordinate address points to the memory address where the next grid unit is located. Through the one-way linked list, you can traverse from the first grid unit on the geometric feature to the last grid unit. The grid data itself is the grid attribute data, which includes information such as grid node ID and node coordinates. The grid unit contains information such as unit ID, grid node ID, grid type, grid order, and grid shape.
[0083] 3. According to the principle of top-down one-way search and two-way surjection, a data hierarchy structure of lightweight geometry including parts, entities, surfaces, lines and points is designed;
[0084] 3.1. The data hierarchy is implemented by creating a one-way linked list. Different geometric faces or different geometric features create different one-way linked lists. Each one-way linked list stores the mesh nodes and mesh units corresponding to a geometric feature (geometric vertex, geometric edge, geometric face), so as to facilitate the subsequent retrieval and use of data.
[0085] 4. Based on nodes and units, a node data structure is designed. With nodes as the smallest unit, triangle face units, tetrahedron units, quadrilateral face units, hexahedron units, and triangular prism units are constructed. Based on units, line sets, face sets, and volume sets are constructed, forming a universal grid data structure.
[0086] 4.1. The geometry ID bound to the mesh indicates the geometry feature ID bound to the current mesh set. Each geometry feature is bound to a set of mesh sets, which are expressed by a one-way linked list. A one-way linked list consists of a subordinate address and its own mesh unit data. The subordinate address points to the memory address where the next mesh unit is located. Through the one-way linked list, it is possible to traverse from the first mesh unit on the geometry feature to the last mesh unit. The mesh data itself is the mesh attribute data, which includes mesh node ID, node coordinates and other information. The mesh unit contains unit ID, mesh node ID, mesh type, mesh order, mesh shape and other information.
[0087] 5. Design the topological association and data association between geometry and mesh data to form a one-to-one mapping, realize the query of mesh collection in geometry, query of geometric elements in mesh, and build a unified and universal data structure for coupling geometry and mesh;
[0088] 5.1. Define a unified data structure, including the integer number of grid cells numElem, the integer number of grid nodes numNode, a linked list type grid cell list, a linked list type grid node list, a geometric feature ID, a geometric coordinate data and other information.
[0089] 5.2. The linked list type grid unit and node list is defined as a structure type hfLIST, which includes the structure member forward pointer hfLIST*prev, the backward pointer type hfLIST*next, and the list member data. Through this linked list structure, the data of each grid unit and node can be iterated.
[0090] 6. In order to verify the correctness and completeness of the general data structure, taking the BDF file calculated by finite element solution as an example, the geometry and mesh coupling general data structure is converted and output as a BDF file.
[0091] 6.1. Open the bdf file to be written and write the header data. The content is mainly presented in the form of annotation information, including title, time, etc. Create a material card in the bdf file. Isotropic materials are defined by data card MAT1.
[0092] 6.2. Loop through the grid data and write the grid cell data into the bdf file. Since the data structure of the grid has been defined before, the grid cell data is obtained through iteration in the form of a one-way linked list. First, confirm whether the member variable numElem in the structure variable is consistent with the number of nodes in the cell linked list. At the same time, determine the content to be written into the bdf file based on the cell type.
[0093] 6.3. If the cell type is judged to be a 0-dimensional cell, that is, a mass scalar cell, the bdf keyword CMASS1 needs to be written; if it is judged to be a one-dimensional cell, the bdf keyword CBAR needs to be written; if it is judged to be a two-dimensional cell and the cell type is a triangular mesh, and the cell order is first-order, the bdf keyword CTRIA3 needs to be written, and if it is second-order, the keyword is CTRIA6; if the mesh type is a quadrilateral and the mesh order is first-order, the keyword is CQUAD4, and if it is second-order, the keyword is CQUAD8; if it is judged to be a three-dimensional cell, according to the different cell shapes, such as tetrahedron, triangular prism, and hexahedron, the bdf keywords CTETRA, CPENTA, and CHEXA are written respectively.
[0094] 6.4. Loop through the grid data and write the grid node information into the bdf file. For each grid node, take the x, y, and z coordinate values of the node, which are xyz[0], xyz[1], and xyz[2] respectively. If the translation transformation matrix is included, each coordinate value needs to be added with the product of the corresponding position value of the transformation matrix and the original coordinate, for example, xyz[0]+=transMatrix*xyz[0]. Close the bdf file, end the file writing with the keyword ENDDATA, and return the status value status.
[0095] The above mainly introduces the solutions provided by the exemplary embodiments of the present disclosure. It is understandable that in order to implement the above functions, the electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present disclosure.
[0096] The exemplary embodiments of the present disclosure can divide the functional units of the electronic device according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the exemplary embodiments of the present disclosure is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0097] In the case of dividing each functional module according to each function, an exemplary embodiment of the present disclosure provides a mesh data processing device, which may be an electronic device or a chip applied to an electronic device. Figure 2 FIG. 2 shows a schematic diagram of a structure of a grid data processing device provided by an exemplary embodiment of the present disclosure. Figure 2 As shown, the device 200 includes:
[0098] An acquisition module 201 is used to acquire an original geometric model file of a target object;
[0099] The parsing module 202 is used to parse the original geometric model file to obtain original mesh data;
[0100] The first processing module 203 is used to perform lightweight processing on the original mesh data according to a preset lightweight rule to obtain lightweight mesh data; and generate a target geometric model of the target object based on the lightweight mesh data;
[0101] The second processing module 204 is used to discretize the target geometric model to generate spatial discrete unit data;
[0102] The generating module 205 is used to couple the first characteristic data of the target geometric model and the second characteristic data of the spatial discrete unit data to generate target mesh data, wherein the target mesh data has a general mesh data structure.
[0103] In some embodiments, the first processing module 203 is further used to extract target geometric attribute information from the original mesh data according to a preset lightweight rule; and use the target geometric attribute information as lightweight mesh data, wherein the target geometric attribute information is related to points, lines, and surfaces of the target object.
[0104] In some embodiments, the spatial discrete unit data includes multiple spatial discrete units, and the second processing module 204 is also used to grid the target geometric model according to preset grid generation rules to obtain grid data of at least one shape; and generate the multiple spatial discrete units based on the grid data of at least one shape.
[0105] In some embodiments, the mesh data of the at least one shape includes one or more of triangular mesh data, quadrilateral mesh data, tetrahedral mesh data, hexahedral mesh data, and the like.
[0106] In some embodiments, the first feature data includes points, edges, faces and volumes; the acquisition module 201 is also used to mark the target mesh data to obtain a target identifier of the target mesh data; using the target identifier, the first feature data of the target geometric model included in the target mesh data is acquired according to a preset acquisition rule, and the preset acquisition rule satisfies the principle of top-down one-way search and two-way surjection.
[0107] In some embodiments, the second feature data includes nodes, units, line sets, surface sets and volume sets; the apparatus 200 further includes: a creation module 206, for creating a one-way linked list of the spatial discrete unit data;
[0108] The acquisition module 201 is further used to acquire the one-way linked list of the spatial discrete unit data corresponding to the target grid data using the target identifier; and acquire the second characteristic data of the spatial discrete unit data according to the one-way linked list.
[0109] In some embodiments, the apparatus 200 further includes: a conversion module 207, configured to determine a target conversion format of the target mesh data; and convert the target mesh data into a target mesh data file in the target conversion format.
[0110] The exemplary embodiments of the present disclosure also provide an electronic device, comprising: at least one processor; a memory for storing at least one processor-executable instruction; wherein the at least one processor is used to execute the instruction to implement the steps of the above method disclosed in the exemplary embodiments of the present disclosure.
[0111] Figure 3 FIG. 1 shows a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present disclosure. Figure 3 As shown, the electronic device 300 includes at least one processor 301 and a memory 302 coupled to the processor 301 . The processor 301 can execute corresponding steps in the above method disclosed in the exemplary embodiment of the present disclosure.
[0112] The processor 301 may also be referred to as a central processing unit (CPU), which may be an integrated circuit chip having signal processing capabilities. Each step in the method disclosed in the exemplary embodiment of the present disclosure may be completed by an integrated logic circuit of hardware in the processor 301 or by instructions in the form of software. The processor 301 may be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in conjunction with the exemplary embodiment of the present disclosure may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a memory 302, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, or other mature storage media in the art. The processor 301 reads the information in the memory 302 and completes the steps of the method in conjunction with its hardware.
[0113] In addition, when various operations / processes according to the present disclosure are implemented by software and / or firmware, they can be transmitted from a storage medium or a network to a computer system having a dedicated hardware structure, for example, Figure 4 The computer system 400 shown is installed with the programs constituting the software. When the various programs are installed, the computer system can perform various functions, including the functions described above. Figure 4 A schematic diagram of the structure of a computer system provided by an exemplary embodiment of the present disclosure is shown.
[0114] Computer system 400 is intended to represent various forms of digital electronic computer equipment, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0115] like Figure 4 As shown, the computer system 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the computer system 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0116] A plurality of components in the computer system 400 are connected to the I / O interface 405, including: an input unit 406, an output unit 407, a storage unit 408, and a communication unit 404. The input unit 406 may be any type of device capable of inputting information to the computer system 400, and the input unit 406 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 407 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 408 may include, but is not limited to, a disk, an optical disk. The communication unit 409 allows the computer system 400 to exchange information / data with other devices over a network such as the Internet, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, for example, a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0117] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above. For example, in some embodiments, the above methods disclosed in the exemplary embodiments of the present disclosure may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via ROM 402 and / or communication unit 409. In some embodiments, the computing unit 401 may be configured to perform the above methods disclosed in the exemplary embodiments of the present disclosure by any other appropriate means (e.g., by means of firmware).
[0118] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium, wherein when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the above method disclosed in the exemplary embodiments of the present disclosure.
[0119] The computer-readable storage medium in the exemplary embodiment of the present disclosure may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. The above-mentioned computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the above. More specifically, the above-mentioned computer-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0120] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0121] The exemplary embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor, the above method disclosed in the exemplary embodiments of the present disclosure is implemented.
[0122] In embodiments of the present disclosure, computer program codes for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer.
[0123] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0124] The modules, components or units involved in the exemplary embodiments described in the present disclosure may be implemented by software or hardware, wherein the names of the modules, components or units do not, in some cases, limit the modules, components or units themselves.
[0125] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0126] The above descriptions are only some embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, a technical solution formed by replacing the above features with the technical features with similar functions disclosed in the present disclosure (but not limited to).
[0127] Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. It should be understood by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A method for processing grid data, characterized in that: include: Acquire an original geometric model file of the target object, and parse the original geometric model file to obtain original mesh data; Performing lightweight processing on the original mesh data according to a preset lightweight rule to obtain lightweight mesh data; generating a target geometric model of the target object based on the lightweight mesh data; Discretizing the target geometric model to generate spatial discrete unit data; The first characteristic data of the target geometric model and the second characteristic data of the spatial discrete unit data are coupled to generate target grid data, wherein the target grid data has a general grid data structure; The first feature data includes points, edges, surfaces and volumes; the method further includes: Marking the target grid data to obtain a target identifier of the target grid data; Using the target identifier, first feature data of the target geometric model included in the target mesh data is acquired according to a preset acquisition rule, wherein the preset acquisition rule satisfies the principle of top-down one-way search and bidirectional surjection; The second characteristic data includes nodes, units, line sets, surface sets and volume sets; the method further includes: Creating a one-way linked list of the spatial discrete unit data; Using the target identifier, obtaining a one-way linked list of the spatial discrete unit data corresponding to the target grid data; Acquire second characteristic data of the spatial discrete unit data according to the one-way linked list; The data hierarchy structure of the spatial discrete unit data included in the target grid data is realized by creating a one-way linked list; based on nodes and units, a node data structure is designed, and triangular face units, tetrahedral units, quadrilateral face units, hexahedral units, and triangular prism units are constructed with nodes as the smallest units; line sets, face sets, and volume sets are constructed based on units to form a general grid data structure.
2. The method according to claim 1, characterized in that The step of performing lightweight processing on the original mesh data according to a preset lightweight rule to obtain lightweight mesh data includes: Extracting target geometric attribute information from the original mesh data according to a preset lightweight rule; The target geometric attribute information is used as lightweight mesh data, and the target geometric attribute information is related to the points, lines and surfaces of the target object.
3. The method according to claim 1, characterized in that: The spatial discrete unit data includes a plurality of spatial discrete units, and the discretization process is performed on the target geometric model to generate the spatial discrete unit data, including: Meshing the target geometric model according to a preset mesh generation rule to obtain mesh data of at least one shape; The plurality of spatially discrete units are generated based on the mesh data of the at least one shape.
4. The method according to claim 3, characterized in that The mesh data of the at least one shape includes one or more of triangular mesh data, quadrilateral mesh data, tetrahedral mesh data and hexahedral mesh data.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Determining a target conversion format of the target grid data; The target mesh data is converted into a target mesh data file in the target conversion format.
6. A grid data processing device, characterized in that: include: An acquisition module is used to acquire the original geometric model file of the target object; A parsing module, used for parsing the original geometric model file to obtain original mesh data; A first processing module, configured to perform lightweight processing on the original mesh data according to a preset lightweight rule to obtain lightweight mesh data; generating a target geometric model of the target object based on the lightweight mesh data; A second processing module is used to discretize the target geometric model to generate spatial discrete unit data; A generating module, used for coupling the first characteristic data of the target geometric model and the second characteristic data of the spatial discrete unit data to generate target grid data, wherein the target grid data has a general grid data structure; The first feature data includes points, edges, faces and bodies; the acquisition module is further used to mark the target mesh data to obtain the target identifier of the target mesh data; using the target identifier, the first feature data of the target geometric model included in the target mesh data is acquired according to a preset acquisition rule, and the preset acquisition rule satisfies the principle of top-down one-way search and bidirectional surjection; The second characteristic data includes nodes, units, line sets, surface sets and volume sets; the device also includes: a creation module, which is used to create a one-way linked list of the spatial discrete unit data; The acquisition module is further used to acquire the one-way linked list of the spatial discrete unit data corresponding to the target grid data using the target identifier; and acquire the second characteristic data of the spatial discrete unit data according to the one-way linked list; The data hierarchy structure of the spatial discrete unit data included in the target grid data is realized by creating a one-way linked list; The generation module is also used to design a node data structure based on nodes and units, to construct triangular face units, tetrahedral units, quadrilateral face units, hexahedral units, and triangular prism units with nodes as the smallest units, and to construct line sets, face sets, and volume sets based on units to form a general grid data structure.
7. An electronic device, characterized in that: include: at least one processor; a memory for storing the at least one processor-executable instruction; The at least one processor is used to execute the instructions to implement the steps of the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the steps of the method as claimed in any one of claims 1 to 5.
