A Density Control Based Adaptive Hexahedral Mesh Generation Algorithm

A density control based adaptive hexahedral mesh generation algorithm for three dimensional models is presented in this paper. The first step of this algorithm is to identify the characteristic boundary of the solid model which needs to be meshed. Secondly, the refinement fields are constructed and modified according to the conformal refinement templates, and used as a metric to generate an initial grid structure. Thirdly, a jagged core mesh is generated by removing all the elements in the exterior of the solid model. Fourthly, all of the surface nodes of the jagged core mesh are matching to the surfaces of the model through a node projection process. Finally, the mesh quality such as topology and shape is improved by using corresponding optimization techniques.


Introduction
With the development of computer technology and numerical method, numerical simulation methods play more and more important roles in the fields of science research and engineering applications.Mesh generation is the key technique in the preprocessing part of numerical analysis software, and its task is to discretize the solid model into a 'mesh' composed of a number of elements.The efficiency and accuracy of numerical analysis and the reliability of software computation are strongly dependent on the density and quality of mesh model.In three-dimensional numerical analysis, tetrahedron, hexahedron and a combination of them are usually used.Tetrahedral element meshes have the advantage of high efficiency, easy to implementation, flexible for adaptive mesh generation and easy to realize the mesh regeneration.At present, the automatic generation technology of tetrahedral element meshes is fully mature, and it is employed extensively to handle complex geometries.However, hexahedral element meshes have been proved to be superior to tetrahedron element meshes in terms of analysis accuracy, amount of meshes, distortion resistance and regeneration times.This turns hexahedra an attractive choice for the numerical analysis of three-dimensional problems.
Due to the own characteristics of finite element mesh, the quality of deformed mesh has a great effect on the accuracy of numerical analysis.A sound mesh generation is necessary and can significantly improve the accuracy and efficiency of the analysis.Up to now, many researches have been done in developing the automatic hexahedral mesh generation algorithms [1][2][3].There are mainly four typical approaches proposed for all-hexahedral mesh generation, including mapping/sweeping method [4,5], plastering method [6,7], whisker-weaving method [8,9] and the grid-based method [10,11].The grid-based method is relatively simple to implement and easy to realize the local refinement.Recently, with the development of the adaptive techniques of mesh generation, grid-based method is modified by many researchers and used widely in the mesh [12][13][14].Unfortunately, there are no demonstrated methods for creating grid-based, good-quality, reasonably density distributed hexahedral meshes.
Aiming at solving the problems of local refinement and mesh quality, this paper proposed an adaptive generation algorithm of the initial hexahedral element mesh based on the density control.The procedures of the adaptive hexahedral mesh generation algorithm are given.

Improved grid-based hexahedral mesh generation algorithm
The authors of this paper proposed an improved grid-based method for generating all hexahedral element mesh in the domain of a three-dimensional solid model [15].Figure 1 shows the flow chart of adaptive generation for hexahedral mesh.Detailed explanations of the key techniques shown in the flow chart will be systematically presented in the following sections.

Solid Model Construction and Boundary Identification
A solid model which can define its geometric features is constructed firstly.In this paper, triangulated boundary representations generated by CAD systems, as stereo lithography (STL) files for example, are used.The content of STL files is the data information of a series of triangle patches that approach the surfaces of three-dimensional solid model.Figure 2 shows the procedure of the adaptive hexahedral element mesh generation of a mechanical CAD model.Figure 2 The characteristic boundary of the solid model is identified through calculating the curvature of the triangle facets in the STL files.Firstly, the coplanar relationship among all the triangle facets is constructed through calculating the angle between the normal vectors of the triangle facet and those of the three other edge-adjacent triangle facets.All the triangle facets which are coplanar form a face named as SF.Then, the characteristic edge is identified by 295 judging the attribute of three edges of all the triangle facets in each face.If an edge is not shared by two adjacent triangle facets in the same face, it is defined as a characteristic edge (CL), otherwise it is usual edge.Thirdly, the characteristic node (CV) is identified based on the rule that the node, which is connected to three or more than three CL is a characteristic node.As shown in Figure 2(b), the circle nodes represent the characteristic node (CV), the thick real line is the characteristic edge (CL), and the shadowed face represents the surface of the analyzed solid model (SF).

Constructing Refinement Field and Generating The Refined Grid Structure
In order to accurately capture the surface features of the geometries, a curvature-based criterion is usually used.Firstly, refinement source points are added on the triangle facets where the directions of the adjacent facet's normal change.If the normal of any two of the edgeadjacent triangle facets make an angle of more than a given value ε, these two triangle facets are considered as a curve surface and source points are added on them.ε is a user-specified parameter to detect geometrical features and is assigned as 5° in this paper.If the sharing edge is an internal edge and its end vertices are not on boundary, the source points will be added on two end vertices.If the sharing edge is internal and its two end vertices are on the boundary, source points will be added on the sharing edge.The number of the source points on the sharing edge can be calculated by dividing the length of the sharing edge by the length of shortest edge among all the edges of the two adjacent triangles.Then, element refinement fields are constructed according to the source point fields.If an element contains more than one source points, it will be marked as the element to be refined.
To ensure the accuracy of numerical calculation, the thickness-based criterion needs to be used.This paper supposes that there are three layers elements in each direction of meshed model at least.From the point of topology, the above supposition can be simply states as that every straddling element must have not less than one vertex-adjacent interior element.Otherwise, it is marked as an element to be refined.
The first step for the initial refined grid structure generation is to generate a cubic grid structure enveloping the solid model.Then each cub is subdivided according to the conformal refinement templates in Figure 3 until curvature-based and thickness-based criterion stated above are satisfied.That is, there is not any element to be refined in the refinement field.The hypercriticism of the refinement criteria is unnecessary when the model is complex, because it will decrease the computation efficiency.As an addition, a convergence criterion of the repetition based on the ratio of the number of the refinement element in the element refinement fields to the total number of elements is employed.If the ratio is less than a valve value α, the repetition is stopped.α is assigned from 0 to 0.1 usually and is assigned as 0.001 in this paper.To avoid creating low quality elements, transition elements are not refined when the refinement step is more than one.Figure 2

Generating the Core Mesh
A uniformly sized or a locally refined hexahedral mesh system, which completely encompasses the solid model, is generated according to the geometries of the solid model.Usually, there is a relatively large distance between the surface of the grid structure and the surface of the solid model due to the complexity of model's geometry.By removing all the elements in the exterior of the solid model, a jagged core mesh which is well-shaped and near the solid boundary is generated.Figure 2(d) shows the jagged core mesh through eliminating the elements out of the solid model.

Matching The Core Mesh To The Solid Model
The surface of core mesh should be matched to the surface of the solid model.Firstly, the surfaces of the core mesh which can be considered as a polyhedron of quadrilateral faces are picked up and the normal vectors of the whole nodes on surfaces are calculated.Then, the corresponding mesh points of the nodes on the surface of the core mesh are generated as the intersection points of the normal vectors with the model surface.Finally, the hexahedral elements in the surface-gap are constructed by connecting all the nodes of the core mesh surface with their corresponding intersection nodes as the unit of a quadrilateral facet.As shown in Figure 2(d), the obtained corresponding points of point a, b, c and d are a1, b1, c1 and d1 respectively.The generated hexahedral element in the surface-gap is a-b-c-d-a1-b1-c1-d1. Figure 2(e) shows the resulting mesh after matching the surface of core mesh to the surface of the solid model.
From Figure 2(e) we can see that all the surface nodes of the mesh are on the surfaces of the solid model.It can also be seen that the CL of the solid model are still not described well by the filled mesh.Figure 2 (f) shows the mesh after finishing the surface filling and boundary matching.

Improving the Mesh Quality
The mesh quality is of vital importance for finite element automatic generation.Mesh quality improvement involves two main approaches, which are employed together in this paper.One is smoothing operation and the other is topological operation.Here the smoothing operation selects the scaled Jacobian and the condition number of the Jacobian matrix as the metrics to measure the mesh quality [16].It is assumed that the element is untangled, i.e. the scaled Jacobian value of a hexahedron must be positive.The condition number is defined as


, where T is the Jacobian matrix.An algebraic shape metric for a hexahedron is defined as  with k=1,…, 8.The full range of a hexahedron condition number value is from 0 to +1.The hexahedron whose condition number value is greater than about 0.2 represents geometrically well-shaped element and satisfies the need of finite element analysis.When the condition number of a hexahedron is between 0.5 and 1, it is considered as a very excellent resulting mesh.
By combining the Laplacian smoothing method with the optimization approach which chooses the mesh quality metric as the objective function, the mesh quality is improved significantly.Although after matching of all the nodes, smoothing techniques are conducted to improve the mesh quality, there are still severely distorted elements.This owns to the generations of some elements with poor quality in the geometrical topology, such as some elements sharing a CL with other elements and some elements with three nodes of a free facet fixed on a same CL.The quality of such elements possibly is out of the acceptable range of finite element analysis and cannot be improved with any node position smoothing.They are judged as degenerate elements.Because all the invalid elements exist on the CL of the solid model, the insertion technique and the collapsing technique are applied to the boundary elements according to their sharing CL of the solid model.The final mesh is obtained, as shown in Figure 2(g).Figure 4 shows the quality of the resulting mesh after optimization.The ratio of the elements which Condition Number is between 1 and 2 is 95.63%.

Discussion on the Algorithm
The main idea of the improved grid-based mesh generation algorithm is similar to those of other conventional grid-based method, but the initial grid structure is generated adaptively based on the geometric features of the solid model.As stated above, the first step of this algorithm is to import the solid model which needs to be meshed and then identify the characteristic boundary of the solid model.Secondly, the refinement fields are constructed and modified according to the conformal refinement templates, and used as a metric to generate an initial grid structure which is completely superposed on the solid model.Thirdly, a jagged core mesh is generated by removing all the elements in the exterior of the solid model.Fourthly, all of the surface nodes of the jagged core mesh are matching to the surfaces of the model through a node projection process, and a hexahedral element mesh model with the boundaries matched to the solid model are generated.Finally, the mesh quality such as topology and shape is improved by using corresponding optimization techniques.
These steps are all done automatically except the import process in the first step.Many studies have shown that the time expensed on the mesh generation usually takes up 80% of the time for the whole process of finite element analysis.So it is necessary to find out the timeconsumptive reason and the distribution of the required time for different mesh generation steps.In this paper, the time of the mesh generation was calculated on a Microsoft Windows XP PC with an Intel Pentium 3.00 GHz processor and 1.5 GB RAM. Figure 5 shows the ratio of the computation time in different steps of the mesh generation to the total computation time of the hexahedral element mesh generation for the solid model in Figure 2. In the figure, the abscissa represents the steps of the mesh generation process, where number 1-5 represent the serial number from the first step to the fifth step, respectively.The ordinate indicates the time ratio.It can be seen from Figure 5, the time ratios for the first step and the third step are relatively small.The expensed time of the second step is the longest.The sum of the time of the fourth step and the fifth step is more than a half of the total computation time.This paper presented a density control based algorithm for local refinement of hexahedral meshes by using 27-refinement method.The mesh quality is improved significantly by combining the Laplacian smoothing method with the optimization approach which chooses the mesh quality metric as the objective function.The efficiency and robustness of the algorithm were verified by the resulting meshes.The density control based hexahedral mesh generation algorithm improves the control ability of the element refinement and can generate the hexahedral meshes suitable for finite element analysis of three dimensional engineering problems.

Figure 1 .
Figure 1.Flow Chart of Adaptive Hexahedral Mesh Generation

Figure 2 .
Figure 2. Adaptive Initial Hexahedral Element Mesh Generation of a Mechanical CAD Model (a) Triangulated Solid Model; (b) Boundary Identification; (c) The Refined Grid Structure; (d) The Core Mesh; (e) The Matched Mesh; (f) The Filled and Matched Mesh; (g) The Final Generated Mesh.

Figure 4 .
Figure 4.The Quality of Mesh in Figure 2(g) with Condition Number Metric

Figure 5 . 2 
Figure 5. Ratios of computation time in mesh generation steps to the total computation time for the solid model in Figure2