Interactive grid division module design method, software construction method and device

By designing an interactive meshing module, we solved the architectural design deficiencies and data conversion defects of the meshing module in domestic software, achieved efficient meshing and visualization, and improved user experience and accuracy.

CN118657023BActive Publication Date: 2025-09-26WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410922775.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2025-09-26
Estimated Expiration
2044-07-10

AI Technical Summary

Technical Problem

The architectural design of the interactive meshing module of domestic finite element simulation software is insufficient, resulting in the coupling of user interface operations with back-end processing logic, lack of advanced information transmission in model data conversion, and lack of functional interaction logic, which affects the accuracy and efficiency of meshing.

Method used

An interactive meshing module is designed to determine the functional architecture class diagram, build data conversion relationships and topological mappings between Open CASCADE and Gmsh models, implement meshing and visualization, and enhance user interaction experience and operation guidance.

Benefits of technology

It improves the development efficiency and user experience of the meshing module, realizes the complete transmission of topological information, improves the accuracy and efficiency of meshing, and enhances deep interactivity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657023B_ABST
    Figure CN118657023B_ABST
Patent Text Reader

Abstract

The present invention provides an interactive meshing module design method, software construction method, and device. The interactive meshing module design method includes: determining an interactive meshing function based on meshing requirements, and determining a functional architecture class diagram of the meshing module based on the interactive meshing function; constructing a data conversion relationship and topological mapping between an Open CASCADE-based geometric model and a Gmsh-based mesh model; meshing the geometric model based on the functional architecture class diagram, data conversion relationship, and topological mapping to obtain a mesh model; and visualizing the mesh model based on mesh model visualization technology. The present invention facilitates the flexible expansion and maintenance of the interactive meshing function, achieves seamless conversion and efficient association of meshing-related model data from different sources, ensures the integrity of all necessary geometric and topological information during the conversion process, and enhances the efficiency and accuracy of meshing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of finite element simulation, and in particular to a method for designing modules related to interactive geometric modeling, a method for constructing software, and a device. Background Art

[0002] At the forefront of today's engineering design and scientific research, the importance of finite element simulation software as a powerful simulation tool is self-evident. It plays a core role in many fields such as structural mechanics, fluid mechanics, heat conduction, and electromagnetism. It is particularly noteworthy that meshing, as the cornerstone of finite element analysis, directly affects the accuracy and reliability of simulation results. It requires that complex solid models be accurately converted into a set of high-quality discrete units to support efficient and accurate computational analysis. Domestic software has shown obvious limitations in the key function of interactive meshing, especially in several key points related to user experience and functional integrity. Specifically, these challenges are concentrated in:

[0003] Architectural design deficiencies: The interactive meshing module's related functions lack architectural design, which not only leads to excessive coupling between user interface operations and back-end processing logic, reducing the system's scalability and maintainability, but also limits the user experience. Users face complex operational processes and insufficient feedback when performing meshing, making it difficult to efficiently control and understand the entire process.

[0004] Deficiencies in model data conversion: In practical applications, it is often necessary to process model data generated by different tools, such as geometric models created by Open CASCADE and mesh models output by Gmsh. However, current domestic software has significant deficiencies in the conversion and integration of these model data. It only completes basic node and element information conversion, but ignores the complete transfer of advanced information such as topology. This directly affects the accuracy and efficiency of meshing.

[0005] Lack of functional interaction logic: The lack of deep interactive design for the meshing function results in users not receiving timely operational guidance and feedback on erroneous operations during the operation process, and being unable to effectively utilize automated algorithms to optimize mesh settings, affecting overall modeling efficiency and mesh quality.

[0006] In view of this, there is an urgent need to provide an architectural design scheme for the interactive meshing module of finite element modeling and simulation software to promote the flexible expansion and maintenance of the interactive meshing function, realize the seamless conversion and efficient association of meshing-related model data from different sources, ensure the integrity of all necessary geometric and topological information during the conversion process, improve the user's interactive experience, and enhance the efficiency and accuracy of meshing. Summary of the Invention

[0007] In view of this, it is necessary to provide an interactive mesh partitioning module design method, software construction method and device, aiming to solve the technical problems existing in the existing technology, such as insufficient architectural design, neglect of the complete transmission of advanced information such as topological structure, and lack of functional interaction logic, which lead to low accuracy and efficiency of mesh partitioning.

[0008] In order to solve the above technical problems, the present invention provides, on the one hand, an interactive meshing module design method, comprising:

[0009] Determine an interactive meshing function according to meshing requirements, and determine a functional architecture class diagram of a meshing module based on the interactive meshing function;

[0010] Construct data conversion relationship and topological mapping between Open CASCADE-based geometric models and Gmsh-based mesh models;

[0011] Meshing the geometric model based on the functional architecture class diagram, the data conversion relationship, and the topological mapping to obtain the mesh model;

[0012] The grid model is visualized based on a grid model visualization technology.

[0013] In one possible implementation, the interactive meshing function includes an interactive seeding function, and the interactive seeding function is used to:

[0014] Acquire a topological structure in the geometric model that can be used for seeding operations, and highlight the topological structure;

[0015] responding to a selection operation of the topology and receiving a seed distribution parameter;

[0016] The seed distribution parameters are assigned to the geometric model to obtain a seed space distribution result, and the seed space distribution result is visualized.

[0017] In a possible implementation, the interactive meshing function further includes a meshing strategy setting function, and the meshing strategy setting function is used to:

[0018] In response to a division selection instruction for each target component in the geometric model, a target grid division method and a target division unit type are determined from preset grid division methods and division unit types;

[0019] Assigning the target grid division mode and the target division unit type to each target component;

[0020] The geometric model is traversed, and each target component is displayed in a differentiated manner based on the grid division method.

[0021] In a possible implementation, the construction of a data conversion relationship and topological mapping between an Open CASCADE-based geometric model and a Gmsh-based mesh model includes:

[0022] Based on the Open CASCADE geometric model file reading and writing method, the geometric model is written into a temporary storage file;

[0023] Based on the Gmsh geometric model file reading method, the temporary storage file is read to import the geometric model to obtain the Gmsh geometric model, and a meshing operation is performed on the Gmsh geometric model in response to the meshing parameters to obtain the mesh model;

[0024] A topological mapping relationship is established between the topological structures of the geometric model and the mesh model.

[0025] In a possible implementation, establishing a data conversion relationship and a topological mapping between the topological structures of the geometric model and the mesh model includes:

[0026] Reading the geometric model and the Gmsh geometric model based on the Open CASCADE geometric model file reading and writing method and the Gmsh geometric model file reading method respectively;

[0027] Traversing the topological structures in the geometric model and the Gmsh geometric model, and assigning topological structure numbers in sequence;

[0028] Performing a meshing operation on the Gmsh geometric model to obtain the mesh model, and extracting a topological structure corresponding to the Gmsh geometric model from the mesh model;

[0029] The topological structure number of the geometric model is matched with the topological structure number of the mesh model to construct a topological mapping relationship.

[0030] In a possible implementation, visualizing the grid model based on a grid model visualization technology includes:

[0031] Determining unit and node information of the grid model;

[0032] Based on the geometric model construction method of Open CASCADE, the unit and node information are processed to form a mesh visualization model based on Open CASCADE;

[0033] Based on the component visualization mechanism in the grid division module, each component in the grid visualization model is visualized and displayed.

[0034] In one possible implementation, the Open CASCADE-based geometric model construction method processes the unit and node information to form an Open CASCADE-based mesh visualization model, including:

[0035] Construct the initial mesh visualization model based on the Open CASCADE geometric model construction method;

[0036] Determining the geometric characteristics, number of nodes, and node connection order of each unit based on the type attributes in the unit and node information;

[0037] The geometric features, the number of nodes, and the node connection order are added to the initial mesh visualization model to obtain the mesh visualization model.

[0038] In a possible implementation, before displaying the components, the method further includes:

[0039] In response to the component display instruction, determining whether the component is a gridded component or an ungridded component;

[0040] If the component is a meshed component, the mesh visualization model is displayed; if the component is an unmeshed component, the geometric model is displayed.

[0041] On the other hand, the present invention also provides a simulation software construction method, comprising:

[0042] Construct an interactive meshing module based on its design method;

[0043] The design method of the interactive mesh division module is the design method of the interactive mesh division module in any one of the possible implementations described above.

[0044] In another aspect, the present invention further provides a design device for an interactive meshing module, comprising:

[0045] A functional architecture class diagram determining unit, configured to determine an interactive meshing function according to meshing requirements, and determine a functional architecture class diagram of a meshing module based on the interactive meshing function;

[0046] Data conversion mapping unit, used to build data conversion relationship and topological mapping between Open CASCADE-based geometric model and Gmsh-based mesh model;

[0047] A mesh model division unit, configured to perform mesh division on the geometric model based on the functional architecture class diagram, the data conversion relationship, and the topological mapping to obtain the mesh model;

[0048] The visualization display unit is used to visualize the grid model based on the grid model visualization technology.

[0049] The beneficial effects of the present invention are as follows: the present invention determines a functional architecture class diagram of a mesh partitioning module based on an interactive mesh partitioning function, and enables users to efficiently control and understand the entire mesh partitioning process through the functional architecture class diagram, thereby improving the development efficiency and user experience of the mesh partitioning module.

[0050] Moreover, the present invention realizes the mapping of high-level information, i.e., topological information, by constructing a data conversion relationship and topological mapping between an Open CASCADE-based geometric model and a Gmsh-based mesh model. This not only realizes the data conversion of nodes and units in the geometric model and the mesh model, but also realizes the complete transmission of nodes, units, and topological information, thereby improving the accuracy and efficiency of mesh division.

[0051] Furthermore, the meshing function in the present invention is an interactive meshing function, which can enhance the depth of interactivity in the meshing process, allowing users to receive timely operational guidance and feedback on erroneous operations during the operation process, further improving the efficiency of meshing and mesh quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the 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 work.

[0053] Figure 1 A schematic structural diagram of an embodiment of the finite element simulation system provided by the present invention;

[0054] Figure 2 A schematic flow chart of an embodiment of the interactive mesh partitioning module design method provided by the present invention;

[0055] Figure 3 A schematic diagram of an embodiment of the interactive seeding operation provided by the present invention;

[0056] Figure 4 A schematic diagram of the structure of an embodiment of a finite state machine for interactive seeding operations provided by the present invention;

[0057] Figure 5 A schematic diagram of a flow chart of an embodiment of the grid partitioning strategy setting function provided by the present invention;

[0058] Figure 6A schematic diagram of the structure of an embodiment of a finite state machine for the grid partitioning strategy setting function provided by the present invention;

[0059] Figure 7 A schematic structural diagram of an embodiment of a functional architecture class diagram of a grid partitioning module provided by the present invention;

[0060] Figure 8 For the present invention Figure 2 A schematic flow chart of an embodiment of S202;

[0061] Figure 9 For the present invention Figure 8 A schematic flow chart of an embodiment of S803;

[0062] Figure 10 For the present invention Figure 2 A schematic flow chart of an embodiment of S204;

[0063] Figure 11 Design class diagrams for the structure of the geometric model, grid model, and grid visualization model data of the present invention;

[0064] Figure 12 A schematic structural diagram of an embodiment of a design device for an interactive grid division module provided by the present invention. DETAILED DESCRIPTION

[0065] The following will provide a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0066] It should be understood that the schematic drawings are not drawn to scale. The flowcharts used in the present invention illustrate operations implemented according to some embodiments of the present invention. It should be understood that the operations of the flowcharts can be implemented out of sequence, and steps that have no logical contextual relationship can be reversed in order or implemented simultaneously. In addition, those skilled in the art, guided by the content of the present invention, can add one or more other operations to the flowcharts or remove one or more operations from the flowcharts. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and / or processor systems and / or microcontroller systems.

[0067] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0068] The present invention provides an interactive grid partitioning module design method, a software construction method and a device, which are respectively described below.

[0069] The interactive meshing module design method in the embodiment of the present invention relies on a finite element simulation system with a multi-level architecture. Therefore, before presenting the embodiment, the finite element simulation system with a multi-level architecture proposed in the embodiment of the present invention is first described. Figure 1 As shown, the multi-layered finite element simulation system 10 includes an interactive interface layer 100, a functional module layer 200, a business logic layer 300, and a data access layer 400. This architecture decouples the interactive interface layer 100 from the other layers, specifically the user interface operations from the backend processing logic, improving the scalability and maintainability of the interactive meshing module development process.

[0070] Figure 2 A schematic diagram of an embodiment of the interactive grid division module design method provided by the present invention is shown in FIG. Figure 2 As shown in Figure 2, the interactive meshing module design method includes:

[0071] S201. Determine an interactive meshing function according to meshing requirements, and determine a functional architecture class diagram of a meshing module based on the interactive meshing function.

[0072] S202, constructing a data conversion relationship and topological mapping between the geometric model based on Open CASCADE and the mesh model based on Gmsh;

[0073] S203, meshing the geometric model based on the functional architecture class diagram, data conversion relationship, and topological mapping to obtain a mesh model;

[0074] S204: Visualize the grid model based on grid model visualization technology.

[0075] Among them, step S204 is based on Figure 1 The interactive interface layer 100 in step S201 is to develop a mesh model visualization technology based on OpenCASCADE. The functional architecture diagram of the mesh partitioning module in step S201 is designed based on Figure 1The functional module layer 200 in step S202 is based on the business logic layer 300. The data conversion relationship and topology mapping in step S202 are established based on the business logic layer 300. The data access layer 400 is used to provide the data foundation for steps S201-S204. The data access layer 400 is designed with data structures related to the geometric model, mesh model, and mesh visualization model data related to the interactive meshing function.

[0076] Specifically, to implement interactive meshing, a meshing module must be developed at the functional module layer 200, where the interactive meshing architecture must be designed. To achieve the association between geometric models and mesh models, the business logic layer 300 must develop data conversion relationships and topological mappings between Open CASCADE-based geometric models and Gmsh-based mesh models, and the data access layer 400 must construct a mesh model data structure to support this functionality. To achieve mesh model visualization, Open CASCADE-based mesh model visualization technology must be developed at the interactive interface layer 100. Each layer is interconnected and interdependent, working together to complete the interactive meshing functionality required by the meshing module.

[0077] Compared with the existing technology, the embodiment of the present invention sets a functional architecture class diagram of the grid division module based on the interactive grid division function. The functional architecture class diagram allows users to efficiently control and understand the entire grid division process, thereby improving the development efficiency and user experience of the grid division module.

[0078] Moreover, the embodiment of the present invention, by constructing a data conversion relationship and topological mapping between an Open CASCADE-based geometric model and a Gmsh-based mesh model, realizes the data conversion of nodes and units in the geometric model and the mesh model while also realizing the mapping of high-level information such as topological information, that is, realizing the complete transmission of node, unit and topological information, thereby improving the accuracy and efficiency of mesh division.

[0079] Furthermore, the meshing function in the embodiment of the present invention is an interactive meshing function, which can enhance the depth of interactivity in the meshing process, allowing users to receive timely operational guidance and feedback on erroneous operations during the operation process, further improving the efficiency of meshing and mesh quality.

[0080] In some embodiments of the present invention, the interactive meshing function includes an interactive seeding function, such as Figure 3 As shown, the interactive cloth seed function is used to:

[0081] S301, obtaining a topological structure in a geometric model that can be used for seeding operations, and highlighting the topological structure;

[0082] S302, responding to a topology selection operation and receiving seed distribution parameters;

[0083] S303: Assign the seed distribution parameters to the geometric model to obtain the seed space distribution result, and visualize the seed space distribution result.

[0084] The topological structure that can be subjected to the seeding operation in step S301 is a boundary line topological structure, and the highlighting means is specifically: highlighting the boundary line topological structure.

[0085] It should be noted that: before step S302 , the process also includes: popping up a seed distribution parameter setting dialog box, and inputting and receiving seed distribution parameters based on the seed distribution parameter setting dialog box.

[0086] Among them, when the user clicks the seed operation button in the interactive interface, it enters step S301, first traversing various topological structures in the Open CASCADE-based geometric model of the component to determine whether it is a boundary line (Edge) topological structure. If so, it is recorded in the temporary list of boundary line topological structures, otherwise the structure is skipped.

[0087] Then, the temporary list of boundary line topology structures is read, and all boundary line topology structures recorded therein are highlighted in yellow to prompt the user to select these boundary lines for performing subsequent seeding operations.

[0088] After the user selects the boundary line for seeding and clicks "Confirm," the system proceeds to step S302, where it records the topology of the boundary line selected by the user and highlights it in red to indicate the selected boundary line. Subsequently, a dialog box pops up for the user to set seed distribution parameters, including the number of seeds, bias method, and bias parameters.

[0089] After completing the settings, proceed to step S303, perform geometric calculations on each selected boundary line according to the seed distribution parameters set by the user, so as to determine the spatial coordinate value of each seed on each selected boundary line, record it in a list, and establish a mapping relationship between the list and the topological structure number of the boundary line.

[0090] The resulting list of spatially distributed seed coordinates along the boundary line is then traversed. For each seed's spatial coordinate value, the Open CASCADE BRepBuilderAPI_MakeVertex method is called to construct each seed into an Open CASCADE vertex topology. These vertex topologies are then assigned a specific display style and displayed in the model. From the user's perspective, the main view of the software shows that the user-selected boundary line structure has been augmented with some vertex topologies that differ from the vertices of the geometric model. These are the seeds set by the user.

[0091] Based on the above analysis of the operation process, it can be found that this function requires different interactive behavior support during the operation, such as highlighting and selecting the topological structure, and popping up and setting the dialog box. Therefore, it is suitable to introduce the finite state machine design pattern for this function, and set different states according to different interactive behavior requirements. To this end, a state diagram of this function is drawn to analyze the different states required during the operation, that is: based on the finite state machine design steps S301~S303, as shown Figure 4 shown.

[0092] Figure 4 This demonstrates the interactive seeding operation, including the states and transitions between the key steps required. To complete the interactive seeding operation, the user must proceed through the "Seeding Area Selection State" and the "Seeding Parameter Setting State." In the "Seeding Area Selection State," steps S301 and S302 are executed to determine whether a "seeding operation has been performed" in the boundary topology. If so, the seed information is read and visualized. In the "Seeding Parameter Setting State," step S303 is executed. Transitions between states are triggered by Qt's signaling mechanism. For example, upon completion of the first state, a "Complete" signal is sent, triggering a state transition. Clicking the "Back" button in the second state sends a "Back" signal, returning the user to the first state. Clicking the "Cancel" button in any state ends the interactive seeding operation.

[0093] In some embodiments of the present invention, the interactive grid partitioning function also includes a grid partitioning strategy setting function, such as Figure 5 As shown in the figure, the grid partitioning strategy setting function is used to:

[0094] S501, responding to a division selection instruction for each target component in a geometric model, determining a target mesh division method and a target division unit type from preset mesh division methods and division unit types;

[0095] S502, assigning a target grid division method and a target division unit type to each target component;

[0096] S503: traverse the geometric model and display each target component in a differentiated manner based on the grid division method.

[0097] The partition selection instruction in step S501 may be input through a pop-up window.

[0098] The differentiated display in step S503 may be to display different grid division methods in different colors.

[0099] In step S501, after the user confirms the geometric instance object of the selected component, the system will pop up a dialog box for setting the meshing method. The meshing methods include but are not limited to triangular structured meshing, quadrilateral structured meshing, or free meshing. If the user selects triangular structured meshing, the system will mesh the component with triangular units or tetrahedral units as the main units; if the user selects quadrilateral structured meshing, the system will mesh the component with quadrilateral units or hexahedral units as the main units; if the user selects free meshing, the system will not mesh the component with a biased main unit selection.

[0100] In step S501, after the user completes the division method settings, a dialog box will pop up for the division element type settings. The geometric characteristics of the selected component will be determined first, and the list of options in the dialog box will be generated. For example, if the spatial dimension characteristics of the component are three-dimensional solid, the dialog box will generate solid elements such as tetrahedral elements and hexahedral elements for the user to choose from; if the spatial dimension characteristics of the component are two-dimensional shell, the dialog box will generate planar elements such as triangular elements and quadrilateral elements for the user to choose from.

[0101] In step S502, after the user completes all setup processes, all geometric models of the component are traversed and their meshing methods are extracted and judged. The geometric models are assigned different display colors to facilitate the user to identify the meshing methods of different components. For example, if the meshing method is triangular structured, the geometric model is assigned yellow; if the meshing method is quadrilateral structured, the geometric model is assigned green.

[0102] Based on the above analysis of the operation process, it can be found that this function requires different interactive behavior support during the operation, such as giving different display colors to the geometric model based on the component partitioning strategy, and generating a list of options in the setting dialog box based on the geometric features of the component. Therefore, it is suitable to introduce the finite state machine design pattern for this function, and set different states according to different interactive behavior requirements. To this end, a state diagram of this function is drawn to analyze the different states required during the operation, such as Figure 6 shown.

[0103] Figure 6This section demonstrates the meshing strategy setting function, including the states and transitions between the key steps required. To complete the meshing strategy setting, you must go through the "Mesh Strategy Setting Area Selection State," the "Mesh Strategy Setting State," and the "Mesh Unit Type Setting State." In the "Mesh Strategy Setting Area Selection State," execute step S501. In the "Mesh Strategy Setting Area Selection State," execute step S501; in the "Mesh Strategy Setting State," execute step S501; in the "Mesh Unit Type Setting State," execute steps S502 and S503. Transitions between states are triggered via Qt's signaling mechanism. For example, upon completion of the first state, a "Complete" signal is sent, triggering a state transition. Clicking the "Back" button in the second state sends a "Back" signal, returning to the first state. Clicking the "Cancel" button in any state ends the meshing strategy setting process.

[0104] based on Figure 3 and Figure 4 Interactive seed operation function, Figure 5 and Figure 6 The analysis of the operation process and interactive logic of the grid partitioning strategy setting function can realize the design of the functional architecture class diagram of the grid partitioning module, such as Figure 7 shown.

[0105] The seeding control class SeedControl and the meshing strategy control class MeshControlStgControl are designed to correspond to the finite state machines for the interactive seeding operation function and the meshing strategy setting function, respectively. The meshing base state class MeshBaseState is designed as an abstract base class that implements the specific states in the meshing module, with common properties and operation interfaces.

[0106] The seeding operation state class SeedBaseState and the meshing strategy state class MeshControlStgBaseState, which inherit from MeshBaseState, are designed to form aggregation relationships with SeedControl and MeshControlStgControl, respectively, serving as the base classes for the corresponding states in the finite state machines corresponding to specific meshing functions. Both SeedBaseState and MeshControlStgBaseState inherit from MeshBaseState and therefore share some common properties and methods, such as common behaviors when entering and exiting states and the abstract interface method concrete_state_confirm() for "confirm" operations. At the same time, the two differ in properties and methods to meet the functional requirements of their respective finite state machines. For example, SeedBaseState has a built-in method for setting a specific display style for the point topology structure corresponding to the seed, to achieve visual differences between the vertices of the seed and the component geometry model, while MeshControlStgBaseState does not have this method.

[0107] Based on SeedBaseState, design specific state classes with different behaviors, namely the seed application area selection state class SeedRegionSelectionState and the seed parameter setting state class SeedEditState, to correspond Figure 4 In the two specific state classes, the design satisfies Figure 3 The operation method of executing the steps in the SeedEditState involves the seed parameter setting operation, so the seed parameter setting dialog class QmyEditSeedDialog is designed to form a combination relationship with SeedEditState to realize that when entering the SeedEditState state, the dialog object corresponding to QmyEditSeedDialog will pop up. Finally, construct the combination relationship between SeedControl, SeedRegionSelectionState and SeedEditState, set the trigger condition for the transition between states, and complete Figure 4 Construction of the corresponding finite state machine.

[0108] Based on MeshControlStgBaseState, design specific state classes with different behaviors, namely the mesh division strategy region selection state class MeshControlStgRegionSelectionState, the mesh division method setting state class MeshControlStgMethodEditState and the division unit type setting state class MeshControlStgElemEditState, to correspond Figure 6 In the three specific state classes, the design satisfies Figure 5 The operation method of executing the steps in . Among them, in MeshControlStgMethodEditState and MeshControlStgElemEditState, the mesh division method setting and division unit type setting operations are involved. Therefore, the mesh division method setting dialog class QmyEditMeshControlStgMethodDialog and the division unit type setting dialog class QmyEditMeshControlStgElemDialog are designed to form a combination relationship respectively, so as to realize that when entering the MeshControlStgMethodEditState or MeshControlStgElemEditState state, the dialog box object corresponding to QmyEditMeshControlStgMethodDialog or QmyEditMeshControlStgElemDialog is popped up. Finally, the combination relationship between SeedControl and MeshControlStgRegionSelectionState, MeshControlStgMethodEditState and MeshControlStgElemEditState is constructed, and the trigger conditions for transition between states are set to complete. Figure 6 Construction of the corresponding finite state machine.

[0109] In some embodiments of the present invention, Figure 8 As shown, step S202 includes:

[0110] S801, writing the geometric model into a temporary storage file based on the Open CASCADE geometric model file reading and writing method;

[0111] S802, based on the Gmsh geometric model file reading method, read the temporary storage file to import the geometric model to obtain the Gmsh geometric model, and perform a meshing operation on the Gmsh geometric model in response to the meshing parameters to obtain a mesh model;

[0112] S803: Establish a topological mapping relationship between the topological structures of the geometric model and the mesh model.

[0113] In step S801, the geometry model file read and write functions breptools_Write() and importShapes() provided by Open CASCADE and Gmsh, respectively, are used to read and write temporary storage files. Using these functions as a bridge, the geometry model generated by Open CASCADE is imported into a Gmsh-operable geometry model. These two geometry models are named Geometric Model and Gmsh Geometric Model, respectively.

[0114] Among them, before step S802, it also includes preprocessing of the Gmsh geometric model according to the grid division parameters, and its preprocessing includes but is not limited to "naming the Gmsh geometric model", "setting the grid division parameters on the boundary line corresponding to the Gmsh geometric model according to the seed distribution parameters", etc., and then calling the generate() method of Gmsh to perform the grid division operation. The grid division result is unit and node information. The information data structure follows the data structure rules defined by Gmsh and can be accessed by calling the data access method of the node and unit in Gmsh.

[0115] In some embodiments of the present invention, Figure 9 As shown, step S803 includes:

[0116] S901, reading the geometric model and the Gmsh geometric model based on the Open CASCADE geometric model file reading and writing method and the Gmsh geometric model file reading method respectively;

[0117] S902, traverse the topological structures in the geometric model and the Gmsh geometric model, and assign topological structure numbers in sequence;

[0118] S903, performing a meshing operation on the Gmsh geometric model to obtain a mesh model, and extracting a topological structure corresponding to the Gmsh geometric model from the mesh model;

[0119] S904: Match the topological structure number of the geometric model with the topological structure number of the mesh model to establish a topological mapping relationship.

[0120] Specifically, steps S902-S904 are as follows: first, it is necessary to access the shape information attributes of the component, which include various topological structures such as points, lines, and surfaces, and each has a corresponding number. The number is generated by calling the system built-in method init_entities() during the component creation process. Subsequently, the topological structures such as points, lines, and surfaces are traversed separately, and in this process, the integer value corresponding to the topological structure type is used as the first parameter, and the number of the topological structure in the Open CASCADE-based component geometry model is used as the second parameter. The getNodes() method of Gmsh is called to obtain the node code of the corresponding topological structure in the Gmsh-based component mesh model and record it in a list, thereby realizing the mapping relationship between the topological structure of the Open CASCADE-based geometry model and the Gmsh-based mesh model.

[0121] It should be noted that if the relevant operations of S803 are not performed, the geometric model based on Open CASCADE and the mesh model based on Gmsh cannot be connected in terms of topological structure numbering. This will make it difficult to apply the boundary conditions, load conditions, contact conditions and other parameters set based on the Open CASCADE geometric model to the finite element model based on the Gmsh mesh during the finite element modeling process. Therefore, this step is necessary.

[0122] It should be noted that the topological structure number and the mesh model topological structure number can be obtained based on the system's built-in method init_entities(). init_entities() is an initialization method developed based on the TopTools_IndexedMapOfShape() method provided in Open CASCADE's TopTools tool and the MapShapes() method in the TopExp tool. This method is called when the system builds a component. It is used to traverse all the topological structures in the geometric model corresponding to the component, and after classifying the points, lines, and surfaces, they are numbered in sequence for easy calling during finite element modeling and simulation.

[0123] In some embodiments of the present invention, Figure 10 As shown, step S204 includes:

[0124] S1001, determining the unit and node information of the grid model;

[0125] S1002. Based on the Open CASCADE geometric model construction method, the unit and node information are processed to form an Open CASCADE-based mesh visualization model;

[0126] S1003. Based on the component visualization mechanism in the mesh division module, visualize each component in the mesh visualization model and display the component.

[0127] Among them, in step S1001, by calling the getElements() and getNodes() methods of Gmsh, the unit and node information in the Gmsh-based grid model is accessed, and through the system's built-in methods, this information is converted into list data in a custom data structure, and the GmshInfo class is designed to manage this data.

[0128] In step S1002, the initial grid visualization model is constructed by combining the TopoDS_Builder() method and the TopoDS_Compound() method of Open CASCADE. At this time, there is no data in the grid visualization model; then, the unit and node information data generated in step S1001 are accessed, and the geometric characteristics, number of nodes and node connection order of each unit are determined through the type attributes of each unit, so as to call the BRepBuilderAPI_MakeEdge() method of Open CASCADE to generate unit edges and connect them in sequence; finally, by calling the Add() method of the TopoDS_Builder object in Open CASCADE, these boundary lines are added one by one to the initial grid visualization model object, and a complete grid visualization model based on Open CASCADE is gradually constructed.

[0129] In step S1003, the component visualization mechanism in the meshing module is as follows: within the meshing module, the component geometric model display function is divided into the display function of the component assembly model and the display function of the individual component model. If the display object is set to the component assembly model, all components included in the assembly model are displayed; if the display object is set to the individual component model, only the component selected in the component drop-down menu is displayed. During the display process, the meshing status of the component is determined. If the component has been meshed, the mesh model is displayed; if the component has not been meshed, the geometric model is displayed.

[0130] In step S1003, the component visualization process involves displaying a geometric model if the component has not yet been meshed. Before displaying the geometric model, the system assigns a color to the model based on the meshing type and method. If triangular structured meshing is selected, the geometric model is colored yellow; if quadrilateral structured meshing is selected, the geometric model is colored green, and so on.

[0131] The design of the above-mentioned functions and technologies involves three models: geometric models, mesh models, and mesh visualization models. Geometric models are further divided into Open CASCADE-based geometric models and Gmsh-based geometric models. The Open CASCADE-based geometric model is created by users in the component module through interactive modeling settings. It is the most important basic geometric model in the modeling process and serves as the original model data in the meshing module. The Gmsh-based geometric model, on the other hand, is the intermediate data used for meshing operations in the meshing module and is generated by calling Gmsh's file reading methods to read the Open CASCADE-based geometric model file. The mesh model in this invention refers to the Gmsh-based mesh model, which is obtained by meshing the Gmsh-based geometric model using Gmsh's meshing methods and serves as the core data of the meshing module. The mesh visualization model is a visualization model provided to achieve a better user experience. By developing Open CASCADE-based mesh model visualization technology, the Open CASCADE-based mesh visualization model can be combined with the Open CASCADE-based geometric model, thereby displaying the meshed effect of the geometric model to the user in the meshing module.

[0132] Obviously, it is necessary to design corresponding data entity classes for the three respectively, and construct the data structure between them in a reasonable way to support the interactive meshing function of the meshing module. Figure 11 This is a class diagram for the structural design of the geometric model, mesh model, and mesh visualization model data in an embodiment of the present invention.

[0133] Regarding geometric models, the ShapeInfo geometric object information class is designed to manage geometric shape information generated based on Open CASCADE to represent the component's geometric model. It contains all the topological structure information of the geometric model, which is designed as the abstract topological structure information class EntityInfo. Based on EntityInfo, specific point, line, and surface topological structure information classes, namely VertexInfo, EdgeInfo, and FaceInfo, can be implemented according to different geometric characteristics. The line topology structure information class EdgeInfo contains the seed information SeedInfo generated by interactive seeding operations. If a line topology structure in the geometric model is used for seeding, the SeedInfo in the EdgeInfo corresponding to that topology structure will contain the set seeding parameters, including the seed distribution strategy and the seed spatial coordinate list. SeedInfo also provides the seeds_pos() method for accessing the seed spatial list and the seeds_vertices() method for obtaining the Open CASCADE geometric object corresponding to the seed. This method can be called when it is necessary to display seeds on the line topology structure.

[0134] In terms of mesh model, the main designs include Gmsh information class GmshInfo, mesh data class MeshData and mesh information class MeshInfo, which have the following characteristics:

[0135] The Gmsh information class GmshInfo is used to store the grid data in a specific format obtained by Gmsh grid division;

[0136] The mesh data class MeshData is used to save mesh data in a custom format generated by reading node and cell information from Gmsh mesh data. It contains the nodes and elems attributes, which are lists of objects of the mesh node data class NodeData and the mesh cell data class ElementData, respectively.

[0137] NodeData not only provides the spatial coordinate information pos of the finite element node, but also provides the attributes and parameters related to building the finite element analysis model, such as the finite element node degree of freedom mark nfs, etc.

[0138] ElementData not only contains the node information list nodes that make up the element, but also provides properties and parameters related to building a finite element analysis model, and can even be used to calculate and save the corresponding element stiffness matrix;

[0139] The mesh information class MeshInfo forms an aggregation relationship with GmshInfo and MeshData, respectively, to achieve effective management of both. In addition, considering that the purpose of mesh information is to bind it to geometric objects to build analysis models during the finite element analysis phase, an association relationship between MeshInfo and ShapeInfo is designed. ShapeInfo records the MeshInfo corresponding to the geometric object through the mesh information attribute mesh_info.

[0140] Through the reasonable functional architecture design of the interactive meshing module, stable conversion and association of multi-source model data, and effective mesh model visualization, convenient and efficient interactive meshing is achieved, significantly improving the development efficiency, maintenance convenience and user-friendliness of the meshing module of the finite element modeling software.

[0141] In some embodiments of the present invention, in order to distinguish between the divided model and the undivided geometric model, before displaying the component in step S1003, the following steps are further included:

[0142] In response to a component display instruction, it is determined whether the component is a meshed component or an unmeshed component; if the component is a meshed component, a mesh visualization model is displayed; if the component is an unmeshed component, a geometric model is displayed.

[0143] On the other hand, an embodiment of the present invention further provides a simulation software construction method, comprising:

[0144] Construct an interactive meshing module based on its design method;

[0145] The design method of the interactive mesh division module is the design method of the interactive mesh division module in any one of the above embodiments.

[0146] In order to better implement the design method of the interactive mesh partitioning module in the embodiment of the present invention, based on the design method of the interactive mesh partitioning module, the embodiment of the present invention also provides a design device for the interactive mesh partitioning module, such as Figure 12 As shown, the design device 1200 of the interactive meshing module includes:

[0147] A functional architecture class diagram determining unit 1201 is configured to determine an interactive meshing function according to meshing requirements, and determine a functional architecture class diagram of a meshing module based on the interactive meshing function.

[0148] The data conversion mapping unit 1202 is used to construct a data conversion relationship and topological mapping between the geometric model based on Open CASCADE and the mesh model based on Gmsh;

[0149] A mesh model division unit 1203 is configured to perform mesh division on the geometric model based on the functional architecture class diagram, the data conversion relationship, and the topological mapping to obtain a mesh model;

[0150] The visualization display unit 1204 is configured to visualize the grid model based on the grid model visualization technology.

[0151] The interactive mesh division module design device 1200 provided in the above embodiment can implement the technical solution described in the above embodiment of the interactive mesh division module design method. The specific implementation principles of the above modules or units can be found in the corresponding contents in the above embodiment of the interactive mesh division module design method, which will not be repeated here.

[0152] Accordingly, an embodiment of the present invention also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, it can implement the interactive geometric modeling related module design method provided in the above-mentioned method embodiments, and / or the steps or functions in the simulation software construction method.

[0153] Those skilled in the art will appreciate that all or part of the process flow of the above-described method embodiment can be implemented by instructing related hardware (such as a processor, controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a magnetic disk, an optical disk, a read-only memory, or a random access memory.

[0154] The above is a detailed introduction to the interactive grid division module design method, software construction method and device provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. An interactive meshing module design method, characterized in that: include: Determine an interactive meshing function according to meshing requirements, and determine a functional architecture class diagram of a meshing module based on the interactive meshing function; Construct data conversion relationship and topological mapping between Open CASCADE-based geometric models and Gmsh-based mesh models; Meshing the geometric model based on the functional architecture class diagram, the data conversion relationship, and the topological mapping to obtain the mesh model; Visualizing the grid model based on a grid model visualization technology; The interactive grid division function includes an interactive seeding function and a grid division strategy setting function; Based on the finite state machine design pattern, draw state diagrams for the interactive seeding function and the grid partitioning strategy setting function respectively, and determine the functional architecture class diagram based on the state diagrams; The functional architecture class diagram includes a seed distribution operation state class and a grid division strategy state class inherited from the grid division basic class, a seed distribution operation control class that is in an aggregated relationship with the seed distribution operation state class, and a grid division strategy control class that is in an aggregated relationship with the grid division strategy state class; the grid division basic class has the common attributes and operation interfaces of the seed distribution operation state class and the grid division strategy state; the functional architecture class diagram also includes a seed distribution application area selection state class and a seed distribution parameter setting state class inherited from the seed distribution operation state class, as well as a grid division strategy area selection state class and a grid division mode class inherited from the grid division strategy setting function Setting state class and division unit type setting state class; cloth seed application area selection state class and cloth seed parameter setting state class are in a combination relationship with cloth seed operation control class, grid division strategy area selection state class, grid division method setting state class and division unit type setting state class are in a combination relationship with grid division strategy control class; the functional architecture class diagram also includes a cloth seed parameter setting dialog class in a combination relationship with cloth seed parameter setting state class, a division unit type setting dialog class in a combination relationship with division unit type setting state class, and a grid division method setting dialog class in a combination relationship with grid division method setting state class; The construction of the data conversion relationship and topological mapping between the Open CASCADE-based geometric model and the Gmsh-based mesh model includes: Reading a geometric model and a Gmsh geometric model based on an Open CASCADE geometric model file reading and writing method and a Gmsh geometric model file reading method, respectively; traversing the topological structures in the geometric model and the Gmsh geometric model, and assigning topological structure numbers in sequence; performing a meshing operation on the Gmsh geometric model to obtain the mesh model, and extracting a topological structure corresponding to the Gmsh geometric model from the mesh model; and establishing a topological mapping relationship by matching the topological structure number of the geometric model with the topological structure number of the mesh model. The structural design class diagram of the geometric model, the Gmsh geometric model and the mesh model includes: a geometric object information class for managing the geometric shape information generated by Open CASCADE, a mesh information class that is associated with the geometric object information class, a mesh data class and a Gmsh information class that are aggregated with the mesh information class, and a mesh node data class and a mesh unit data class that are aggregated with the mesh data class.

2. The interactive meshing module design method according to claim 1, characterized in that: The interactive cloth seed function is used to: Acquire a topological structure in the geometric model that can be used for seeding operations, and highlight the topological structure; responding to a selection operation of the topology and receiving a seed distribution parameter; The seed distribution parameters are assigned to the geometric model to obtain a seed space distribution result, and the seed space distribution result is visualized.

3. The interactive meshing module design method according to claim 1, characterized in that: The grid partitioning strategy setting function is used to: In response to a division selection instruction for each target component in the geometric model, a target grid division method and a target division unit type are determined from preset grid division methods and division unit types; Assigning the target grid division mode and the target division unit type to each target component; The geometric model is traversed, and each target component is displayed in a differentiated manner based on the grid division method.

4. The interactive meshing module design method according to claim 1, characterized in that: The visualizing the grid model based on the grid model visualization technology includes: Determining unit and node information of the grid model; Based on the geometric model construction method of Open CASCADE, the unit and node information are processed to form a mesh visualization model based on Open CASCADE; Based on the component visualization mechanism in the grid division module, each component in the grid visualization model is visualized and displayed.

5. The interactive meshing module design method according to claim 4, characterized in that: The OpenCASCADE-based geometric model construction method processes the unit and node information to form an OpenCASCADE-based mesh visualization model, including: Construct the initial mesh visualization model based on the Open CASCADE geometric model construction method; Determining the geometric characteristics, number of nodes, and node connection order of each unit based on the type attributes in the unit and node information; The geometric features, the number of nodes, and the node connection order are added to the initial mesh visualization model to obtain the mesh visualization model.

6. The interactive meshing module design method according to claim 4, characterized in that: Before displaying the components, the method further includes: In response to the component display instruction, determining whether the component is a gridded component or an ungridded component; If the component is a meshed component, the mesh visualization model is displayed; if the component is an unmeshed component, the geometric model is displayed.

7. A method for constructing simulation software, characterized in that: include: Construct an interactive meshing module based on its design method; Wherein, the design method of the interactive mesh division module is the design method of the interactive mesh division module according to any one of claims 1-6.

8. A design device for an interactive grid division module, characterized in that: A method for designing an interactive meshing module according to any one of claims 1 to 6, wherein the device comprises: A functional architecture class diagram determining unit, configured to determine an interactive meshing function according to meshing requirements, and determine a functional architecture class diagram of a meshing module based on the interactive meshing function; Data conversion mapping unit, used to build data conversion relationship and topological mapping between Open CASCADE-based geometric model and Gmsh-based mesh model; A mesh model division unit, configured to perform mesh division on the geometric model based on the functional architecture class diagram, the data conversion relationship, and the topological mapping to obtain the mesh model; The visualization display unit is used to visualize the grid model based on the grid model visualization technology.