A structured hexahedral anisotropic mesh generation method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-24
- Publication Date
- 2026-08-11
AI Technical Summary
[0006]针对现有技术的以上缺陷或改进需求,本发明提供了一种结构化六面体非均匀网格生成方法,其目的在于解决现有技术中结构化均匀网格生成方法无法在计算精度与计算效率之间取得良好平衡的缺陷
Smart Images

Figure CN122550858A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of computer-aided engineering (CAE) simulation preprocessing, and more specifically, relates to a method for generating structured hexahedral non-uniform meshes. Background Technology
[0002] In computer-aided engineering (CAE) simulation analysis of complex structures, mesh generation is a fundamental step in numerical simulation, and its quality and efficiency directly affect the accuracy and speed of subsequent calculations. Structured hexahedral meshes, due to their good element quality, high computational efficiency, and adaptability to simulating boundary layers and local feature regions, are of significant value in simulations in fields such as fluid mechanics, structural mechanics, and thermal analysis. However, efficiently and robustly generating high-quality structured hexahedral non-uniform meshes for three-dimensional solid models with complex geometries and large differences in feature scales has always been a challenge in CAE preprocessing.
[0003] Currently, most common structured mesh generation methods are based on the idea of uniform mesh generation, such as ray casting and slicing. These methods typically first uniformly discretize the model and then generate the mesh through projection or mapping. In implementation, these methods require extensive traversal and intersection calculations of the model's triangular facets (e.g., in STL format), resulting in high time complexity. When the model structure is complex and rich in detailed features, the number of triangular facets increases dramatically. Furthermore, structured uniform mesh methods struggle to flexibly adapt to the varying mesh density requirements of different regions, often leading to wasted computational resources or insufficient local accuracy.
[0004] While existing non-uniform mesh generation methods can meet local mesh refinement requirements, they face two main bottlenecks: First, adaptive methods based on geometric feature fields (such as curvature fields and wall thickness fields) or driven by physical fields, although capable of automatic mesh refinement, suffer from computationally intensive and complex feature field calculations, significantly increasing preprocessing overhead. Second, interactive methods relying on manual experience to define the refinement region suffer from low automation, cumbersome operation, and difficulty in guaranteeing mesh continuity and quality, requiring a high level of user expertise. Furthermore, regardless of whether the method is uniform or non-uniform, its robustness is highly dependent on the geometric integrity of the model. Common defects on model surfaces, such as small gaps, inconsistent surface normals, and non-manifold geometry, can easily lead to mesh generation failure or the generation of malformed elements, further limiting the method's versatility and automation level.
[0005] With the increasing demands for computational accuracy in high-fidelity numerical simulations, local mesh refinement in key areas such as stress concentration zones, boundary layers, and areas with large flow gradients has become an inevitable trend, leading to a significant increase in the size and complexity of non-uniform meshes. Therefore, there is an urgent need to design an efficient, automatic, and robust method for generating structured hexahedral non-uniform meshes to meet the high-precision simulation requirements of complex models. Summary of the Invention
[0006] In view of the above-mentioned defects or improvement needs of the existing technology, the present invention provides a method for generating structured hexahedral non-uniform meshes, the purpose of which is to solve the defect that the existing structured uniform mesh generation methods cannot achieve a good balance between computational accuracy and computational efficiency.
[0007] To achieve the above objectives, according to one aspect of the present invention, a method for generating structured hexahedral non-uniform meshes is provided, comprising the following steps: S1. Spatial discretization sampling is performed on the input STL 3D model to construct a 3D voxel bitmap for determining whether spatial points are located inside or outside the model; S2. Based on the three-dimensional voxel bitmap, the bounding box space where the model is located is recursively subdivided using an octree data structure. Specifically, nodes containing the model surface are recursively subdivided until a preset minimum mesh size is reached. For nodes that are completely inside or outside the model, if their size is greater than the preset maximum mesh size, they are further subdivided until they are no larger than that size; otherwise, they are left as is. S3. From the subdivided octree, extract all subtrees rooted at nodes whose size is equal to the maximum mesh size. Treat each subtree as an independent octree and store it in a three-dimensional array according to the spatial position of its root node. This three-dimensional array is used to store multiple octrees, thereby generating a structured non-uniform hexahedral mesh.
[0008] Preferably, step S1 specifically includes: S11: Import STL 3D model and read the triangular facet data of the 3D model; S12: Get the user-specified minimum grid size and maximum grid size ,in , n It is an integer greater than or equal to 0; S13: Create an octree root node Root1, whose size is not smaller than the bounding box of the model, representing the three-dimensional space where the bounding box of the model is located, and mark it as a gray node. The gray node is a node in the space represented by the node that has a triangular face. S14: Based on the intersection relationship between the model's triangular facets and the node space, recursively combine the elements with dimensions larger than [the specified values]. The gray nodes are subdivided into child nodes until the size of all gray nodes is equal to the specified size. ; S15: Create a three-dimensional voxel structure, initializing all positions to the second state; S16: Set the size to equal The spatial positions corresponding to the leaf nodes are marked as the first state in the three-dimensional voxel bitmap to characterize the surface information of the model; S17: Using the octree generated in step S13 as a spatial index, the internal points of the model are determined by the ray method, and the voxel bitmap positions corresponding to the internal points are marked as the first state, thereby generating a three-dimensional voxel bitmap containing information about the model's interior, exterior and surface.
[0009] Preferably, the recursive subdivision step in step S2 specifically includes: S21: Create an octree root node Root2, whose size is equal to that of the octree root node created in S13. The node types are divided into gray nodes, black nodes, and white nodes. The root node is marked as a gray node. The gray node is a node whose represented space has triangular faces. The black node is a node located inside the model and whose represented space does not have triangular faces. The white node is a node located outside the model and whose represented space does not have triangular faces. S22: Recursively decompose the root node, perform different recursive decomposition processes for gray and black nodes, and mark white nodes as leaf nodes. The recursive operation performed on the gray node is as follows: create child nodes; if there is a triangular face in the space represented by the child node, mark it as a gray node; otherwise, determine whether the child node is located inside the model based on the 3D voxel bitmap. If it is located outside, mark it as a white node; if it is located inside, mark it as a black node; determine whether to further subdivide the child node or mark it as a leaf node based on the type and size of the child node. The recursive operations performed on a black node are: create child nodes; mark all child nodes as black nodes; and determine whether to further subdivide the child node or mark it as a leaf node based on its size.
[0010] Preferably, the recursive operation on the gray nodes in step S22 is as follows: a. Create eight child nodes for the current gray node. If the space represented by the child node intersects with the triangular face, mark the child node as a gray node. If there is no intersection and the space represented by the node is in the first state in the voxel bitmap, mark the child node as a black child node. If there is no intersection and the space represented by the node is in the second state in the voxel bitmap, mark the child node as a white child node. b. Traverse all child nodes: If a child node is white, mark it as a leaf node; If the child node is a black node and its size is larger than the maximum grid size If so, then the recursive operation for the black node in step S22 is executed; If the child node is a black node and its size is less than or equal to 1, If so, mark it as a leaf node; If the child node is a gray node and its size is larger than the minimum grid size If so, then the recursive operation for the gray node in step S22 is performed on the gray node; If the child node is a gray node and its size is equal to... If it is, then mark it as a leaf node.
[0011] Preferably, the recursive operation on the black node in step S22 is as follows: Create eight child nodes for the current black node, and mark all child nodes as black; Traverse all child nodes: If the size of the child node is greater than the maximum grid size If so, then the recursive operation for the black node in step S22 is performed on the child node; If the size of the child node is less than or equal to If it is, then mark it as a leaf node.
[0012] Preferably, step S3 specifically includes: S31: Create a 3D array to store the octree. The length of this array in each dimension is obtained by dividing the length of the model's bounding box in the corresponding direction by 1 / 2. And round up to get the result; S32: Traverse the octree generated in step S2, for each size equal to... For each node, its subtree is extracted as an independent octree with that node as the root; then, the offset of the smallest corner point coordinates of the cube represented by that node relative to the smallest corner point of the model's bounding box is calculated, and this offset is divided by... Obtain the integer index and store the octree in the corresponding position in the three-dimensional array according to the index; S33: Use the cube regions corresponding to all leaf nodes of each octree in the three-dimensional array as the final hexahedral mesh units.
[0013] Preferably, the three-dimensional voxel bitmap consists of several grids with side lengths equal to the minimum grid size. It consists of voxel nodes, each voxel node is used to identify whether its corresponding spatial location is outside or inside the model.
[0014] Preferably, the minimum grid size and maximum grid size The value is preset by the user based on the model's geometric features and simulation accuracy requirements.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the above-described method for generating a structured hexahedral non-uniform mesh.
[0016] In summary, compared with the prior art, the structured hexahedral non-uniform mesh generation method provided by this invention has the following advantages: 1. The method of this invention accurately captures the geometric boundaries of the model through fine voxel bitmaps, ensuring that key features are not lost. Simultaneously, it combines an octree adaptive subdivision mechanism to automatically adjust the mesh density according to surface complexity, effectively controlling the overall mesh size while maintaining model geometric accuracy and avoiding resource waste caused by excessive subdivision. The structured non-uniform mesh ultimately generated by this invention ensures computational accuracy in key regions while reducing the number of meshes in non-critical regions, achieving a good balance between computational accuracy and efficiency. Furthermore, the entire process is highly automated, insensitive to geometric defects in the model, and possesses good versatility.
[0017] 2. The method of the present invention avoids the global traversal of triangular faces and complex intersection operations in traditional methods, which greatly reduces the time complexity and algorithm implementation difficulty, significantly improves the efficiency and robustness of mesh generation, simplifies the structured mesh generation process, and significantly reduces the overall computational overhead.
[0018] 3. The voxelization preprocessing in this invention can automatically repair some geometric problems, is not sensitive to geometric defects in the model (such as small holes, self-intersections, inconsistent normals, etc.), the mesh generation process is more stable, less prone to failure or abnormal situations, and reduces the workload of preprocessing. Attached Figure Description
[0019] Figure 1 This is a flowchart of a method for generating a structured hexahedral non-uniform mesh according to the present invention.
[0020] Figure 2 This is a schematic diagram of the octree node definition and octree structure in an embodiment of the present invention.
[0021] Figure 3 This is a schematic diagram of a two-dimensional voxel bitmap constructed in an embodiment of the present invention.
[0022] Figure 4 This is a schematic diagram of a non-uniform mesh generated using the method of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0024] Please see Figure 1 This embodiment provides a method for generating structured hexahedral non-uniform meshes, specifically including: S1. Spatial discretization sampling is performed on the input 3D model to construct a 3D voxel bitmap for determining whether spatial points are located inside or outside the model; Specifically, the steps for constructing a 3D voxel bitmap are as follows: S11: Import STL 3D model and read the triangular facet data of the 3D model; Specifically, load the STL model that needs to be meshed, read and store all triangular faces, number each triangular face, and obtain the information of the corresponding triangular face through the number; S12: Get the user-specified minimum grid size and maximum grid size ,in , n It is an integer greater than or equal to 0; S13: Create an octree root node Root1, whose size is not smaller than the bounding box of the model, representing the three-dimensional space where the bounding box of the model is located, and mark it as a gray node. The gray node is a node in the space represented by the node that has a triangular face. Specifically, create the root node Root1 of the octree structure. This octree node should contain the following attribute: a real number. size , used to represent the side length of the node; a list of integers. triangleIds This is used to store the numbers of the triangles that intersect with this node; an array. children , used to store the 8 child nodes of this node; an integer materialCode Used to store the material number of the current node; a boolean value. isLeaf Used to identify whether the node is a leaf node; an enumeration value type A color used to identify the node; an array position This is used to store the coordinates of the current node in three-dimensional space. The node definition and octree structure are as follows: Figure 2 As shown, the pseudocode definition is shown in Table 1 below.
[0025]
[0026] Specifically, initialize the root node Root1, collect the vertex coordinates of all triangle faces, and obtain the maximum x-value of the triangle face vertex coordinates. Xmax The maximum value of the y-coordinate of the vertex of the triangle Ymax The maximum value of the z-coordinate of the vertex of the triangle Zmax Minimum x-coordinate of the vertex of the triangle Xmin Minimum y-value of the vertex coordinates of the triangle Ymin The minimum value of the z-coordinate of the vertex of the triangle Zmin The node's position in 3D space is initialized to... , , ; Node size Initialize to the minimum value that satisfies the following formula, the specific formula is as follows:
[0027] Among them, the nodes triangleIds Initialize the storage of all triangle face numbers; initialize the node's children to empty; initialize the material code to the entity's material number; initialize the node's IsLeaf to false; initialize the node's type to a gray node; n is a positive integer.
[0028] S14: Based on the intersection relationship between the model's triangular facets and the node space, recursively add elements with dimensions larger than the minimum mesh size. The gray nodes are subdivided into child nodes until the size of all gray nodes is equal to the minimum grid size. ; Specifically, the root node is set as the current node (Current Node). The size of the Current Node is then checked. If the size of the Current Node is not... Then create gray child nodes and set each gray child node as a Current Node, performing the same operation; if the size of the Current Node is equal to If the condition is met, the node is marked as a leaf node, and the corresponding bitmap node is marked as true. The gray nodes are nodes that have triangular faces in the space they represent.
[0029] S15: Create a three-dimensional voxel structure, initializing all positions to the second state; Specifically, the process of constructing a 3D voxel bitmap is as follows: Figure 3 As shown, the bitmap structure represents a discretized hexahedral space, and the number of layers in the bitmap along the x, y, and z axes are respectively... NXMIN ,NYMIN and NZMIN The number of nodes is NXMIN × NYMIN × NZMIN Each bitmap node represents a regular hexahedral space with a size of [size missing]. SMIN × SMIN × SMIN Each bitmap node is initialized to false. NXMAIN, NYMIN, and NZMIN are calculated using the following formula:
[0030] S16: Set the size to equal the minimum grid size The spatial positions corresponding to the leaf nodes are marked as the first state in the three-dimensional voxel bitmap to characterize the surface information of the model; Specifically, traverse all octrees with a size equal to For each leaf node, its index coordinates (px, py, pz) in the 3D voxel bitmap are calculated based on the cubic space range it represents, and the voxel at that coordinate is marked as true. The voxel index coordinates corresponding to the leaf nodes are calculated using the following formula:
[0031] S17: Using the octree generated in step S13 as a spatial index, the ray method is used to determine the points inside the model, and the voxel bitmap positions corresponding to the internal points are marked as the first state, thereby generating a three-dimensional voxel bitmap containing information about the model's interior, exterior and surface. Specifically, the obtained octree structure is used as the index to accelerate the ray tracing method, find the points inside the model, and calculate their index coordinates in the 3D voxel bitmap. , , ), mark it as true, and you will get the complete bitmap.
[0032] S2. Based on the three-dimensional voxel bitmap, the bounding box space where the model is located is recursively subdivided using an octree data structure. Specifically, nodes containing the model surface are recursively subdivided until a preset minimum mesh size is reached. For nodes that are completely inside or outside the model, if their size is greater than the preset maximum mesh size, they are further subdivided until they are no larger than that size; otherwise, they are left as is. Specifically, it includes: S21: Create an octree root node Root2, whose initial value is equal to the octree root node created in S13. Node types are divided into gray nodes, black nodes, and white nodes. The root node is marked as a gray node. The gray node is a node whose represented space has triangular faces. The black node is a node located inside the model and whose represented space does not have triangular faces. The white node is a node located outside the model and whose represented space does not have triangular faces. S22: Recursively decompose the root node, perform different recursive decomposition processes for gray and black nodes, and mark white nodes as leaf nodes. The recursive operation performed on the gray node is as follows: create child nodes; if there is a triangular face in the space represented by the child node, mark it as a gray node; otherwise, determine whether the child node is located inside the model based on the 3D voxel bitmap. If it is located outside the model, mark it as a white node; if it is located inside the model, mark it as a black node; determine whether to further subdivide the child node or mark it as a leaf node based on the type and size of the child node. The recursive operations performed on a black node are: create child nodes; mark all child nodes as black nodes; and determine whether to further subdivide the child node or mark it as a leaf node based on its size.
[0033] Specifically, the recursive operation on the gray nodes in step S22 is as follows: a. Create eight child nodes for the current gray node. If the space represented by the child node intersects with the triangle face, mark the child node as a gray node. If there is no intersection and the space represented by the node is true in the voxel bitmap, mark the child node as a black child node. If there is no intersection and the space represented by the node is false in the voxel bitmap, mark the child node as a white child node.
[0034] b. Traverse all child nodes: If a child node is white, mark it as a leaf node; If the child node is a black node and its size is larger than the maximum grid size If so, then the recursive operation of step S22 is performed on the black node; If the child node is a black node and its size is less than or equal to the maximum grid size If so, mark it as a leaf node; If the child node is a gray node and its size is larger than the minimum grid size If so, then the recursive operation for the gray node in step S22 is performed on the gray node; If the child node is a gray node and its size is equal to... If it is, then mark it as a leaf node.
[0035] Specifically, the recursive operation on the black node in step S22 is as follows: Create eight child nodes for the current black node, and mark all child nodes as black; Traverse all child nodes: If the size of the child node is greater than the maximum grid size If so, then the recursive operation for the black node in step S22 is performed on the child node; If the size of the child node is less than or equal to If it is, then mark it as a leaf node.
[0036] S3. Extract all subtrees rooted at nodes with a size equal to the maximum mesh size from the subdivided octree. Treat each subtree as an independent octree and store it in a three-dimensional array according to the spatial position of its root node. This three-dimensional array is used to store multiple octrees, thereby generating a structured non-uniform hexahedral mesh.
[0037] S3 specifically includes: S31: Create a 3D array to store the octree. The length of this array in each dimension is obtained by dividing the length of the model's bounding box in the corresponding direction by 1 / 2. And round up to get the result; Specifically, creating a three-dimensional array V [ NXMAX ][ NYMAX ][ NZMAX The array has lengths of 1, 2, and 3 in the x, y, and z dimensions, respectively. NXMAX , NYMAX , NZMAX .in , , , Xmax The maximum x-value of the vertex coordinates of the triangle. Ymax The maximum value of the y-coordinate of the vertex of the triangle. Zmax The maximum value of the z-coordinate of the vertex of the triangle. Xmin The minimum x-coordinate of the vertex of the triangle. Ymin The minimum y-value of the vertex coordinates of the triangle. Zmin It represents the minimum z-coordinate of the vertex of the triangle. V Each element stored is an octree root node named CompositeVoxel, which contains the following attributes: node size, child node array children, material code materialCode, leaf node identifier isLeaf, and position. The pseudocode definition is shown in Table 2 below.
[0038]
[0039] S32: Traverse the octree generated in step S2, for each size equal to... For each node, its subtree is extracted as an independent octree with that node as the root; then, the offset of the smallest corner point coordinates of the cube represented by that node relative to the smallest corner point of the model's bounding box is calculated, and this offset is divided by... Obtain the integer index and store the octree in the corresponding position in the three-dimensional array according to the index; Specifically, for all of its dimensions equal to The node is treated as the root of an octree. The octree is reconstructed using a CompositeVoxel structure instead of the original Octree structure. The index coordinates (i, j, k) of the node in the VoxelArray are calculated and inserted into the corresponding position. The index coordinates (i, j, k) are calculated using the following formula:
[0040] S33: Determine the leaf nodes of the complex element structure stored in the three-dimensional array as the final hexahedral mesh element.
[0041] After completing the above steps, as follows Figure 4 As shown, the three-dimensional array V is the complete structured non-uniform mesh, where a leaf node represents a cell.
[0042] In summary, this invention accurately captures the geometric boundaries of the model through fine voxel bitmaps, ensuring that key features are not lost. Combined with an octree adaptive subdivision mechanism, it automatically adjusts the mesh density based on surface complexity, effectively controlling the overall mesh size while maintaining model geometric accuracy and avoiding resource waste caused by excessive subdivision. This invention achieves efficient, robust, and automated generation of structured hexahedral non-uniform meshes while ensuring mesh quality and accuracy.
[0043] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements 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 structured hexahedral non-uniform meshes, characterized in that: Includes the following steps: S1. Spatial discretization sampling is performed on the input STL 3D model to construct a 3D voxel bitmap for determining whether spatial points are located inside or outside the model; S2. Based on the three-dimensional voxel bitmap, the bounding box space where the model is located is recursively subdivided using an octree data structure. Specifically, nodes containing the model surface are recursively subdivided until a preset minimum mesh size is reached. For nodes that are completely inside or outside the model, if their size is greater than the preset maximum mesh size, they are further subdivided until they are no larger than that size; otherwise, they are left as is. S3. From the subdivided octree, extract all subtrees rooted at nodes whose size is equal to the maximum mesh size. Treat each subtree as an independent octree and store it in a three-dimensional array according to the spatial position of its root node. This three-dimensional array is used to store multiple octrees, thereby generating a structured non-uniform hexahedral mesh.
2. The method for generating a structured hexahedral non-uniform mesh as described in claim 1, characterized in that: Step S1 specifically includes: S11: Import STL 3D model and read the triangular facet data of the 3D model; S12: Get the user-specified minimum grid size and maximum grid size ,in , n It is an integer greater than or equal to 0; S13: Create an octree root node Root1, whose size is not smaller than the bounding box of the model, representing the three-dimensional space where the bounding box of the model is located, and mark it as a gray node. The gray node is a node in the space represented by the node that has a triangular face. S14: Based on the intersection relationship between the model's triangular facets and the node space, recursively add elements with dimensions larger than the minimum mesh size. The gray nodes are subdivided into child nodes until the size of all gray nodes is equal to the minimum grid size. ; S15: Create a three-dimensional voxel structure, initializing all positions to the second state; S16: Set the size to equal the minimum grid size The spatial positions corresponding to the leaf nodes are marked as the first state in the three-dimensional voxel bitmap to characterize the surface information of the model; S17: Using the octree generated in step S13 as a spatial index, the internal points of the model are determined by the ray method, and the voxel bitmap positions corresponding to the internal points are marked as the first state, thereby generating a three-dimensional voxel bitmap containing information about the model's interior, exterior and surface.
3. The method for generating a structured hexahedral non-uniform mesh as described in claim 2, characterized in that: The recursive subdivision steps in step S2 specifically include: S21: Create an octree root node Root2, whose size is equal to that of the octree root node Root1 created in S13. Node types are divided into gray nodes, black nodes, and white nodes. Mark the root node as a gray node. The gray node is a node whose represented space contains triangular faces. The black node is a node located inside the model and whose represented space does not contain triangular faces. The white node is a node located outside the model and whose represented space does not contain triangular faces. S22: Recursively decompose the root node, perform different recursive decomposition processes for gray and black nodes, and mark white nodes as leaf nodes. The recursive operation performed on the gray node is as follows: create child nodes; if there is a triangular face in the space represented by the child node, mark it as a gray node; otherwise, determine whether the child node is located inside the model based on the 3D voxel bitmap. If it is located outside the model, mark it as a white node; if it is located inside the model, mark it as a black node; determine whether to further subdivide the child node or mark it as a leaf node based on the type and size of the child node. The recursive operations performed on a black node are: create child nodes; mark all child nodes as black nodes; and determine whether to further subdivide the child node or mark it as a leaf node based on its size.
4. The method for generating a structured hexahedral non-uniform mesh as described in claim 3, characterized in that: The recursive operation on the gray nodes in step S22 is as follows: a. Create eight child nodes for the current gray node. If the space represented by the child node intersects with the triangular face, mark the child node as a gray node. If there is no intersection and the space represented by the node is in the first state in the voxel bitmap, mark the child node as a black child node. If there is no intersection and the space represented by the node is in the second state in the voxel bitmap, mark the child node as a white child node. b. Traverse all child nodes: If a child node is white, mark it as a leaf node; If the child node is a black node and its size is larger than the maximum grid size If so, then the recursive operation for the black node in step S22 is executed; If the child node is a black node and its size is less than or equal to the maximum grid size If so, mark it as a leaf node; If the child node is a gray node and its size is larger than the minimum grid size If so, then the recursive operation for the gray node in step S22 is performed on the gray node; If the child node is a gray node and its size is equal to... If it is, then mark it as a leaf node.
5. The method for generating a structured hexahedral non-uniform mesh as described in claim 3, characterized in that: The recursive operation on the black node in step S22 is as follows: Create eight child nodes for the current black node, and mark all child nodes as black; Traverse all child nodes: If the size of the child node is greater than the maximum grid size If so, then the recursive operation for the black node in step S22 is performed on the child node; If the size of the child node is less than or equal to If it is, then mark it as a leaf node.
6. The method for generating a structured hexahedral non-uniform mesh as described in claim 1, characterized in that: Step S3 specifically includes: S31: Create a 3D array to store the octree. The length of this array in each dimension is obtained by dividing the length of the model's bounding box in the corresponding direction by 1 / 2. And round up to get the result; S32: Traverse the octree generated in step S2, for each size equal to... For each node, its subtree is extracted as an independent octree with that node as the root; then, the offset of the smallest corner point coordinates of the cube represented by that node relative to the smallest corner point of the model's bounding box is calculated, and this offset is divided by... Obtain the integer index and store the octree in the corresponding position in the three-dimensional array according to the index; S33: Use the cube regions corresponding to all leaf nodes of each octree in the three-dimensional array as the final hexahedral mesh units.
7. The method for generating a structured hexahedral non-uniform mesh as described in claim 1, characterized in that: The three-dimensional voxel bitmap consists of several grids with side lengths as the minimum grid size. It consists of voxel nodes, each voxel node is used to identify whether its corresponding spatial location is outside or inside the model.
8. The method for generating a structured hexahedral non-uniform mesh as described in claim 1, characterized in that: The minimum grid size and maximum grid size The value is preset by the user based on the model's geometric features and simulation accuracy requirements.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the structured hexahedral non-uniform mesh generation method as described in any one of claims 1 to 8.