Grasshopper-based nurbs surface finite element mesh generation method and system
By processing NURBS surfaces using the Grasshopper platform and generating finite element meshes that conform to the right-hand screw rule, the problems of data conversion and modeling difficulties for complex surface structures are solved, and an efficient finite element analysis tool is realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN PROVINCIAL ARCHITECTURAL DESIGN & RES INST
- Filing Date
- 2026-05-15
- Publication Date
- 2026-08-04
AI Technical Summary
Traditional methods are difficult to efficiently handle finite element analysis of complex NURBS surface structures, and existing software suffers from accuracy loss and high technical barriers during data conversion and modeling.
The Grasshopper platform is used to extract NURBS surface geometry data. Finite element meshes are generated through parameter space discretization and 3D mapping, and orientation adaptive correction is performed. The output is in TCL command stream format suitable for OpenSEES.
It enables automated conversion from geometric models to finite element models, improving modeling efficiency, ensuring mesh quality, lowering the technical threshold, and providing structural engineers with a convenient finite element analysis tool.
Smart Images

Figure CN122221606B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer-aided engineering, parametric design and structural finite element analysis, and more specifically, to a method and system for generating NURBS surface finite element meshes based on Grasshopper. Background Technology
[0002] In modern architecture and engineering design, free-form surface structures such as large-span spatial roofs, irregular curtain walls, and hyperbolic arches are becoming increasingly common. These structures have complex shapes and diverse geometric features, placing higher demands on the precision of structural design. Traditional structural analysis methods often struggle to directly handle complex NURBS (Non-Uniform Rational B-Splines) surfaces. NURBS surfaces are the standard mathematical representation of free-form surfaces in computer graphics and CAD systems, offering advantages such as accurate description of complex geometries, support for local modifications, and controllable geometric continuity. However, NURBS surfaces cannot be directly used for finite element analysis; they need to be discretized into a mesh model. This requires manual modeling or third-party software for surface discretization, a cumbersome process prone to introducing errors. Traditional mesh generation methods, such as mapping-based methods, Delaunay triangulation, and advancing front algorithms, often produce poor-quality meshes when processing complex NURBS surfaces, with excessively large aspect ratios and high distortion, directly affecting the accuracy and convergence of finite element analysis.
[0003] Currently, commonly used structural analysis software in engineering, such as SAP2000, ETABS, and MIDAS, while possessing powerful analytical capabilities, have significant shortcomings in handling data conversion between geometric models and finite element models. These software programs typically require the import of geometric data through intermediate formats (such as IGES, STEP, and DXF), and the conversion process can easily lead to the loss of geometric information or a decrease in accuracy. This is particularly true for NURBS surfaces; due to varying degrees of support for surface representation among different software programs, the converted surfaces often degenerate into polygonal approximations, failing to maintain the original geometric accuracy.
[0004] On the other hand, OpenSEES, as an open-source structural analysis software, is widely used in scientific research and engineering fields due to its rich element type library, powerful nonlinear analysis capabilities, and open-source characteristics. However, OpenSEES uses the TCL (Tool Command Language) scripting language for model definition and lacks a graphical pre-processing interface. Designers need to manually write a large amount of TCL code to define nodes, elements, materials, loads, etc., which has a high technical threshold and low modeling efficiency. Especially for complex curved surface structures, manual modeling is almost impossible.
[0005] In addition, finite element analysis has strict requirements on the directionality of mesh elements. The element direction must conform to the right-hand screw rule to ensure the correctness of the calculation results. In the process of automatic mesh generation, how to ensure the consistency of element direction is a technical challenge, especially when dealing with complex curved surfaces, where the element direction is prone to errors, leading to analysis failure.
[0006] Therefore, this application is hereby submitted. Summary of the Invention
[0007] The purpose of this invention is to provide a method and system for generating NURBS surface finite element meshes based on Grasshopper, which realizes the automated conversion from geometric models to OpenSEES finite element models. This can improve modeling efficiency, ensure mesh quality, lower the technical threshold, and provide structural engineers with a convenient finite element analysis tool, which has important engineering value and academic significance.
[0008] The above-mentioned technical objective of the present invention is achieved through the following technical solution:
[0009] Firstly, this application provides a Grasshopper-based method for generating NURBS surface finite element meshes, including the following specific steps:
[0010] Extract the NURBS surface geometry data to be analyzed from the Rhino or Grasshopper platform, and discretize the extracted NURBS surface geometry data in the parameter space;
[0011] Based on the obtained mesh size requirements, mesh node coordinates are generated in the parameter space based on the discretization results;
[0012] Map the coordinates of the mesh nodes in the parameter space back to the three-dimensional physical space to generate the initial finite element mesh, and calculate the three-dimensional coordinates of each mesh node in the initial finite element mesh.
[0013] Based on the number of mesh nodes in the initial finite element mesh, the mesh element type is identified, and the initial finite element mesh is adaptively corrected according to the identified mesh element type, which conforms to the right-hand screw rule.
[0014] The corrected mesh node and mesh cell connection relationships are converted into a TCL command stream format recognizable by the OpenSEES software, and the target mesh in the TCL command stream format is quality evaluated until the target mesh meets the quality requirements.
[0015] Based on the above technical solution, the present invention can be further improved as follows.
[0016] Furthermore, the above-mentioned quality assessment of the target mesh in TCL command stream format is performed until the target mesh meets the quality requirements, including:
[0017] S51, calculate the quality index of each grid cell in the target grid. The quality index includes at least aspect ratio, distortion, Jacobian, and area deviation.
[0018] S52, determine whether each indicator in the quality index meets the set quality threshold, and identify the grid cell that does not meet the quality threshold as a low quality cell.
[0019] S53, for regions with concentrated low-quality cells, increases the mesh density by a multiple in the parameter space and regenerates a new local network;
[0020] S54, recalculate the new positions of each grid node in the low-quality cell based on the local network, and re-evaluate the quality based on the new positions;
[0021] S55, repeat steps S51-S54 until there are no low-quality cells in the target mesh.
[0022] Furthermore, the three-dimensional coordinates of each mesh node in the initial finite element mesh are calculated in the following way:
[0023] For each grid node coordinate in the parameter space, substituting them into the NURBS surface equation yields the three-dimensional coordinates of each grid node. The NURBS surface equation is as follows: ; In the formula, Indicates the weighting coefficient. , Let P and q be the B-spline basis functions, respectively. The set of control point coordinates and grid node coordinates is: , , ; Represents the parameters in three-dimensional space and parameters The coordinate vector of any point on the NURBS surface is determined jointly. For parameters in the U direction of the NURBS surface, These are the parameters in the V direction of the NURBS surface; This represents the number of vertices of the NURBS surface in the U direction. This represents the number of vertices of the NURBS surface in the V direction. This represents the vertex index of the NURBS surface in the U direction. This is the vertex index of the NURBS surface in the V direction.
[0024] Furthermore, the aforementioned mesh element types include three-node ShellDKGT elements and four-node ShellDKGQ elements; wherein:
[0025] When a mesh element consists of three nodes, it is determined to be a three-node ShellDKGT element;
[0026] When a mesh cell consists of four nodes, it is determined to be a four-node ShellDKGQ cell.
[0027] Furthermore, the above-mentioned adaptive correction of the initial finite element mesh to conform to the right-hand screw rule for mesh element orientation is specifically as follows:
[0028] S41, For each mesh element, calculate the element normal vector of the plane containing the mesh element;
[0029] S42, calculate the angle between the normal vector and the element normal vector in the NURBS surface geometry data at this point. When the angle exceeds 90°, it indicates that the element direction is opposite to the surface normal, so flip it.
[0030] S43. If the included angle exceeds 90°, adjust the node connection sequence so that the element direction conforms to the right-hand screw rule. The adjustment method is to swap the positions of adjacent nodes.
[0031] S44, Verify whether the adjusted mesh elements satisfy the right-hand screw rule;
[0032] S45, Traverse all mesh cells and execute steps S41-S44 until all mesh cells have the same cell orientation or pass the verification.
[0033] Furthermore, the aforementioned encryption multiplier is calculated in the following manner: ; In the formula, Indicates the encryption multiplier. Indicates aspect ratio, For the degree of distortion, For Jacobi, This is for area deviation.
[0034] Furthermore, the new locations of the aforementioned grid nodes are as follows: ; In the formula, For the new location of the grid node, This represents the original position of the grid node. This represents the smoothing coefficient, and its value range is... ; For grid nodes The set of adjacent nodes, Represents the set of adjacent nodes The cardinality, that is The number of elements in the middle; Indicates the first The three-dimensional coordinate vector of each grid node. , These are the coordinate components of the grid node in three-dimensional space.
[0035] Secondly, this application provides a Grasshopper-based NURBS surface finite element mesh generation system, applicable to any of the Grasshopper-based NURBS surface finite element mesh generation methods in the first aspect, including:
[0036] The discretization module is used to extract the NURBS surface geometry data to be analyzed from the Rhino or Grasshopper platform and discretize the extracted NURBS surface geometry data in the parameter space.
[0037] The coordinate generation module is used to generate grid node coordinates in the parameter space based on the discretization results and the obtained grid size requirements.
[0038] The 3D spatial mapping module is used to map the coordinates of mesh nodes in the parameter space back to the 3D physical space, generate the initial finite element mesh, and calculate the 3D coordinates of each mesh node in the initial finite element mesh.
[0039] The adaptive correction module is used to identify the mesh element type based on the number of mesh nodes in the initial finite element mesh, and to adaptively correct the orientation of the initial finite element mesh according to the identified mesh element type, which conforms to the right-hand screw rule.
[0040] The quality assessment module is used to convert the corrected mesh node and mesh cell connection relationships into a TCL command stream format that can be recognized by the OpenSEES software, and to perform quality assessment on the target mesh in the TCL command stream format until the target mesh meets the quality requirements.
[0041] Thirdly, this application provides an electronic device, including: at least one processor, at least one memory, and a data bus;
[0042] In this system, the processor and memory communicate with each other via a data bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the Grasshopper-based NURBS surface finite element mesh generation method as described in any of the first aspects.
[0043] Fourthly, this application provides a non-transitory computer-readable storage medium that stores computer instructions that cause a computer to execute the Grasshopper-based NURBS surface finite element mesh generation method of any one of the first aspects.
[0044] Compared with the prior art, the present invention has at least the following beneficial effects:
[0045] Before performing structural finite element analysis, the NURBS surface geometry information in the geometric model is extracted using the Grasshopper visual programming platform. Through parameter space discretization and physical space mapping, a four-node or three-node finite element mesh is automatically generated. After adaptive direction correction, a TCL command stream suitable for OpenSEES software is output. This invention solves the problems of cumbersome data conversion between geometric models and structural analysis software, and the difficulty of modeling complex surfaces, providing more efficient technical support for refined structural design. Attached Figure Description
[0046] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:
[0047] Figure 1 This is a flowchart of the generation method in an embodiment of the present invention;
[0048] Figure 2 This is a flowchart of the generation method in an embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of the connection of the generation system in an embodiment of the present invention;
[0050] Figure 4 This is a schematic diagram of the connection of an electronic device in an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0052] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0053] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0054] In the description of the embodiments of the present invention, "multiple" means at least two.
[0055] Grasshopper is a visual parametric design tool for the Rhino platform. It uses node connections to construct complex algorithms and has powerful geometric processing capabilities and an algorithm library. Grasshopper supports direct manipulation of NURBS surfaces, can extract geometric information from surfaces, perform parametric operations and mesh generation, providing an ideal technical foundation for automated finite element mesh generation.
[0056] Example 1: This example provides a method for generating NURBS surface finite element meshes based on Grasshopper, such as... Figure 1 and Figure 2 As shown, the specific steps include the following:
[0057] S1. Extract the NURBS surface geometry data to be analyzed from the Rhino or Grasshopper platform, and discretize the extracted NURBS surface geometry data in the parameter space.
[0058] The specific methods for discretizing within the parameter space include the following steps:
[0059] S11, Determine mesh size parameters: Based on the target element size or number of elements input by the user, calculate the mesh division step size in the parameter space; the parameter space can be set to [0,1]×[0,1], and the target element size to L. Then the formulas for calculating the step size Δu and Δv in the parameter directions are: ; ; In the formula, The equation for the NURBS surface is... Let be the Euclidean norm, and n and m be the number of nodes in the u and v directions, respectively.
[0060] S12, Generate parameter space grid nodes: Generate a uniformly distributed set of grid nodes in the parameter space [0,1]×[0,1] according to step sizes Δu and Δv. ,in , .
[0061] S13, Parametric boundary constraint handling: For trimmed NURBS surfaces, calculate the representation of the trimmed curve in the parameter space, and retain only the parameter space nodes located within the trimmed region.
[0062] S14, Parameter Node Number: Assign a unique number to each parameter space node and establish a mapping relationship between the parameter space index and the node number: .
[0063] S2, based on the obtained mesh size requirements, generates mesh node coordinates in the parameter space based on the discretization results.
[0064] S3 maps the coordinates of the mesh nodes in the parameter space back to the three-dimensional physical space, generates the initial finite element mesh, and calculates the three-dimensional coordinates of each mesh node in the initial finite element mesh.
[0065] The calculation of the three-dimensional coordinates of each mesh node in the initial finite element mesh is achieved in the following way:
[0066] For the coordinates of each grid node in the parameter space Substituting the values into the NURBS surface equations, we obtain the three-dimensional coordinates of each mesh node, which can be expressed as: The NURBS surface equation is as follows: ; In the formula, Indicates the weighting coefficient. , Let P and q be the B-spline basis functions, respectively. The set of control point coordinates and grid node coordinates is: , , ; Represents the parameters in three-dimensional space and parameters The coordinate vector of any point on the NURBS surface is determined jointly. For parameters in the U direction (such as the length direction) of a NURBS surface, For parameters in the V direction (such as the width direction) of a NURBS surface; This represents the number of vertices of the NURBS surface in the U direction. This represents the number of vertices of the NURBS surface in the V direction. This represents the vertex index of the NURBS surface in the U direction. This is the vertex index of the NURBS surface in the V direction.
[0067] In the above, , These are the coordinate components in three-dimensional space. The NURBS surface equation is a parametric expression of the NURBS surface, expressed through two independent parameters. and parameters It can accurately describe any point on a complex three-dimensional surface; among them, The values are all [0, 1].
[0068] Specifically, the unit normal vector of the NURBS surface is calculated at each physical space node. The calculation formula is: ; In the formula, This is a vector cross product operation used to determine the subsequent mesh orientation; based on the node normal vector, a local coordinate system is defined for each mesh cell, including the local x-axis, y-axis, and z-axis directions.
[0069] S4. Based on the number of mesh nodes in the initial finite element mesh, identify the mesh element type, and perform adaptive correction of the initial finite element mesh according to the identified mesh element type, which conforms to the right-hand screw rule.
[0070] Specifically, the above-mentioned mesh element types include three-node ShellDKGT elements and four-node ShellDKGQ elements; wherein:
[0071] When a mesh element consists of three nodes, it is determined to be a three-node ShellDKGT element; ShellDKGT is a 3-node generalized conformal shell element, which is suitable for finite element analysis of curved boundary regions or transition regions;
[0072] When a mesh element consists of four nodes, it is determined to be a four-node ShellDKGQ element; ShellDKGQ is a 4-node generalized conformal shell element, which is suitable for finite element analysis of complex surfaces with large curvature.
[0073] For mixed meshes containing different types of cells, a cell type mapping table is established to record the correspondence between each cell ID and cell type. Each mesh cell can be assigned a unique cell identifier according to the numbering rules of the OpenSEES software, with the cell ID starting from 1 and incrementing continuously.
[0074] Optionally, the above-mentioned adaptive correction of the initial finite element mesh to conform to the right-hand screw rule is as follows:
[0075] S41, For each mesh cell, calculate the cell normal vector of the plane containing the mesh cell.
[0076] For each grid cell, the unit normal vector of its plane is calculated. The calculation formula is: ; in, , , For a single-node element, use the first three nodes. For a four-node element, use the first three nodes.
[0077] S42 calculates the angle between the normal vector and the element normal vector in the NURBS surface geometry data at this point. When the angle exceeds 90°, it indicates that the element direction is opposite to the surface normal, so it is flipped.
[0078] Specifically, when determining directional consistency, the normal vectors of the unit plane are compared. The normal vector of the NURBS surface at that location Calculate the included angle : .
[0079] S43. If the included angle exceeds 90°, adjust the node connection order to make the element direction conform to the right-hand screw rule. The adjustment method is to swap the positions of adjacent nodes; ensure that the element direction conforms to the right-hand screw rule.
[0080] S44 verifies whether the adjusted mesh element satisfies the right-hand spiral rule; that is, when viewed from the front of the element, the node order is counterclockwise.
[0081] S45, Traverse all mesh cells and execute steps S41-S44 until all mesh cells have the same cell orientation or pass the verification.
[0082] S5 converts the corrected mesh node and mesh cell connection relationships into a TCL command stream format recognizable by the OpenSEES software, and performs quality assessment on the target mesh in the TCL command stream format until the target mesh meets the quality requirements.
[0083] The conversion to a TCL command stream format recognizable by OpenSEES software is achieved through the following methods:
[0084] 1) Node command generation: Generate node commands for each physical space node according to the OpenSEES TCL syntax:
[0085] node $nodeTag $xCoord $yCoord $zCoord;
[0086] Where nodeTag is the node number, and xCoord, yCoord, and zCoord are the node's three-dimensional coordinates.
[0087] 2) ShellDKGQ cell command generation: For a four-node ShellDKGQ cell, generate the element command:
[0088] element ShellDKGQ $eleTag $iNode $jNode $kNode $lNode $secTag;
[0089] Where eleTag is the element number, iNode, jNode, kNode, and lNode are the four node numbers of the element, and secTag is the section number.
[0090] 3) ShellDKGT cell command generation: For a three-node ShellDKGT cell, generate the element command:
[0091] element ShellDKGT $eleTag $iNode $jNode $kNode $secTag;
[0092] Where eleTag is the element number, iNode, jNode, and kNode are the three node numbers of the element, and $secTag is the section number.
[0093] 4) Section command generation: Generates the ElasticMembranePlateSection command based on the user-specified material properties and thickness.
[0094] section ElasticMembranePlateSection $secTag $E $nu $thickness $rho;
[0095] Where secTag is the section number, E is the elastic modulus, nu is Poisson's ratio, thickness is the thickness, and rho is the density.
[0096] 5) Command stream serialization: Write all generated TCL commands sequentially to a text file and save it in .tcl format, which can be directly read and executed by OpenSEES software.
[0097] Optionally, the above-mentioned quality assessment of the target mesh in TCL command stream format until the target mesh meets the quality requirements includes:
[0098] S51, calculate the quality index of each grid cell in the target grid. The quality index includes at least aspect ratio, distortion, Jacobian, and area deviation; where:
[0099] Aspect Ratio (AR): ,in The length of the longest side of the cell. The length of the shortest side of the unit;
[0100] Twist (SKW): ,in An interior angle of the unit;
[0101] Jac: ,in It is a Jacobian matrix;
[0102] Area deviation (AreaErr): ,in The actual area of the unit. The target area.
[0103] S52, determine whether each indicator in the quality index meets the set quality threshold, and identify the grid cells that do not meet the quality threshold as low quality cells; traverse all grid cells, identify low quality cells that do not meet the quality threshold, and record their cell ID and quality index value.
[0104] Based on the accuracy requirements of finite element analysis, allowable thresholds are set for each quality indicator; the thresholds can be: , , , .
[0105] S53, for regions with concentrated low-quality cells, increases the mesh density by a multiple in the parameter space and regenerates a new local network.
[0106] The encryption multiplier mentioned above is calculated in the following way: ; In the formula, Indicates the encryption multiplier. Indicates aspect ratio, For the degree of distortion, For Jacobi, This is for area deviation.
[0107] S54: Recalculate the new positions of each grid node in the low-quality cell based on the local network, and re-evaluate the quality based on the new positions.
[0108] The new positions of each of the above grid nodes are as follows: ; In the formula, For the new location of the grid node, This represents the original position of the grid node. This represents the smoothing coefficient, and its value range is... ; For grid nodes The set of adjacent nodes, that is, the set of nodes... The set consisting of all nodes directly connected by finite element elements. Represents the set of adjacent nodes The cardinality, that is The number of elements in the middle; Indicates the first The three-dimensional coordinate vector of each grid node. , These represent the coordinate components of the mesh node in three-dimensional space. In the finite element mesh smoothing algorithm... Used to represent grid nodes The coordinates of adjacent nodes are used to calculate the mesh nodes. The smooth adjustment vector.
[0109] In the above, " The technical meaning of "" should be a set. The cardinality of a set The number of elements in the middle, In the calculation formula, A weighted average is used to normalize the displacement vectors of adjacent nodes, ensuring the stability and convergence of the smoothing operation. This is achieved by dividing by the number of adjacent nodes. This enabled the control of nodes. The information from the surrounding neighborhood is evenly distributed, avoiding deviations in the smoothing effect caused by different numbers of adjacent nodes.
[0110] S55, Repeat steps S51-S54 until there are no low-quality cells in the target mesh, or the maximum number of iterations is reached (which can be 10).
[0111] S56 outputs optimized mesh node coordinates, element connection relationships, and a quality assessment report, including the total number of elements, the number of low-quality elements, and quality index statistics.
[0112] In the above process, the NURBS surface geometry information in the geometric model is extracted using the Grasshopper visual programming platform. Through parameter space discretization and physical space mapping, a four-node or three-node finite element mesh is automatically generated. After adaptive direction correction, a TCL command stream suitable for OpenSEES software is output. This invention solves the problems of cumbersome data conversion between geometric models and structural analysis software, and the difficulty of modeling complex surfaces, providing more efficient technical support for refined structural design.
[0113] Example 2: This application provides a Grasshopper-based NURBS surface finite element mesh generation system, applied to the Grasshopper-based NURBS surface finite element mesh generation method of Example 1, such as... Figure 3 As shown, it includes:
[0114] The discretization module is used to extract the NURBS surface geometry data to be analyzed from the Rhino or Grasshopper platform and discretize the extracted NURBS surface geometry data in the parameter space.
[0115] The coordinate generation module is used to generate grid node coordinates in the parameter space based on the discretization results and the obtained grid size requirements.
[0116] The 3D spatial mapping module is used to map the coordinates of mesh nodes in the parameter space back to the 3D physical space, generate the initial finite element mesh, and calculate the 3D coordinates of each mesh node in the initial finite element mesh.
[0117] The adaptive correction module is used to identify the mesh element type based on the number of mesh nodes in the initial finite element mesh, and to adaptively correct the orientation of the initial finite element mesh according to the identified mesh element type, which conforms to the right-hand screw rule.
[0118] The quality assessment module is used to convert the corrected mesh node and mesh cell connection relationships into a TCL command stream format that can be recognized by the OpenSEES software, and to perform quality assessment on the target mesh in the TCL command stream format until the target mesh meets the quality requirements.
[0119] Example 3: This application provides an electronic device, such as... Figure 4 As shown, it includes: at least one processor, at least one memory, and a data bus;
[0120] The processor and memory communicate with each other via a data bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the Grasshopper-based NURBS surface finite element mesh generation method as described in Example 1.
[0121] Example 4: This application provides a non-transitory computer-readable storage medium that stores computer instructions that cause a computer to execute the Grasshopper-based NURBS surface finite element mesh generation method of Example 1.
[0122] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0123] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0124] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0125] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0126] Those skilled in the art will understand that all or part of the steps in the above facts and methods can be implemented by a program instructing related hardware. The program or the program described therein can be stored in a computer-readable storage medium. When the program is executed, it includes the following steps: at this time, the corresponding method steps are introduced. The storage medium can be ROM / RAM, magnetic disk, optical disk, etc.
[0127] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for generating a finite element mesh of a NURBS surface based on Grasshopper, characterized in that, The specific steps include the following: Extract the NURBS surface geometry data to be analyzed from the Rhino or Grasshopper platform, and discretize the extracted NURBS surface geometry data in the parameter space; Based on the obtained mesh size requirements, mesh node coordinates are generated in the parameter space based on the discretization results; The coordinates of the mesh nodes in the parameter space are mapped back to the three-dimensional physical space to generate an initial finite element mesh, and the three-dimensional coordinates of each mesh node in the initial finite element mesh are calculated. Based on the number of mesh nodes in the initial finite element mesh, the mesh element type is identified, and the initial finite element mesh is adaptively corrected according to the identified mesh element type, which conforms to the right-hand screw rule. The connection relationships of the corrected mesh nodes and mesh cells are converted into the TCL command stream format that can be recognized by the OpenSEES software, and the quality of the target mesh in the TCL command stream format is evaluated until the target mesh meets the quality requirements. The mesh cell types include three-node ShellDKGT cells and four-node ShellDKGQ cells; wherein: When a mesh element consists of three nodes, it is determined to be a three-node ShellDKGT element; When a mesh element consists of four nodes, it is determined to be a four-node ShellDKGQ element; The initial finite element mesh is subjected to adaptive orientation correction according to the right-hand screw rule, specifically as follows: S41, For each mesh cell, calculate the cell normal vector of the plane containing the mesh cell; S42, calculate the angle between the normal vector at this point in the NURBS surface geometry data and the element normal vector. When the angle exceeds 90°, it indicates that the element direction is opposite to the surface normal, so flip it. S43. If the included angle exceeds 90°, adjust the node connection sequence so that the element direction conforms to the right-hand screw rule. The adjustment method is to swap the positions of adjacent nodes. S44, Verify whether the adjusted mesh elements satisfy the right-hand screw rule; S45, traverse all the mesh cells and execute steps S41-S44 until all mesh cells have the same cell orientation or pass the verification.
2. The method for generating NURBS surface finite element meshes based on Grasshopper according to claim 1, characterized in that, The quality assessment of the target mesh in TCL command stream format until the target mesh meets the quality requirements includes: S51, calculate the quality index of each grid cell in the target grid, wherein the quality index includes at least aspect ratio, distortion, Jacobian, and area deviation; S52, determine whether each indicator in the quality index meets the set quality threshold, and identify the grid cell that does not meet the quality threshold as a low quality cell. S53, for the region where the low-quality cells are concentrated, increase the grid density by a multiple in the parameter space and regenerate a new local network; S54, Recalculate the new positions of each grid node in the low-quality cell based on the local network, and re-evaluate the quality based on the new positions; S55, Repeat steps S51-S54 until there are no low-quality cells in the target mesh.
3. The method for generating NURBS surface finite element meshes based on Grasshopper according to claim 1, characterized in that, The calculation of the three-dimensional coordinates of each mesh node in the initial finite element mesh is achieved in the following way: For each grid node coordinate in the parameter space, substituting them into the NURBS surface equation yields the three-dimensional coordinates of each grid node. The NURBS surface equation is as follows: ; In the formula, Indicates the weighting coefficient. , Let P and q be the B-spline basis functions, respectively. The set of control point coordinates and grid node coordinates is: , , ; Represents the parameters in three-dimensional space and parameters The coordinate vector of any point on the NURBS surface is determined jointly. For parameters in the U direction of the NURBS surface, These are the parameters in the V direction of the NURBS surface; This represents the number of vertices of the NURBS surface in the U direction. This represents the number of vertices of the NURBS surface in the V direction. This represents the vertex index of the NURBS surface in the U direction. This is the vertex index of the NURBS surface in the V direction.
4. The method for generating NURBS surface finite element meshes based on Grasshopper according to claim 2, characterized in that, The encryption multiplier is calculated in the following way: ; In the formula, Indicates the encryption multiplier. Indicates aspect ratio, For the degree of distortion, For Jacobi, This is for area deviation.
5. The method for generating NURBS surface finite element meshes based on Grasshopper according to claim 2, characterized in that, The new positions of each grid node are as follows: ; In the formula, For the new location of the grid node, This represents the original position of the grid node. This represents the smoothing coefficient, and its value range is... ; For grid nodes The set of adjacent nodes, Represents the set of adjacent nodes The cardinality, that is The number of elements in the middle; Indicates the first The three-dimensional coordinate vector of each grid node. , These are the coordinate components of the grid node in three-dimensional space.
6. A Grasshopper-based NURBS surface finite element mesh generation system, applied to the Grasshopper-based NURBS surface finite element mesh generation method according to any one of claims 1-5, characterized in that, include: The discretization module is used to extract the NURBS surface geometry data to be analyzed from the Rhino or Grasshopper platform and discretize the extracted NURBS surface geometry data in the parameter space. The coordinate generation module is used to generate grid node coordinates in the parameter space based on the discretization results and the obtained grid size requirements. The three-dimensional space mapping module is used to map the coordinates of the mesh nodes in the parameter space back to the three-dimensional physical space, generate the initial finite element mesh, and calculate the three-dimensional coordinates of each mesh node in the initial finite element mesh. An adaptive correction module is used to identify the type of mesh element based on the number of mesh nodes in the initial finite element mesh, and to perform adaptive correction of the initial finite element mesh based on the identified mesh element type, which conforms to the right-hand screw rule. The quality assessment module is used to convert the corrected mesh node and mesh cell connection relationships into a TCL command stream format that can be recognized by the OpenSEES software, and to perform quality assessment on the target mesh in the TCL command stream format until the target mesh meets the quality requirements.
7. An electronic device, characterized in that, include: At least one processor, at least one memory, and a data bus; The processor and the memory communicate with each other via the data bus. The memory stores program instructions that can be executed by the processor, which invokes the program instructions to execute the Grasshopper-based NURBS surface finite element mesh generation method as described in any one of claims 1-5.
8. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions that cause the computer to execute the Grasshopper-based NURBS surface finite element mesh generation method according to any one of claims 1-5.