 Research article
 Open Access
 Published:
A frontal approach to hexdominant mesh generation
Advanced Modeling and Simulation in Engineering Sciences volume 1, Article number: 8 (2014)
Abstract
Background
Indirect quad mesh generation methods rely on an initial triangular mesh. So called trianglemerge techniques are then used to recombine the triangles of the initial mesh into quadrilaterals. This way, highquality fullquad meshes suitable for finite element calculations can be generated for arbitrary twodimensional geometries.
Methods
In this paper, a similar indirect approach is applied to the threedimensional case, i.e., a method to recombine tetrahedra into hexahedra. Contrary to the 2D case, a 100% recombination rate is seldom attained in 3D. Instead, part of the remaining tetrahedra are combined into prisms and pyramids, eventually yielding a mixed mesh. We show that the percentage of recombined hexahedra strongly depends on the location of the vertices in the initial 3D mesh. If the vertices are placed at random, less than 50% of the tetrahedra will be combined into hexahedra. In order to reach larger ratios, the vertices of the initial mesh need to be anticipatively organized into a latticelike structure. This can be achieved with a frontal algorithm, which is applicable to both the two and threedimensional cases. The quality of the vertex alignment inside the volumes relies on the quality of the alignment on the surfaces. Once the vertex placement process is completed, the region is tetrahedralized with a Delaunay kernel. A maximum number of tetrahedra are then merged into hexahedra using the algorithm of YamakawaShimada.
Results
Nonuniform mixed meshes obtained following our approach show a volumic percentage of hexahedra that usually exceeds 80%.
Conclusions
The execution times are reasonable. However, nonconformal quadrilateral faces adjacent to triangular faces are present in the final meshes.
Background
Whether hexmeshing or tetmeshing is better for finite element computations is a longstanding controversy. This paper does not aim at deciding on that issue. Yet, it is a fact that a large number of finite element users would highly appreciate having automatic hexmeshing procedures for general 3D domains. A number of arguments can indeed be stated in favor of hexmeshing. For the same number of vertices, hex meshes have fewer elements, which speeds up the matrix/residual assembly. In solid mechanics, hexahedra exhibit higher accuracy than tetrahedra [1], which are plagued by locking problems [2]. In fluid dynamics, boundary layers made of hexahedra are effective for capturing large gradients and resolving viscous flows near the boundary, and semistructured boundarylayer meshes attract significant interest (see, e.g. [3–5]).
Hexahedral mesh generation is still an ongoing research [6], and a major conclusion so far is that the generation of fullhex conforming meshes on arbitrary domains is beyond our reach nowadays. Relaxing a bit the requirements, hexdominant meshes [7], in contrast with fullhex meshes, are allowed to aggregate a mixture of hexahedra, prisms, pyramids and tetrahedra. The goal of hexdominant meshing is to generate meshes where hexahedral elements dominate, both in number and volume. This paper presents such an algorithm to automatically generate nonuniform isotropic hexdominant meshes in arbitrary geometries. However, quadrilateral faces adjacent to triangular faces are usually found in the resulting meshes. Such nonconformities represent an additional complication for finite element methods. Various attempts at palliating the impact of these nonconformities have been discussed in the literature [8].
The proposed approach relies on an indirect strategy. The tetrahedra of an initial mesh are combined into hexahedra using YamakawaShimada’s algorithm [9], which works basically as follows: (i) All tetrahedra of an initial mesh are considered one after the other. (i i) The neighbors of each tetrahedron are visited in order to identify potential hexahedra. Candidate hexahedra are stored in an array and sorted with respect to their geometrical quality. (i i i) The algorithm then iterates through this array, starting from the highest quality hexahedron, in order to effectively generate the hexahedral elements. Hexahedra that are composed of available tetrahedra (not marked for deletion) and that preserve hexahedral conformity are successively added to the mesh.
However, meshes obtained by applying a recombination algorithm to an arbitrary tetrahedral mesh fail to be hexdominant. As an illustration, a mesh (depicted on Figure 1) was created using YamakawaShimada’s recombination algorithm from a tetrahedral mesh generated with the Delaunay refinement algorithm [10] of Gmsh [11]. The number of hexahedra in this mesh represents only 12.34% of the total number of elements.This low percentage of hexahedra results from the fact that the mesh vertices were not placed so as to favor recombination. In order to obtain higher ratios of good quality hexahedra, vertices need to be anticipatively aligned into a latticelike structure that respects the user prescribed mesh size and the preferred directions of the mesh. This is what we are going to do with a specific frontal algorithm.
In a perfect hexahedral mesh, each interior vertex is linked with six other vertices: leftright, abovebelow, frontback (four vertices in case of a perfect quadrangular mesh). The main idea of our vertex placement algorithm is based on that observation. Knowing the prescribed local mesh size and the local preferred mesh directions, each interior vertex attempts to spawn six new vertices. A prospective vertex, however, is effectively created only if it lays inside the domain and if it is not too close to an existing vertex. This algorithm is applied to the boundaries of the geometry, prior to the volumes. When done, the vertices are tetrahedralized and YamakawaShimada’s algorithm can be applied.
Our approach has some similarities with the advancing front method. The vertices are created layer by layer toward the center of the geometry. However, contrary to the advancing front method, our algorithm does not construct a mesh topology along the way. All tetrahedra are built at the end. Figure 2 illustrates the various steps of our approach. The basic input is a CAD geometry file readable by the Gmsh free software.
The Methods section first examines more closely a number of data structures, tools and concepts that contribute to make the algorithm more efficient. It then describes the two and threedimensional versions of the frontal algorithm. Finally, it discusses YamakawaShimada’s algorithm and the issue of finite element conformity. The Results and discussion section presents a number of application examples, including mesh statistics and execution times.
Previous work
A large variety of procedures for hexahedral meshing have been proposed over the years. This section reviews a certain number of them, focusing on the automatic ones.
Several techniques extract hexahedral meshes from octree data structures [12]. These methods can generate nonuniform fullhex meshes in arbitrary geometries. The hexahedra orientation is defined by the octree root, which is a cube englobing the geometry. Boundary hexahedra perpendicular to the boundary surface can be achieved by projecting buffer layers [13, 14]. The main limitations of octreebased approaches is that the generated hexahedra cannot be oriented flexibly, and that the quality of the hexahedra near boundaries is degraded [15].
Certain parametrization methods have been able to mesh complex threedimensional domains [16, 17]. These methods start by computing a threedimensional direction field. The singularities of the direction field are then identified. Later on, the domain is cut in order to place all singularities on the boundary and to reduce the genus to 0 [18]. A parametrization minimizing the difference between the hexahedra orientation and the threedimensional direction field is selected [19]. The supplementary cutting required to place all singularities on the boundary is necessary because it leads to a better parametrization [16]. Full hexahedral meshes of very good quality can be obtained for complicated domains. However, a variable mesh size cannot be prescribed [20]. Parametrization methods are very diverse. For example, a few algorithms capable of deforming a threedimensional domain into a polycube model have been developed [21]. The polycube model is meshed and redeformed back into its original shape.
Graph theory can be applied to the problem of creating hexahedra by recombining tetrahedra [22]. The starting point of the method is a tetrahedral mesh, which can be viewed as a graph. The method consists in searching through the mesh to identify subgraphs yielding hexahedra. There are six particular subgraphs to look for. Potential hexahedra can be constructed immediately or after classification along various criterions. This approach can be applied to prisms and pyramids as well. The recombination algorithm used throughout this article has been devised by Yamakawa and Shimada [9]. These authors have also designed an iterative procedure to align vertices in three dimensions. The first step of the procedure consists of filling the domain with crystal cells. Each crystal cell has the shape of a cube: there is one atom at the center and eight atoms in the corners. Crystal cells exert force on each other via their atoms. A set of equations of motion govern the cells positions. Throughout the process, cells can be added or removed depending on the local density. Once cells velocities have sufficiently decrease, the center of each crystal cell becomes a mesh vertex.
To improve the spatial distribution of the set of vertices (which has a large impact on the effectiveness of such graphbased approaches), several techniques have been proposed, such as a modified version of Lloyd’s algorithm. Lloyd’s algorithm repeatedly moves vertices to the centroid of their Voronoi cell [23]. As the number of iterations increases, the Voronoi cells take the shape of perfect hexagons. In fact, it has been proven that Lloyd’s algorithm minimizes an energy functional equal to the sum of the moments of inertia of the Voronoi cells [24]. LévyLiu’s algorithm consists of minimizing higher order moments of inertia: the Voronoi cells then become squarely instead of hexagonal, which has the effect of aligning vertices in precise directions. Tetrahedral meshes smoothed by LévyLiu’s algorithm make excellent candidates for recombination. When used in conjunction with the graph method discussed above, LévyLiu’s algorithm can generate mixed meshes with high hexahedra percentages [24]. However, the method presented in this article is frontal, not iterative. The vertices are created layer by layer.
Methods
We have pointed out above the importance of having the mesh vertices prealigned to ensure a good recombination rate. It is the purpose of the vertex placement algorithm to achieve this. This algorithm, however, relies on a number of data structures and geometrical concepts that are first introduced and developed below.
First, the vertex placement algorithm needs to know, at each point of the domain, the prescribed local mesh size and the local preferred mesh directions. In practice, those geometrical quantities are conjointly obtained by evaluating a specific field structure called cross field. The generation of direction fields was extensively studied in [25].
Secondly, the notion of distance itself represents another degree of freedom of the method. We shall show that it is particularly appropriate when dealing with hexmeshing, to compute distances with the infinity norm, instead of the standard Euclidean norm.
Finally, the algorithm is characterized by a large number of spatial searches, in order to check whether or not a prospective vertices is too close to any already existing vertex. To optimize the efficiency of this operation, an Rtree data structure is employed [26, 27].
Cross fields
At each point of a region $\Omega \subset {\mathcal{R}}^{3}$, the frame field (d_{1},d_{2},d_{3}) represents the three local orthogonal preferred directions of the hexahedral mesh. Frame fields are usually required to satisfy many constraints [16, 28]. On the geometrical edges of Ω, one of the three directions should be tangent to the edge itself [9]. On the surfaces of Ω, one of the three directions should be perpendicular to the surface [9, 16]. A last requirement is that the frame field should be as smooth as possible.
On the other hand, at each point of Ω, the size field represents the prescribed local mesh size value. Mesh sizes h_{1},h_{2},h_{3} are defined for every point of the volume in each of the directions d_{1},d_{2},d_{3}. In this paper, the mesh size field at a point x is isotropic, i.e. h(x)=h_{1}(x)=h_{2}(x)=h_{3}(x). The extension to anisotropic meshing will be done in a forthcoming work.
The user fixes the mesh size at the geometrical vertices of the model. Onedimensional size fields are then computed along the geometrical edges. Because the surfaces are bounded by geometrical edges, Dirichlet conditions can be imposed on the surfaces boundaries. A Laplace equation is used to obtain the size field over the surfaces. The size field over the volume is calculated in a similar manner. Continuous finite elements of the first order are employed in each case. The final size field is therefore a threedimensional piecewise continuous field. The Laplace equation was chosen because it leads to smooth and gradual solutions.
The cross field (h_{1}d_{1},h_{2}d_{2},h_{3}d_{3}), now, combines both information into a single field. At each vertex of the mesh, the cross field evaluates into a symmetric real 3 by 3 tensor whose columns are the three orthogonal vectors parallel to the local preferred directions of the hexahedral mesh. Moreover, the norm of the vectors represent the local mesh size; the three norms are identical in case of an isotropic mesh (which is the case considered in this paper), but they may differ in case of an anisotropic mesh.
The construction of a frame field on a region Ω belongs to the category of elliptic problems. Boundary conditions must be imposed on the boundary ∂ Ω. We thus proceed logically by explaining first how the frame field is constructed on surfaces, and deal afterwards with the prolongation into the volumes.
Let
be a smooth parametrization of the surface (see [29–31] for a review of parametrization techniques for surface remeshing). It should be noted that the parametrization does not need to be conformal, i.e the angles do not need to be conserved, for the algorithms presented in this paper. (This is a nice feature because guaranteed onetoone conformal maps are more difficult to compute than bijective harmonic mapping.) For example, Figure 3 shows a harmonic parametrization of an arbitrary surface onto a unit disk.
Consider the two tangent vectors
which are the images in of the basis vectors t^{′}_{1}=(1,0) and t^{′}_{2}=(0,1) of the parameter plane . Because they are not parallel for any point of , one can build the unit normal vector n=t_{1}×t_{2}/∥t_{1}×t_{2}∥. Each vector t tangent to can be expressed as t=u t_{1}+v t_{2} with (u,v) the covariant coordinates of t. The tangent vector t is thus the image of a vector t^{′}=(u,v) in the parameter plane. It is easy to compute covariant coordinates of any tangent vector t using the metric tensor of the parametrization. By definition, t=u t_{1}+v t_{2}. Then, t·t_{1}=u t_{1}·t_{1}+v t_{2}·t_{1} and t·t_{2}=u t_{1}·t_{2}+v t_{2}·t_{2}, which reads in matrix form
where is the metric tensor, invertible for any smooth parametrization.
For defining our frame field, a local orthonormal frame (s_{1},s_{2},n) is first constructed at all points x of with s_{1}=t_{1}/∥t_{1}∥, s_{2}=n×t_{1}/∥n×t_{1}∥. Next, the direction d_{1} of the frame field is computed at the points x_{ b } of the boundaries of surface : d_{1} is the tangent vector to the boundary. The local orientation of the frame field $\stackrel{\u0304}{\theta}$ at the boundary can then be computed as the oriented angle between s_{1} and d_{1}. Then, an elliptic boundary value problem is used to propagate the complex number z(u)=a(u)+i b(u)=e^{4iθ(u)} in the parametric domain. More specifically, two Laplace equations with Dirichlet boundary conditions are solved in the parametric space in order to compute the real part a(u)= cos4θ and the imaginary part b(u)= sin4θ of z:
After solving those two PDEs, the frame field can be represented in the whole domain by the angle
The choice 4θ as the argument of z is motivated by symmetry arguments: frame fields are equivalent when they are rotated around n by any angle that is a multiple of π/2. Details of that procedure are given in [32]. Finally, the frame field (d_{1},d_{2},d_{3}) can be computed on the whole surface as follows:
where θ is the solution of the elliptic boundary value problem (3).
As an example, Figure 4 presents the frame field computed on surfaces of a mechanical part. Figure 5 shows two triangular meshes of different coarseness and their resulting frame fields. Linear interpolation of the a and b components discussed earlier was used in order to obtain the same number of frames regardless of the mesh density. As seen from the figure, the frame field (a) is not entirely radial and contains defects because the mesh (a) is too coarse.
The frame field at any point inside the volume is then chosen to be equal to the frame field at the closest surface vertex [24]. (ANN nearest neighbor library is employed for the queries [33].)
These frame fields are not going to be smooth whenever the distance function to the walls is not itself smooth. Recently, two methods capable of generating smooth frame fields have been developed [16, 17]. Both of these methods employ LBFGS optimization to minimize energy functionals.
Measuring distances
For inserting a new mesh vertex in our frontal algorithm, the distance between a prospective vertex x_{ i } and any already existing vertex x must be smaller than kh, where h is the local mesh size and k a free parameter of the algorithm ranging from 0 to 1. Parameter k absolutely needs to be inferior to one. If not, too many valid vertices will be missing from the cloud. In the implementation described in this work, k is equal to 0.7.
The way distances between vertices are calculated is however a degree of freedom of the method. When dealing with hexmeshing, it turns out to be advantageous to compute distances in the infinity norm, instead of in the Euclidean norm:
In the infinity norm, the unit sphere is actually a cube, which reduces to a square in two dimensions (see Figure 6). The exclusion area around each prospective vertex is therefore a cube, resp. a square, which precisely matches the shape of the elements one wishes to build.
Contrary to the Euclidean norm, the infinity norm is not isotropic and, consequently, it has an orientation which is given by the frame field. In the parameter plane, due to the change of coordinates (1), the exclusion area is the parallelogram determined by
where M_{ x } is the Jacobian matrix of (1), evaluated at x.
The infinity distance is not a differentiable function [24]. However, this is not an issue, because the frontal algorithm does not require the computation of distance derivatives.
Using the infinity distance instead of the Euclidean distance can increase the hexahedra percentage. The quarter cylinder illustrated on Figure 7 provides an example where an improvement by 5% of the ratio of hexahedra is observed, by simply using the L_{ ∞ } norm instead of the L_{2} norm in the Rtree spatial search algorithm described in the next section.
Using Rtrees for spatial searches
As said before, a prospective vertex is effectively created only if there is enough unoccupied space around it. The size of this exclusion area or volume depends on the local mesh size. According to the dimension and the chosen norm, the shape of the exclusion region can be a parallelogram or an ellipse (in 2D), and a cube or a sphere (in 3D).
The computation of the distance between the prospective vertex and all the other vertices would have a quadratic complexity in time and would therefore be prohibitive in terms of computation time. The number of computations required to ensure the exclusions can however be considerably decreased if the exclusion cube of each vertex is enclosed in a bounding box whose edges are parallel to the coordinate axis. An Rtree data structure [26, 27] can efficiently determine bounding boxes intersections and, then, it is enough to compute the distance between pairs of vertices whose boxes intersect each other.
We now illustrate with a 2D example of a planar surface how to decide wether a prospective vertex can be inserted or not. For this example, we have chosen the infinity norm for computing distances. In Figure 8(a), x_{1} is the prospective vertex and x is an existing mesh vertex. The dotted square around x_{1} is the oriented exclusion area of vertex x_{1}, that is computed from the surface cross field (h_{1}d_{1},h_{1}d_{2}) that has a uniform mesh size field h_{1}. The solid box surrounding the prospective vertex is the bounding box of the exclusion area that is parallel to the xycoordinate axis. This bounding box should always include the oriented exclusion square of side 2kh. This condition is satisfied in 2D if the box is of side $2\sqrt{2}\mathit{\text{kh}}$ and in 3D if the cube is of side $2\sqrt{3}\mathit{\text{kh}}$. Even if the boxes intersect each other in Figure 8(a), the distance between x_{1} and x is sufficiently large. Thus, x_{1} can be inserted in the cloud and added to the queue.
Figure 8(b) shows the same two vertices. Again, the boxes intersect each other. This time, however, x_{1} is too close to x and x_{1} cannot be added to the cloud or to the queue.
It should be noted that on Figures 8(a) and 8(b), ${d}_{\infty}^{\mathit{\text{orien}}}({\mathbf{x}}_{1},\mathbf{x})$ is not necessarily equal to ${d}_{\infty}^{\mathit{\text{orien}}}(\mathbf{x},{\mathbf{x}}_{1})$. The local mesh sizes at x_{1} and x can also be different as illustrated in Figure 8(a). However, if x is outside the dotted square of x_{1}, it is considered sufficient.
For nonplanar surfaces, the surfaces need to be parametrized. As the parametrization is not necessarily conformal, i.e. the angles between d_{1} and d_{2} are not conserved, the dotted squares (exclusion area) of Figure 8 become parallelograms in the parametric space. As far as the bounding boxes are concerned, they are computed in the same manner and are then parallel to the uvcoordinate axis of the parametric space.
Let’s assume that on surfaces, each vertex attempts to create four vertices in the four cardinal directions. If the surface normal is not constant, these prospective vertices may not rest on the surface. The next section describes a scheme capable of solving this issue by intersecting surfaces with circle arcs.
Surface meshing: the packing of parallelograms algorithm
The quadrilateral mesh algorithm presented here is a simpler variant of [32] that we call packing of parallelograms. Consider one vertex located at point u=(u,v) of the parameter plane which correspond to point x(u,v) in the 3D space (see Figure 9). The cross field at this point of the surface is (h_{1}d_{1},h_{2}d_{2},h_{ n }n), in terms of the three orthonormal preferred mesh directions, {d_{1},d_{2},n}, and the three corresponding mesh sizes, {h_{1},h_{2},h_{ n }},.
In a perfect quad mesh, each vertex is connected to four neighboring vertices forming a cross parallel to the cross field. In our approach, four prospective points x_{ i }, i=1,…,4 are constructed in the neighborhood of point x with the aim of generating the perfect situation.
Points x_{1} and x_{2} are constructed as the intersection of the surface with a circle of radius h_{1}, centered on x and situated in the plane Π of normal d_{2} (see Figure 9). Points x_{3} and x_{4} are constructed as the intersection of the surface with a circle of radius h_{2}, centered on x and situated in the plane of normal d_{1} (not in the figure for clarity).
Numerical difficulties associated with the surfacecurve intersection are overcome by choosing a good initial guess for the intersection. If we approximate the surface by its tangent plane at x, point x_{1} is situated at x_{1}=x+h_{1}d_{1}. A good initial guess in the parameter plane is u_{1}=u+d u_{1} where d u_{1}=(du_{1},dv_{1}) is computed using (2) i.e.
This also gives u_{2}=u−d u_{1}, d u_{3}=(du_{3},dv_{3})
u_{3}=u+d u_{3} and u_{4}=u−d u_{3}.
The algorithm works as follows. Each vertex of the boundary is inserted in a fifo queue. Then, the vertex x at the head of the queue is removed and its four prospective neighbors x_{ i } are computed. A new vertex x_{ i } is inserted at the tail of the queue if the following conditions are satisfied: (i) vertex x_{ i } is inside the domain and (i i) vertex x_{ i } is not too close to any of the vertices that have already been inserted.
As for the first condition, it is enough to check if the preimage ${\mathbf{u}}_{i}\in {\mathcal{S}}^{\prime}$ of x_{ i } is inside the bounds of the parameter domain. Concerning the second condition, the distances on the surface should theoretically be measured in terms of geodesics, This is however clearly overkill from a mesh generation point of view. We define an exclusion zone for every vertex that has already been inserted (this includes boundary vertices). This exclusion zone is a parallelogram in the parameter plane (see the yellow parallelogram of Figure 9). This parallelogram is scaled down by a factor k=0.7 in order to allow the insertion of (at least) points x_{ i }. The different stages of the procedure for a non planar surface are presented on Figure 10 and Figure 11. Then, the surfaces are triangulated in the parameter plane using an anisotropic Delaunay kernel and the triangles are subsequently recombined into quadrilaterals using the BlossomQuad algorithm [34].
As shown on Figure 11, exclusion areas can become anisotropic parallelograms in the parametric plane. However, they always correspond to squares in the threedimensional space. The vertices are triangulated in the parametric plane. Anisotropic triangulation is therefore necessary in order to obtain the expected arrangement of right triangles.
Volume meshing: the 3D point insertion algorithm
Volume meshing proceeds in the same way as surface meshing. The procedure starts from a 2D triangular mesh that has been created using surfacic frame fields. A frontal algorithm is used to create well aligned vertices inside the volume, starting from surface points. The 3D point insertion algorithm works in the same manner as the one used for surfaces.
All boundary mesh vertices are initially pushed into a queue. The vertices are popped in order: each vertex Q popped out of the queue attempts to create six neighboring vertices in the six cardinal directions P_{1,2}=Q±h d_{1}, P_{3,4}=Q±h d_{2}, P_{5,6}=Q±h d_{3} at a distance h from itself (see Figure 12).
A prospective vertex is added to the vertices cloud and to the queue only if it satisfies the two following conditions:

1.
It is inside the domain.

2.
It is not too close to an existing mesh vertex, i.e. if the distance is smaller than kh.
An octree data structure is again employed to efficiently determine if a vertex is inside the domain [11].
Eventually, no more prospective vertices can be added to the cloud without being too close to existing ones. The process then stops and the cloud is tetrahedralized with a Delaunay procedure [35].
The frontal algorithm was applied to the quarter cylinder starting from the surface mesh shown in Figure 13(a). In Figure 13(b), lines are traced between each vertex and its parent in order to observe the progression of the 3D point insertion algorithm.
The quality of the alignment inside the geometry is very dependent on the quality of the alignment on the boundaries. If the triangles on the boundaries are far from being rightangled, then the vertices inside the geometry will not be well aligned. Various algorithms are capable of generating sets of aligned vertices on surfaces, such as the Delquad algorithm [32] or LévyLiu’s algorithm [24, 36]. However, for the majority of the examples presented in this article, a twodimensional version of the frontal algorithm was employed.
As explained earlier, each vertex attempts to create six other vertices at a distance d=h from itself. For smoother size transitions, d can instead be an average between the local mesh size at the parent vertex and the local mesh size at the prospective vertex.
Volume meshing: YamakawaShimada’s algorithm and finite element conformity
This section briefly describes YamakawaShimada’s recombination algorithm. It then discusses the problem of finite element conformity in the case of mixed hex meshes.
YamakawaShimada’s algorithm begins by iterating through the tetrahedra of the initial mesh. For each tetrahedron, it attempts to find neighboring tetrahedra with which to construct a hexahedron. Five, six or seven tetrahedra are required to construct one hexahedron. Three patterns of assembly are considered. Two out of these three patterns are described in [9]. When a potential hexahedron is found, it is added to an array. However, the hexahedron will not necessarily be part of the final mesh. Once all tetrahedra have been visited, the array is sorted by hex quality.
The quality Q is defined as follows:
where i is the vertex number. For a hexahedron, i goes from 1 to 8; v_{i 1}, v_{i 2} and v_{i 3} are the three vectors parallel to the three edges connected to vertex i. Q is in fact the modulus of the minimum scaled Jacobian [9]. Evidently, Q is meaningless for invalid hexahedra. Invalid hexahedra are characterized by a null or negative Jacobian determinant, which renders the mesh improper for calculations.
Starting from the highest quality hexahedron, the algorithm then iterates through the array. Potential hexahedra composed of tetrahedra not yet marked for deletion are added to the mesh. The tetrahedra of the added hexahedron are then marked for deletion. It is to be noted that only a small fraction of potential hexahedra appear in the final mesh.
Prisms can later be added by following a similar procedure [9]. All prisms are composed of three tetrahedra. There is only one pattern of construction for prisms [9].
Figure 14 shows a mixed mesh created with YamakawaShimada’s algorithm.
Let’s assume that finite elements of the first order are employed. The tetrahedral shape functions are therefore linear, while the hexahedral shape functions are trilinear [37]. On triangular faces, the interpolation is linear and takes into account three degrees of liberty. On quadrilateral faces, the interpolation is bilinear and takes into account four degrees of liberty [8, 9]. If a nonplanar quadrilateral face is adjacent to a triangular face, there will be a gap or overlap [9]. The elements are not going to be a perfect partition of the domain anymore, which goes against the basic assumptions of the finite element method. Gaps or overlaps can also be created by several configurations of neighboring hexahedra or prisms. Figures 15 and 16 show four cases of nonconformities between hexahedra [9].
Figures 17 and 18 show six cases of nonconformities between one hexahedron and one prism. Nonconformities resulting from neighboring prisms can be deduced from these six cases.
YamakawaShimada’s algorithm should therefore avoid creating the configurations illustrated on Figures 15, 16, 17 and 18 while iterating through the sorted arrays of potential hexahedra and prisms. Nonconformities can be efficiently identified by employing hashing techniques.
After the creation of hexahedra and prisms, some tetrahedra are recombined into pyramids. Every pair of tetrahedra resting on a quadrilateral face is merged to form a pyramid. This step can fix many nonconformities. However, it does not resolve them all. As shown on Figure 19, many quadrilateral faces can still be adjacent to triangular faces belonging to either tetrahedra or pyramids.
These nonconformities can be fixed by OwenCanannSaigal’s algorithm [38]. OwenCanannSaigal’s algorithm first creates a flat pyramid on each nonconformal quadrilateral face. The apex of the pyramid is not initially present in the mesh, but it is added by the algorithm. Surrounding tetrahedra and pyramids need to be subdivided to accommodate this new vertex. The pyramid is then raised so it does not have a null volume. Figure 20 illustrates the pyramid constructed to correct the nonconformity on Figure 19.
OwenCanannSaigal’s algorithm can render a mixed hexahedral mesh completely conformal. However, it has a drawback. It increases the number of tetrahedra and pyramids, which lowers the percentage of hexahedra by number. As a consequence, OwenCanannSaigal’s algorithm was not used for the results presented below.
Some quadrilateral faces will be adjacent to one or two triangles. Finite element solvers capable of handling these type of nonconformities are required.
Results and discussion
This section presents several mixed hex meshes created with the frontal algorithm and YamakawaShimada’s algorithm. Three quantities are used to evaluate the quality of the meshes: the percentage of hexahedra by number H_{ nbr }, the percentage of hexahedra by volume H_{ vol } and the average hex quality Q defined in Eq. 8. In general, H_{ vol } is higher than H_{ nbr }. CPU designates the total execution time (in s) on a 2010 laptop computer. All the data is compiled in Table 1. The following convention is used throughout this section: the hexahedra are white, the prisms are yellow, the pyramids are red and the tetrahedra are blue. The variable NC represents the percentage of nonconformal interior quadrilateral faces.
Figure 21 shows a mesh containing 142,466 elements. The mesh size is constant throughout the domain. The CAD model is composed of 250 geometrical faces of various sizes. In order to avoid altering the geometrical edges, hexahedra or prisms whose facets lie on two different geometrical faces are not created.
Each module described in this article shares a certain percentage of the total execution time. These percentages are detailed in Figure 22. The mesh illustrated on Figure 21 was used for the analysis. The blue modules refer to tetrahedra recombination. They are the most timeconsuming. The green and yellow modules pertain to volume and surface mesh vertices generation.
In Figure 23, a rectangular parallelepiped surrounding a NACA airfoil is meshed with 43,094 elements. Figures 24 and 25 are zoomed images of Figure 23.
Figure 26 is a cutaway view of the mixed mesh inside a cylinder. The mesh size is constant and the cardinal directions are radial.
Choosing a size field consistent with the geometry can improve the hexahedra percentage. For the spherical model shown on Figures 27 and 28, a mesh size proportional to the radius is more suitable than a constant one.
A mixed hexahedral mesh of a cylinder is displayed on Figure 29. However, this time the front was initiated only from the lower and upper disks, not from the curved face. In other words, the vertices on the curved face were not allowed to create prospective vertices. The mesh has the following statistics: H_{ nbr } = 81.88%, H_{ vol } = 91.44% and Q = 0.97. Because of the regularity of the curved face mesh, the hexahedra percentages are much higher than those of the previous cylinder.
Figures 30 and 31 show a mixed hexahedral mesh of the anc101 mechanical part. The mesh was generated in 194 seconds and contains 92,282 elements. It has a H_{ nbr } of 59.39%. The anc101 part was designed by Computer Aided Manufacturing Inc. [39] and is commonly used in mesh generation literature, in particular in Lévy and Liu’s article. For approximately the same mesh size, they obtain a H_{ nbr } of 77.14% and an execution time of 12 minutes. Pyramid recombination was not employed in both case.
A mesh convergence analysis was performed on the mechanical piece displayed on Figure 32. The mechanical piece is made of steel and one of its extremities is fixed. The first and second frequencies are computed, as shown on Table 2. Mixed hexahedral meshes of various densities are employed. According to a similar finite element calculation performed on a structured mesh, the first frequency is equal to 757.76 Hz and the second one is equal to 1921.93 Hz. The results appear to converge.
Figures 33, 34, 35 and 36 present additional examples of mixed hexahedral meshes. Figures 37, 38, 39 and 40 show cutaway views of these meshes. Table 3 contains the corresponding mesh data. The CAD models of these meshes come from an online repository [40–42].
A frequencydomain computational acoustic simulation was performed on the submarine model SUB of Table 3, under plane wave incidence. Figure 41 shows a cutaway view of the isosurfaces of the diffracted pressure field. Again, the simulations were shown to converge with mesh refinement.
Surfaces and volumes are meshed sequentially. The two surface meshes bounding a thin region may also not be identical. As a consequence, many nonhexahedral elements can be created. The algorithm is usually less effective for geometrical models featuring many thin regions.
Conclusion
A method capable of generating mixed hexahedral meshes has been presented. The first step consists of covering geometrical boundaries with aligned vertices using a frontal process. The interior is treated in a similar fashion. Vertices creation are guided by a direction field and a size field. The interior vertices are eventually tetrahedralized with a Delaunay procedure. All tetrahedra combinations yielding hexahedra are identified. They are sorted by quality and the highest quality hexahedra are created first. The same approach is applied to prisms. The final mesh contains hexahedra, prisms, pyramids and remaining tetrahedra.
The method has obvious drawbacks. First, there are no guarantees regarding the hexahedra percentage. It can be higher for certain geometries and lower for others. Secondly, the hexahedra are not anisotropic. For many geometries, well chosen anisotropy could increase the number of hexahedra. Finally, the resulting meshes are useful only to solvers capable of handling a certain number of nonconformal faces.
References
 1.
Benzley SE, Perry E, Merkley K, Clark B, Sjaardema G: A comparison of all hexagonal and all tetrahedral finite element meshes for elastic and elastoplastic analysis. In Proceedings of the 4th International Meshing Roundtable. Edited by: Tautges T. Albuquerque: Sandia National Laboratories; 1995.
 2.
Puso MA, Solberg J: A stabilized nodally integrated tetrahedral. Int J Numer Meth Eng 2006, 67: 841–867. 10.1002/nme.1651
 3.
Ito Y, Nakahashi K: Improvements in the reliability and quality of unstructured hybrid mesh generation. Int J Numer Meth Fl 2004, 45: 79–108. 10.1002/fld.669
 4.
Pirzadeh S: Threedimensional unstructured viscous grids by the advancinglayers method. AIAA J 1996, 34: 43–49. 10.2514/3.13019
 5.
Kallinderis Y, Ward S: Prismatic grid generation for threedimensional complex geometries. AIAA J 1993,31(10):1850–1856. 10.2514/3.11858
 6.
Shepherd JF, Johnson CR: Hexahedral Mesh Generation Constraints. Eng Comput 2008, 24: 195–213. . https://dl.acm.org/citation.cfm%3Fid=1394234 . 10.1007/s0036600800914
 7.
Meyers RJ, Tautges TJ, Tuchinsky PM: The ‘HexTet’hexdominant meshing algorithm as implemented in CUBIT. In Proceedings of the 7th international meshing roundtable. Edited by: Freitag L. Dearborn: Sandia National Laboratories; 1998:151–158.
 8.
Dewhirst DL, Grinsell PM, Tucker JR, Mahajan A: Joining tetrahedra to hexahedra. In Proceedings of MSC World Users’ Conference. Arlington: MSC Software; 1993. . http://web.mscsoftware.com/support/library/conf/wuc93/p04593.pdf .
 9.
Yamakawa S, Shimada K: Fullyautomated hexdominant mesh generation with directionality control via packing rectangular solid cells. Int J Numer Meth Eng 2003, 57: 2099–2129. 10.1002/nme.754
 10.
Shewchuk JR: Tetrahedral mesh generation by Delaunay refinement. In Proceedings of the fourteenth annual symposium on Computational geometry. Minneapolis: ACM; 1998:86–95.
 11.
Geuzaine C, Remacle JF: Gmsh: a threedimensional finite element mesh generator with builtin pre and postprocessing facilities. Int J Numer Meth Eng 2009, 79: 1309–1331. 10.1002/nme.2579
 12.
Schneiders R, Schindler R, Weiler F: Octreebased Generation of Hexahedral Element Meshes. In Proceedings of the 5th International Meshing Roundtable. Pittsburgh: Sandia National Laboratories; 1996.
 13.
Ito Y, Shih AM, Soni BK: Octreebased reasonablequality hexahedral mesh generation using a new set of refinement templates. Int J Numer Meth Eng 2008, 77: 1809–1833.
 14.
Maréchal L: Advances in OctreeBased AllHexahedral Mesh Generation: Handling Sharp Features. In Proceedings of the 18th International Meshing Roundtable. Edited by: Clark BW. Salt Lake City: Springer; 2009.
 15.
Blacker TD: Meeting the Challenge for Automated Conformal Hexahedral Meshing. In Proceedings of the 9th International Meshing Roundtable. Edited by: Owen S. New Orleans: Sandia National Laboratories; 2000.
 16.
Huang J, Tong Y, Wei H, Bao H: Boundary aligned smooth 3D crossframe field. In Proceedings of ACM SIGGRAPH Asia. Edited by: Bala K. Hong Kong: Association for Computing Machinery; 2011:2011–2011.
 17.
Li Y, Liu Y, Xu W, Wang W, Guo B: Allhex meshing using singularityrestricted field. In Proceedings of ACM SIGGRAPH Asia. Edited by: Sloan P. Singapore: Association for Computing Machinery; 2012:2012–2012.
 18.
Huang J, Jiang T, Wang Y, Tong Y, Bao H: Automatic Frame Field Guided Hexahedral Mesh Generation. 2012.http://www.cad.zju.edu.cn/home/hj/12/hex/techreport/hextechreport.pdf Tech. rep., Zhejiang University. .
 19.
Nieser M, Reitebuch U, Polthier K: CubeCover  parameterization of 3D volumes. Comput Graph Forum 2011, 30: 1397–1406. 10.1111/j.14678659.2011.02014.x
 20.
Kowalski N, Ledoux F, Frey P: A PDE Based Approach to, Multidomain Partitioning and Quadrilateral Meshing. In Proceedings of the 21th International Meshing Roundtable. Edited by: Jiao X, Weill J. San Jose: Springer; 2012.
 21.
Gregson J, Sheffer A, Zhang E: AllHex mesh generation via volumetric polyCube deformation. Comput Graph Forum 2011, 30: 1407–1416. 10.1111/j.14678659.2011.02015.x
 22.
Meshkat S, Talmor D: Generating a mixed mesh of hexahedra, pentahedra and tetrahedra from an underlying tetrahedral mesh. Int J Numer Meth Eng 2000, 49: 17–30. 10.1002/10970207(20000910/20)49:1/2<17::AIDNME920>3.0.CO;2U
 23.
Du Q, Faber V, Gunzburger M: Centroidal Voronoi Tessellations: Applications and Algorithms. Siam Rev 1999, 41: 637–676. 10.1137/S0036144599352836
 24.
Lévy B, Liu Y: L_{ p } Centroidal Voronoi Tessellation and its Applications. In Proceedings of ACM SIGGRAPH 2010. Edited by: Hoppe H. Los Angeles: Association for Computing Machinery; 2010.
 25.
Ray N, Vallet B, Li WC, Lévy B: NSymmetry direction field design. ACM T Graph 2008, 27: 1–25.
 26.
Guttman A: RTrees: A Dynamic Index Structure for Spatial Searching. In ACM Special Interest Group on Management of Data. Boston: Association for Computing Machinery; 1984:47–57.
 27.
Douglas G, Green M, Guttman A, Stonebraker M: Rtrees: a dynamic index structure for spatial searching. 2004.http://www.superliminal.com/sources/RTreeTemplate.zip .
 28.
Vyas V, Shimada K: TensorGuided HexDominant Mesh Generation with Targeted AllHex Regions. In Proceedings of the 18th International Meshing Roundtable. Edited by: Clark BW. Salt Lake City: Springer; 2009.
 29.
Remacle JF, Geuzaine C, Compère G, Marchandise E: High quality surface meshing using harmonic maps. Int J Numer Meth Eng 2010, 83: 403–425.
 30.
Marchandise E, de Wiart CC, Vos WG, Geuzaine C, Remacle JF: Highquality surface remeshing using harmonic mapsPart II: Surfaces with high genus and of large aspect ratio. Int J Numer Meth Eng 2011, 86: 1303–1321. 10.1002/nme.3099
 31.
Marchandise E: Remacle JF. Eng Comput 2013. doi:10.1007/s00366–012–0309–3 doi:10.1007/s0036601203093
 32.
Remacle JF, Henrotte F, Baudouin TC, Geuzaine C, Béchet E, Mouton T, Marchandise E: A Frontal Delaunay quad mesh generator using the L^{∞} norm. In Proceedings of the 20th International Meshing Roundtable. Edited by: Quadros W. Paris: Springer; 2011.
 33.
Mount DM, Arya S: ANN: A library for approximate nearest neighbor searching. In CGC Workshop on Computational Geometry. Durham: The Center for Geometric Computing; 1997:33–40.
 34.
Remacle JF, Lambrechts J, Seny B, Marchandise E, Johnen A, Geuzaine C: BlossomQuad: a nonuniform quadrilateral mesh generator using a minimum cost perfect matching algorithm. Int J Numer Meth Eng 2012, 89: 1102–1119. 10.1002/nme.3279
 35.
Si H: TetGen: A Quality Tetrahedral Mesh Generator and ThreeDimensional Delaunay Triangulator. 2006.http://tetgen.berlios.de/files/tetgenmanual.pdf
 36.
Baudouin TC, Remacle JF, Marchandise E, Lambrechts J, Henrotte F: Lloyd’s energy minimization in the L_{ p } norm for quadrilateral mesh generation. Eng Comput 2012. DOI:10.1007/s00366–012–0290x DOI:10.1007/s003660120290x
 37.
Fortin A, Garon A: Les Eléments finis : de la théorie à la pratique. 2014.http://giref.ulaval.ca/files/afortin/Publications/elements_finis.pdf .
 38.
Owen SJ, Canann SA, Saigal S: Pyramid Elements for Maintaining Tetrahedra to Hexahedra Conformability. In ASME Trends in Unstructured Mesh Generation. Edited by: Canann S, Saigal S. Evanston: American Society of Mechanical Engineers; 1997:123–129.
 39.
Agoston MK: Computer Graphics and Geometric Modeling. USA: SpringerVerlag; 2005.
 40.
Rieling R: Yamaha XTZ125. 2013.http://grabcad.com/library/yamahaxtz125 .
 41.
5 Bladed Propeller 2011.http://grabcad.com/library/5bladedpropeller .
 42.
Hall C: CV HP1. 2013.http://grabcad.com/library/cvhp1 .
Acknowledgements
This work has been partially supported by the Belgian Walloon Region under WIST grants ONELAB 1017086 and DOMHEX 1017074. The authors wish to thank Gaëtan Compère for the mesh convergence analysis and Jonathan Lambrechts for suggesting the use of Rtrees. The authors also appreciate the reviewers’ efforts and suggestions.
Author information
Additional information
Competing interests
The authors declare that they have no competing interests.
Authors’ contributions
TCB worked on the algorithms and drafted some parts of the manuscript. JFR, EM and FH worked on the algorithms, drafted some parts of the manuscript and carried out detailed revisions. CG performed acoustic finite element analyses with hexdominant meshes and carried out detailed revisions of the manuscript. All authors read and approved the final manuscript.
Authors’ original submitted files for images
Below are the links to the authors’ original submitted files for images.
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 2.0 International License (https://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
About this article
Received
Accepted
Published
DOI
Keywords
 Advancing front methods
 Tetrahedra recombination
 Mixed hexahedral meshes