Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

25
INTERNATIONAL JOURNAL FOR NUMERICAL METHODS IN ENGINEERING Int. J. Numer. Meth. Engng 2009; 77:1809–1833 Published online 10 November 2008 in Wiley InterScience (www.interscience.wiley.com). DOI: 10.1002/nme.2470 Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates Yasushi Ito , , , Alan M. Shih § and Bharat K. Soni Enabling Technology Laboratory (ETLab), Department of Mechanical Engineering, University of Alabama at Birmingham, U.S.A. SUMMARY An octree-based mesh generation method is proposed to create reasonable-quality, geometry-adapted unstructured hexahedral meshes automatically from triangulated surface models without any sharp geomet- rical features. A new, easy-to-implement, easy-to-understand set of refinement templates is developed to perform local mesh refinement efficiently even for concave refinement domains without creating hanging nodes. A buffer layer is inserted on an octree core mesh to improve the mesh quality significantly. Laplacian-like smoothing, angle-based smoothing and local optimization-based untangling methods are used with certain restrictions to further improve the mesh quality. Several examples are shown to demon- strate the capability of our hexahedral mesh generation method for complex geometries. Copyright 2008 John Wiley & Sons, Ltd. Received 29 November 2007; Revised 1 August 2008; Accepted 16 August 2008 KEY WORDS: unstructured hexahedral mesh; refinement templates; CSM; biomedical applications; mesh generation; grid generation 1. INTRODUCTION Computational simulations are widely used to predict or evaluate the performance of mechanical systems. The biomedical application of computational simulations aids in the understanding of complex human biological systems. One of the issues that needs to be resolved is how to represent Correspondence to: Yasushi Ito, Enabling Technology Laboratory (ETLab), 1530 3rd Avenue South, BEC 356B, Birmingham, AL 35294-4461, U.S.A. E-mail: [email protected] Research Assistant Professor. § Research Associate Professor, Director of ETLab. Professor and Chair. Contract/grant sponsor: Southern Consortium for Injury Biomechanics (SCIB); contract/grant number: DTNH22-01- H-07551 Copyright 2008 John Wiley & Sons, Ltd.

Transcript of Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

Page 1: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

INTERNATIONAL JOURNAL FOR NUMERICAL METHODS IN ENGINEERINGInt. J. Numer. Meth. Engng 2009; 77:1809–1833Published online 10 November 2008 in Wiley InterScience (www.interscience.wiley.com). DOI: 10.1002/nme.2470

Octree-based reasonable-quality hexahedral mesh generationusing a new set of refinement templates

Yasushi Ito∗,†,‡, Alan M. Shih§ and Bharat K. Soni¶

Enabling Technology Laboratory (ETLab), Department of Mechanical Engineering,University of Alabama at Birmingham, U.S.A.

SUMMARY

An octree-based mesh generation method is proposed to create reasonable-quality, geometry-adaptedunstructured hexahedral meshes automatically from triangulated surface models without any sharp geomet-rical features. A new, easy-to-implement, easy-to-understand set of refinement templates is developed toperform local mesh refinement efficiently even for concave refinement domains without creating hangingnodes. A buffer layer is inserted on an octree core mesh to improve the mesh quality significantly.Laplacian-like smoothing, angle-based smoothing and local optimization-based untangling methods areused with certain restrictions to further improve the mesh quality. Several examples are shown to demon-strate the capability of our hexahedral mesh generation method for complex geometries. Copyright q2008 John Wiley & Sons, Ltd.

Received 29 November 2007; Revised 1 August 2008; Accepted 16 August 2008

KEY WORDS: unstructured hexahedral mesh; refinement templates; CSM; biomedical applications; meshgeneration; grid generation

1. INTRODUCTION

Computational simulations are widely used to predict or evaluate the performance of mechanicalsystems. The biomedical application of computational simulations aids in the understanding ofcomplex human biological systems. One of the issues that needs to be resolved is how to represent

∗Correspondence to: Yasushi Ito, Enabling Technology Laboratory (ETLab), 1530 3rd Avenue South, BEC 356B,Birmingham, AL 35294-4461, U.S.A.

†E-mail: [email protected]‡Research Assistant Professor.§Research Associate Professor, Director of ETLab.¶Professor and Chair.

Contract/grant sponsor: Southern Consortium for Injury Biomechanics (SCIB); contract/grant number: DTNH22-01-H-07551

Copyright q 2008 John Wiley & Sons, Ltd.

Page 2: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

1810 Y. ITO, A. M. SHIH AND B. K. SONI

complex, realistic three-dimensional (3D) geometries given as biomedical image data, such ascomputed tomography (CT) or magnetic resonance imaging data. Patient-specific computationalmodeling is desired to correctly understand specific requirements.

Triangular and tetrahedral meshes are widely used for computational simulations because of theirflexibility for complex geometries [1]. However, triangles and tetrahedra are usually consideredto be constant strain elements in finite element methods, i.e. only one value of strain is assignedfor each element without any gradient. Many simplicial elements are needed to achieve the sameaccuracy as bilinear elements. Thus, quadrilaterals and hexahedra are preferred in computationalstructural mechanics (CSM) simulations.

Automatic hexahedral mesh generation for arbitrary geometries is still a challenging problem.The mesh generation group at Sandia National Laboratories has been developing unconstrainedpaving and plastering methods [2]. They have demonstrated high-quality hexahedral mesh genera-tion for mechanical objects. The methods, however, cannot be applied to general biomedical geome-tries because of their complexity. Octree-based mesh generation methods are a promising alternativeto create hexahedral meshes automatically even for complex geometries. Zhang et al. proposedan isosurface extraction method to automatically generate hexahedral meshes for geometricallycomplex structures using an octree-based method [3] and a smoothing method using geometricflow [4]. In these approaches, a bottom-up surface topology preserving octree-based algorithmwas applied to select a starting octree level. Then, a dual contouring method was used to extracta preliminary uniform hexahedral mesh. The mesh could be refined based on a feature-sensitiveerror function calculated from the region that users are interested in or based on computationalresults using refinement templates for hexahedra by Schneiders et al. [5]. Finally, a smoothingmethod was applied to the mesh to improve the quality. Boyd and Muller proposed a similar, butsimpler, octree-based mesh generation method without any refinement [6].

Mesh refinement for hexahedral elements without any hanging nodes is another challengingproblem. Since computational resources are always limited for simulations, meshes with as fewnodes as possible are preferred. Unlike tetrahedral elements, it is not easy to maintain connectivityof hexahedral elements during the mesh refinement. Refinement template-based methods are widelyused for octree-based hexahedral mesh generation to maintain the connectivity of hexahedra easily.Schneiders et al. proposed the first template-based method using four templates for node, edge,face and volume refinement as shown in Figure 1 [5]. The black points in the figure represent thepositions to be refined. The first three templates produce transition elements. The volume refinementtemplate subdivides a hexahedron into 27 similar hexahedra. In their approach, hexahedra in theregion of interest are subdivided using the volume refinement template first. The neighboringhexahedra are then subdivided using all the four templates so that the resulting mesh has no hangingnodes. This subdivision is based on the nodes marked as needed to be refined, corresponded tothe black points in Figure 1. If a hexahedron has a different pattern of the marked nodes, it mustbe converted to one of the four templates as shown in Table I. The table shows that most of therefinement patterns must be subdivided using the volume refinement template. As a result, the fourtemplates allow the refinement of only convex domains. The entire domain or most parts of thedomain sometimes need to be refined to achieve conformal refinement. A new set of templates isneeded to refine meshes more efficiently.

Zhang and Zhao proposed a hexahedral mesh refinement method using six templates [7]. Thetemplates are for node, edge, face, volume, three-node (three nodes of one of the six quadrilaterals)and two-face (two quadrilaterals sharing an edge) refinement. The templates for node and volumerefinement are the same as those developed by Schneiders et al. The idea of the remaining templates

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 3: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

OCTREE-BASED REASONABLE-QUALITY HEXAHEDRAL MESH GENERATION 1811

Figure 1. Four refinement templates by Schneiders et al. for: (a) node; (b) edge; (c)face; and (d) volume refinement.

Table I. Possible refinement patterns and correspondingrefinement templates by Schneiders et al.

is from conformal refinement using a shrink-and-connect strategy, known as pillowing [8–10].Interestingly, the structure of the face refinement template is the same as the upper part of theface refinement template used by Schneiders et al. Although Zhang and Zhao showed interestingexamples, their paper has three major problems. First, they did not show the internal structuresof their templates. Thus, no one can reproduce their work easily. Second, not all the faces of thelast two templates for three-node and two-face refinement have line symmetry based on Table I in

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 4: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

1812 Y. ITO, A. M. SHIH AND B. K. SONI

their paper; hence, each of the hexahedra assigned the three-node or two-face refinement templatecannot be subdivided independently. The absence of discussion on how the neighboring hexahedraare subdivided also makes it impossible to replicate and truly understand their process. Third, itis not clear how the templates for node and three-node refinement are used.

Parrish et al. proposed a selective approach to conformal refinement of existing unstructuredhexahedral meshes [11]. Although their refinement approach is similar to the one by Zhang andZhao [7], the discussion is clearer. Their refinement process consists of two methods: (A) element-by-element refinement using six templates and (B) directional refinement. Although the idea ofdirectional refinement is from pillowing, elements are independently refined using a method, theso-called ranking system, to improve the efficiency of the algorithm. However, there is no need toapply that extra, still less efficient refinement method if the templates used in method A can beapplied to concave refinement domains. This makes their refinement system difficult to implement.Moreover, the discussion is limited to one level of local refinement. If more than one level oflocal refinement is needed, transition elements can be refined more than once. The quality ofsuch elements is usually quite poor. For these reasons, we propose a new, better set of templatesand discuss how to achieve multiple levels of refinement without refining transition elements inthis paper.

The octree-based hexahedral mesh generation methods cannot create excellent-quality,reasonably-coarse hexahedral meshes, especially when mesh refinement is applied. Although it isalmost impossible to create such meshes for any geometry using an octree, we need a method thatproduces better-quality meshes than the existing methods. There are no demonstrated methodsfor creating octree-based, geometry-adapted, good-quality hexahedral meshes. Excellent-qualitymeshes cannot be created using octrees because there are many irregular nodes on the boundarysurface. Irregular nodes are defined as nodes that have too many or too few neighboring hexahedra.If interior nodes of a hexahedral mesh are considered, irregular nodes can be defined as nodesconnected to more or less than six edges. The biggest disadvantage of the octree-based hexahedralmesh generation methods is the quality of resulting meshes near the boundary surfaces, wheresignificant changes occur during computational simulations. Suppose there is a hexahedron andfive of its eight nodes need to be projected to a surface in order to create a boundary conformingmesh. If the surface is flat, the shape of the hexahedron becomes quite poor. An efficient methodis required to create good-quality hexahedral elements around the boundary surfaces to improvethe overall mesh quality.

In this paper, we propose an octree-based mesh generation method to automatically createhexahedral meshes for complex biomedical geometries with reasonable mesh quality. The startingpoint of the mesh generation can be either original medical image data or triangulated surfacemodels extracted from the medical image data. Since the latter approach is more flexible to controlnoise in the medical image data, we use the triangulated surface models as input. A new setof refinement templates is proposed to create geometry- or solution-adaptive hexahedral mesheswithout producing many extra elements. To improve the final mesh quality, a buffer layer is insertedon an octree core mesh and node smoothing is applied. Although the node smoothing method issimple, it is practically important to know how it should be applied to octree-based hexahedralmeshes.

The remainder of this paper is organized as follows. Section 2 describes our mesh genera-tion method. In Section 3, several biomedical geometries are shown to demonstrate and discussthe capability of our octree-based mesh generation approach. Finally, conclusions are given inSection 4.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 5: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

OCTREE-BASED REASONABLE-QUALITY HEXAHEDRAL MESH GENERATION 1813

2. MESH GENERATION METHOD

Figures 2 and 3 show the mesh generation process for a human pediatric liver model. Thereare four major steps: (1) the generation of a hexahedral core mesh (Figure 2(b)) inside an inputtriangulated surface model (Figure 2(a)) using five refinement templates (Section 2.1); (2) theremoval of special hexahedra that become poor-quality elements in the later steps (Section 2.2); (3)the addition of a buffer layer (Figure 2(c)) on the boundary surface to improve the quality ofthe final mesh (Section 2.3); and (4) the application of node smoothing and boundary projectionmethods to create a boundary conforming mesh (Figure 3(a); Section 2.4). We assume in thispaper that the input surface model does not have any sharp geometrical features. The recovery oftopology, such as vertexes and curves, is not considered.

The scaled Jacobian metric is used to check the quality of hexahedra or quadrilaterals during themesh generation [12]. Since a hexahedron has eight nodes, the minimum of eight scaled Jacobianvalues, jmin, is used to check its quality. Negative Jacobian elements are defined as elements whoseminimum scaled Jacobian values are less than zero.

2.1. Refinement templates

The existing sets of refinement templates cannot provide flexibility for complex geometries andease of implementation as briefly discussed in Section 1. A new set of five refinement templatesis proposed here to resolve this issue as shown in Figure 4. Templates for edge (Figure 4(a)), face(Figure 4(b)) and volume (Figure 4(c)) refinement are from pillowing. Zhang and Zhao [7] andParrish et al. [11] used the same templates as part of their template sets. In this paper, two newtemplates are proposed for three-node and two-face refinement. Before these new templates areintroduced, let us prepare symbols. Each of the templates has eight base nodes, A, B, C , D, E , F , Gand H . The orientation of the templates is shown in Figure 4. The templates for edge, face,volume, three-node and two-face refinement are represented as T2(ABCDEFGH), T4(ABCDEFGH),T8(ABCDEFGH), T3(ABCDEFGH) and T6(ABCDEFGH), respectively. The underlines indicatenodes to be refined, which correspond to the black points with white letters in Figure 4.

Figure 4(d, e) shows the structures of the two new templates and does not contain all thesubdivided hexahedra to simplify the drawing. Nodes I–P in each of the new templates are addedto create base hexahedra. For T3, the hexahedron is divided into six base hexahedra first, asshown in Figure 4(d). T2 is then applied to two hexahedra: T2(ABJIEFNM) and T2(DAILHEMP).The other four hexahedra, CDLKGHPO, BCKJFGON, IJKLMNOP and MNOPEFGH, are usedas is. For T6, the hexahedron is divided into five base hexahedra first, as shown in Figure 4(e).T2 is applied to two hexahedra: T2(BFGCJNOK) and T2(HDCGPLKO). T4 is applied to two otherhexahedra: T4(AEFBIMNJ) and T4(DHEALPMI). The hexahedron in the center, IJKLMNOP, isused as is.

To understand the five refinement templates better, Figure 5 shows three types of their sides,TQ2(ABCD), TQ3(ABCD) and TQ4(ABCD). Note that these are created by default if the fiverefinement templates for hexahedra are used. TQ3 is used for Quadrilateral ABCD in Figure 4(d) asTQ3(ABCD) and Quadrilaterals ABCD and EFGH in Figure 4(e) as TQ3(ABCD) and TQ3(EFGH),respectively. TQ2, TQ3 and TQ4 have line symmetry for easy implementation. For example, Line ACof TQ3 is the line of symmetry. This great feature allows refining hexahedral elements independentlywithout worrying about the conformity problem discussed in [11]. Table II shows the number ofhexahedra in each of the five templates.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 6: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

1814 Y. ITO, A. M. SHIH AND B. K. SONI

Figure 2. Hexahedral mesh generation process for a human pediatric liver model: (a) originaltriangulated surface model; (b) hexahedral bumpy core mesh; and (c) core mesh after applied

smoothing and added a buffer layer.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 7: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

OCTREE-BASED REASONABLE-QUALITY HEXAHEDRAL MESH GENERATION 1815

Figure 3. Hexahedral meshes for a human pediatric liver model: (a) final mesh after conforming to theboundary of the geometry; (b) mesh showing a cross section; (c) mesh without adaptation; and (d) mesh

using the templates by Schneiders et al.

Table III shows possible refinement patterns and corresponding refinement templates using ourapproach (Candidate 1). A node refinement template is not used. The two new templates for three-node, T3, and two-face refinement, T6, allow much more flexibility for adaptive mesh generationbecause many of the refinement patterns assigned to T8 in [5] (Table I) are reassigned to T6.As a result, concave domains can be refined effectively. Table IV shows another set of possiblerefinement patterns and corresponding refinement templates (Candidate 2). Although Candidate 2seems to create meshes with fewer elements, Candidates 1 and 2 practically create almost thesame number of elements while holding all other conditions constant. Moreover, Candidate 1often creates the same or slightly better-quality meshes. Thus, we use Candidate 1 to assign therefinement templates to hexahedra.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 8: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

1816 Y. ITO, A. M. SHIH AND B. K. SONI

Figure 4. New set of refinement templates for: (a) edge (T2); (b) face (T4); (c) volume (T8);(d) three-node (T3); and (e) two-face refinement (T6). Note that (d) and (e) only show the main

structures of our new templates.

Figure 5. Quadrilateral refinement templates for: (a) edge (TQ2); (b) three-node(TQ3); and (c) full refinement (TQ4).

Four steps are needed to create an octree core mesh using the refinement templates: (A) uniformrefinement; (B) local refinement based on any sensor values for geometry-adaptive mesh generation;(C) assignment of a refinement template to each cube; and (D) removal of hexahedra outside

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 9: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

OCTREE-BASED REASONABLE-QUALITY HEXAHEDRAL MESH GENERATION 1817

Table II. Number of hexahedra in each of the five refinement templates.

Templates T2 T4 T8 T3 T6

No. of hexahedra 5 13 27 14 37

Table III. Possible refinement patterns and correspondingrefinement templates (Candidate 1).

the meshing domain. Figure 6 shows an example in 2D. Although the refinement templates caneasily be applied to existing hexahedral meshes based on solution data, we do not discuss thesolution-adaptive mesh generation in this paper.

In Step (A), an octree is constructed from a root node—a cube that covers the entire triangulatedsurface model; ‘cube’ is used to represent an octree node hereafter to avoid confusion—by recur-sively subdividing each leaf cube into 27 sub-cubes [5]. This operation is equivalent to applyingT8 to the entire domain a certain number of times. If the size of the leaf cubes becomes smallerthan a user-specified value, L , the construction is stopped.

In Step (B), each leaf cube that contains or intersects triangles of the initial surface model ischecked. If the normals of any two of the triangles make an angle of more than �, T8 is applied

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 10: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

1818 Y. ITO, A. M. SHIH AND B. K. SONI

Table IV. Possible refinement patterns and correspondingrefinement templates (Candidate 2).

to the leaf cube. � is a user-specified parameter to detect geometrical features (or in other words,to select leaf cubes to be refined) and is used as a main sensor in this paper. The default valueof � is 60◦. Surface curvature can be used as an additional sensor if the initial surface mesh is ofgood quality. l levels of local refinement are allowed. The default value of l is 1. To avoid creatinglow-quality elements, transition elements created by T2,T4,T3 and T6 are not refined when l�2.Suppose each leaf cube knows how many times it is refined, lc (0�lc�l). At node i , we can findone of the leaf cubes connecting to it that has the maximum lc.

ldi = maxc j∈Ei

(lc j ) (1)

where Ei is the leaf cubes connecting to the node. Each leaf cube has eight or more nodes in thisstage. For example, the lower left square in Figure 6(a) has 10 nodes even in 2D. At leaf cube i ,the following value can be calculated:

�ci = lci max−lci min

lci max = maxd j∈Ni

(ld j ) (2)

lci min = mind j∈Ni

(ld j )

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 11: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

OCTREE-BASED REASONABLE-QUALITY HEXAHEDRAL MESH GENERATION 1819

Figure 6. Octree core mesh generation—the numbers and shaded area represent ld and part of an inputgeometry, respectively: (a) uniform (bold lines) and local refinement; (b) building conforming closure; (c)assignment of the refinement templates; and (d) removal of hexahedra outside the meshing domain.

where Ni is the nodes that leaf cube i has. �ci should be 0 or 1 to apply the refinement templates. Ifnot, the leaf cube is refined using T8 and lci +1 is assigned to the 27 new cubes as their refinementlevel. This process is called building conforming closure in [5] and is continued until all the leafcubes satisfy this condition (Figure 6(b)).

In Step (C), leaf cubes are subdivided using the five templates (Figure 6(c)). The pseudocodeis as follows:

For i=1 to l {Select leaf cubes with lc= l−iDo {

For j =1 to 6For k=1 to the number of leaf cubes with lc= l−i {

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 12: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

1820 Y. ITO, A. M. SHIH AND B. K. SONI

Calculate �c of leaf cube kIf �c>1 {

Build conforming closure}Else if �c=1 {

Select an appropriate refinement templateif cube k has one of Patterns (8− j) to 8.

}}

}} while any leaf cubes are modified.

}

where Patterns 1–8 are shown in Table III. The subdivision is first applied to leaf cubes withlc= l−1. If such a leaf cube has �c>1, the process for building conforming closure is applied. If�c=1, an appropriate template is selected based on Table III. Black points in Table III correspondto nodes with ld = lc+1. The others correspond to nodes with ld = lc.

T3 and T6 can be applied to certain refinement patterns in several ways. For example, Pattern2B can be represented as P2B(ABCDEFGH). T3 can be applied to P2B as T3(BCDAFGHE)or T3(DABCHEFG), and node B or D needs to be refined accordingly. T6 can be appliedto Patten 2C, P2C (ABCDEFGH), in six ways. The six configurations are T6(BAEFCDHG),T6(BCDAFGHE), T6(CBFGDAEH), T6(DABCHEFG), T6(EADHFBCG) and T6(EFBAHGCD).A refinement probe, �, is used to select the best configuration. To obtain ldi (ld at node i), lc isused in Equation (1). Instead of using lc, the maximum refinement level in neighboring elements,lcmax in Equation (2), can be used.

l ′di = maxc j∈Ei

(lc j max)

� = ∑

di∈Rl ′di

(3)

where R is nodes that may be additionally refined. The configuration with the largest � is accepted.In the P2B case, l ′dB and l ′dD are compared. If the refinement probe returns the same number forall the configurations of the selected pattern and template, any one of them can be selected. Toavoid selecting many extra nodes to be refined, cubes with Pattern 7 or 8 are assigned T8 first,as shown in the pseudocode. Cubes with patterns that have fewer refined nodes are then assignedappropriate templates.

ld at each of its eight nodes is updated if the refinement pattern of the leaf cube does notexactly match one of the five templates. For example, if T3(BCDAFGHE) is applied to P2B , thenld at node B needs to be updated. These are repeated until all the leaf cubes with lc= l−1 have�c�1 and those with �c=1 are assigned appropriate refinement templates. The same procedure isapplied to leaf cubes with lc= l−2, lc= l−3, . . . ,0.

In Step (D), hexahedra outside or intersecting the input triangulated surface model are removedto create an octree core mesh (Figures 2(b) and 6(d)). Note that leaf cubes must be small enoughto capture important small features of the input geometry by specifying a small L and/or a large l.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 13: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

OCTREE-BASED REASONABLE-QUALITY HEXAHEDRAL MESH GENERATION 1821

2.2. Removal of special hexahedra

Based on the templates assigned, hexahedral elements (leaf cubes and transition elements in therefinement templates) are created inside the input triangulated surface model. To create good-qualityelements in the later stages, certain elements need to be eliminated beforehand. Two importantcriteria are the number of quadrilaterals of a hexahedron that are on the boundary, nqh , and thenumber of hexahedra at a node, nhn . To identify unwanted hexahedra, edges on the boundarysurface are prepared. Each of the boundary edges can have two quadrilaterals by our definition. Iffour quadrilaterals connect to an edge as shown in Figure 7, two edges are created, and they areconsidered to be duplicated. At each node on the boundary, the number of boundary edges, nen ,the number of sets of duplicated boundary edges, ndn , and the number of boundary quadrilaterals,nqn , are counted.

A hexahedron is removed if nqh =4 and the hexahedron is not equilateral (i.e. a transitionelement in one of the refinement templates; Figure 8(a)), or if nqh =5 (Figure 8(b)) or 6. nqh =6means that the hexahedron is isolated. At a node on the boundary, the hexahedra connecting to itare selected. One of them with the largest nqh is removed (A) if nhn =2, nen�5 and ndn�1, (B) ifnhn =2 and nqn =6, (C) if nhn =3, nen�7 and ndn�1, (D) if nhn =4, nen�6, nen �=7 and ndn =1,(H) if nhn =5, nen�9 and ndn =1, or (I) if nhn =6, nen�6, nen �=7 and ndn =1. Figure 9 showsexamples at nodes A, B, C and D. One of the hexahedra connected to node A, B or C is removedbecause of Condition A (nhn =2, nen =6 and ndn =1) at node A, Condition B (nhn =2 and nqn =6)at node B, and Condition C (nhn =3, nen =7 and ndn =1) at node C . The four hexahedra at nodeD are kept because nhn =4, nen =8 and ndn =2.

2.3. Insertion of a buffer layer

The next step is to insert a buffer layer on the boundary surface of the octree core mesh(Figure 10(c)). This idea comes from a paper by Mitchell and Tautges on the removal of specialirregular nodes, called doublets, to improve the mesh quality significantly [8]. In 2D, a double istwo quadrilaterals sharing two edges and a surface doublet is a single quadrilateral where two ofwhose edges are constrained to lie on a straight or near-straight curve bounding the meshed object(see Figure 10(b)). This approach suggests inserting a buffer layer under the boundary surface(Figure 10(c)), which can improve the quality of the octree-based hexahedral meshes rather thanthe single application of any node smoothing method. Shepherd et al. [13, 14] and Merkley et al.[15] recently applied a similar method to hexahedral meshes to improve the mesh quality.

Before adding a buffer layer, a shape smoothing method is applied to the boundary surface ofthe octree core mesh to eliminate humps [16]. Single marching directions can be calculated at

Figure 7. Two cubes sharing edge AB.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 14: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

1822 Y. ITO, A. M. SHIH AND B. K. SONI

Figure 8. Removal of special hexahedra based on nqh : (a) two transition hexahedra withnqh =4 and (b) hexahedron with nqh =5.

Figure 9. Removal of special hexahedra based on nhn : bold lines represent duplicated edges.

nodes on the boundary except singular points using a standard technique used in near-field meshgeneration for viscous flow simulations [17]. A singular point is a point where a single marchingdirection cannot be obtained without creating negative Jacobian elements. There are two typesof singular points: (A) those where two local two-manifold surfaces can be defined (node D inFigure 9 and the black point in the center in Figure 11) and (B) those where they cannot bedefined. Two marching directions are prepared at each of type A singular points. Examples oftype B singular points are shown in [18, 19]. Since no single marching direction can be calculatedat those singular points, the buffer layer is not added locally. Figures 11 and 12 show examples

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 15: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

OCTREE-BASED REASONABLE-QUALITY HEXAHEDRAL MESH GENERATION 1823

Figure 10. Projection of a boundary surface: (a) original boundary and boundary surface of octants; (b)and (c) projection of boundary nodes without and with a buffer layer, respectively.

Figure 11. Addition of a buffer layer: suppose the black points are singular points.

of Type B singular points in 2D (imitation) and 3D, respectively, and the resulting buffer layers.Although the configuration at node A looks simple in Figure 12 (nhn =4, nen =6 and nqn =6),no single marching direction can be calculated. The height of the buffer layer, h, is calculatedbased on L and l, h=0.1L/3l , to avoid creating overlapping elements. The constant height isused because the quality of elements in the buffer layer is not very important at this stage unlessthey are negative Jacobian elements. Their quality is improved using the methods in the nextsection.

2.4. Smoothing and projection

Smoothing methods can also improve the final mesh quality. Laplacian smoothing generally workswell for octree-based hexahedral meshes as mentioned in [5]. This is sometimes true for mesheswithout adaptation, but not for meshes with adaptation. Negative Jacobian elements can be easilycreated during the smoothing process. The quality of tetrahedral meshes can be improved signif-icantly not only with node smoothing but also with face swapping. However, face swapping isdifficult for hexahedral meshes. Better smoothing methods are needed. In addition, the boundarysurfaces of hexahedral meshes must be recovered at the same time.

In our approach, the following set of smoothing and projection methods is applied to hexahedralmeshes several times: (A) surface mesh smoothing and projection, (B) volume mesh smoothingwhile holding the surface fixed and (C) local surface/volume mesh smoothing without projection.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 16: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

1824 Y. ITO, A. M. SHIH AND B. K. SONI

Figure 12. Buffer layer and a Type B singular point, node A: (a) surface mesh around node A, which hasfour neighboring hexahedra and (b) suppressed buffer layer at node A.

Figure 13. Element quality distribution by the scaled Jacobian metric for the pediatric liver meshes.

The pseudocode for the smoothing and surface projection is as follows:

For i=1 to the number of iterations, �, {Apply Step A with each of three smoothing methods (3 iterations each)Apply Step B with each of three smoothing methods (3 iterations each)If 1<i<� {

Apply Step C if needed}

}� is set to 5.

For surface and volume mesh generation, three smoothing methods are used: Laplacian-like,angle-based and local optimization-based untangling. Laplacian smoothing uses the coordinates in

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 17: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

OCTREE-BASED REASONABLE-QUALITY HEXAHEDRAL MESH GENERATION 1825

Table V. Comparison of the meshes for the pediatric liver model.

No. of hexahedra

Total jmin<0.2 min( jmin)

No adaptation 109 874 0 0.255Schneiders et al.’s 102 505 0 0.223Ito et al.’s 36 212 16 0.101

the previous time step to calculate the coordinates in the current time step. Laplacian-like meansthat only the coordinates in the current time step are used. Zhou and Shimada proposed an angle-based node smoothing method for 2D triangular and quadrilateral meshes [20]. Ito et al. extendedit to triangular faces in 2D with a surface projection method [1] and tetrahedral elements [21].These methods can be used as is at a node with neighboring quadrilaterals or hexahedra if diagonallines from the node are considered. The local optimization-based untangling method is proposedby Freitag and Plassmann [22]. In Step (A), the surface projection method is applied after one ofthe node smoothing methods is applied [1].

Although those smoothing methods are not new, the essence of our approach is how theyare applied to hexahedral meshes. The Laplacian-like smoothing, angle-based smoothing anduntangling methods give updated coordinates of each node in every iteration. However, there isno guarantee that the updated coordinates give better result. They are accepted if the node withthe updated coordinates can be projected to the initial triangulated surface without creating anynegative Jacobian elements (this condition is for the surface mesh smoothing only) and if the shapesof neighboring hexahedral elements become better than a certain condition ( jmin>0.001 for all theneighbors if 1�i�2 in the pseudocode) or the previous shapes (3�i��). jmin of each element isused to check whether the shapes improve as minq∈Ek ( jminq), where Ek is the hexahedra connectingto the node, k. This restriction is essential to improve the quality of hexahedra because any otherquality improvement method cannot be applied easily. For example, the quality of tetrahedralelements can also be improved by a local face-swapping method. However, the connectivity ofhexahedra usually cannot be changed locally.

Step (C) is required after applying Steps (A) and (B) a couple of times consecutively becausea small number of nodes on the boundary surface may be trapped in unwanted locations due tothe restriction of the surface projection. These nodes, Nlow, can be categorized into two types:(a) nodes that have not been projected onto the original triangulated surface model and (b) nodesthat connect to low-quality hexahedra ( jmin<0.1). In these cases, the following local smoothingprocedure is applied:

C-1. Select one of Nlow and its one-ring neighbor nodes. If any of the one-ring neighbors belongto Nlow, also select its one-ring neighbors.

C-2. Apply surface mesh smoothing without projection to the selected nodes only on theboundary surface.

C-3. Apply volume mesh smoothing to the other nodes.C-4. Accept the updated coordinates for all the selected nodes if none of the elements connected

to them have jmin�0.

In Steps C-2 and C-3, the angle-based smoothing method is tried first. If the updated coordinatesare rejected in Step C-4, the Laplacian-like smoothing and untangling methods are tried in tandem.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 18: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

1826 Y. ITO, A. M. SHIH AND B. K. SONI

Figure 14. Hexahedral meshes for a femur: (a) mesh without adaptation and (b) mesh with adaptation.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 19: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

OCTREE-BASED REASONABLE-QUALITY HEXAHEDRAL MESH GENERATION 1827

3. APPLICATIONS

In this section, four geometries are shown to demonstrate our hexahedral mesh generation capability.The quality of hexahedral meshes is also discussed based on the scaled Jacobian metric.

3.1. Human pediatric liver

This example has already been shown in Figures 2 and 3. Two sets of templates are used: (1) the fourtemplates by Schneiders et al. and (2) our five templates. The template sets are applied to the samegeometry with the same condition (L=1/10 based on the length of the liver, �=85◦ and l=1), andtwo meshes are created (Figures 3(d) and (a), respectively). � is enlarged from the default value, 60◦,to avoid capturing small geometrical features. A hexahedral mesh without adaptation is also createdwith L=1/30 for comparison (Figure 3(c)). Figure 13 shows the distribution of element quality ofthe three hexahedral meshes by the scaled Jacobian metric. Note that the numbers of hexahedra inthe vertical axis are in log scale to clearly plot small numbers in the graph. Table V shows the prop-erty of the meshes. Compared with the mesh without adaptation, the number of elements is reducedby only 6.7% using the templates by Schneiders et al. because they can be applied to convex domainsonly. Most of the domain is refined as shown in Figure 3(d). Our template set allows the creation ofa geometry-adaptive mesh without adding too many elements. The number of elements is reducedby 67%. This feature is practically very important to avoid wasting resources for computationalsimulations.

The quality of the mesh without adaptation clearly shows the effectiveness of the insertion ofa buffer layer and the smoothing method. The lowest scaled Jacobian of the mesh, min( jmin), is

Figure 15. Element quality distribution by the scaled Jacobian metric for the femur meshes.

Table VI. Comparison of the meshes for the femur model.

No. of hexahedra

Total jmin<0.2 min( jmin)

No adaptation 62 963 0 0.305Ito et al.’s 28 229 0 0.211

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 20: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

1828 Y. ITO, A. M. SHIH AND B. K. SONI

Figure 16. Hexahedral mesh for a pediatric pelvis: (a) from the front and (b) fromthe rear, showing a cross section.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 21: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

OCTREE-BASED REASONABLE-QUALITY HEXAHEDRAL MESH GENERATION 1829

Figure 17. Hexahedral mesh for a human torso (overall image).

greater than 0.25. The quality of the meshes with adaptation is still acceptable, but lower than themesh without adaptation because the templates already contain low-quality hexahedra. It is muchmore difficult to create good-quality hexahedral meshes with adaptation. Although the proposedtwo new templates are very useful to create adaptive meshes with minimum additional elements,they have hexahedra with jmin of 0.26. This is the reason why there are many more elements withjmin in the range of 0.2–0.3.

3.2. Human femur

Figure 14 shows hexahedral meshes with and without adaptation (our template set only) for afemur. The original surface model is extracted from CT data. In this case, we set L to 1/30 (withadaptation) or 1/90 (without adaptation) based on the length of the femur and � to 50◦ and lto 1 for the adaptive mesh. � is reduced from the default value, 60◦, to better capture geometricalfeatures. Both meshes represent the original geometry well. Figure 15 shows the distribution ofelement quality of the two meshes by the scaled Jacobian metric. Table VI shows the property of themeshes. Our template set allows creating the geometry-adaptive mesh with half as many hexahedraof the no-adaptive mesh. The lowest scaled Jacobian values of both meshes are greater than 0.2.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 22: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

1830 Y. ITO, A. M. SHIH AND B. K. SONI

Figure 18. Hexahedral mesh for a human torso (front view around the face).

3.3. Human pediatric pelvis

Figure 16 shows a mesh with 299 478 hexahedra for a pediatric pelvis. Parameters are L=1/30(based on the height of the pelvis) �=60◦ and l=1. The number of hexahedra with jmin�0.2 is 53.The lowest minimum scaled Jacobian is 0.127. This is a good example of a complex geometrybecause the ilia are thin and the sacrum has four sets of sacral foramina.

3.4. Human Torso

Figures 17–19 show a mesh with 323 421 hexahedra for a human torso model from theAIM@SHAPE Shape Repository. Parameters are L=1/30 (based on the width of the model),�=60◦ and l=3. Surface curvature is also considered to locally refine the mesh (�1>0.6, where�1 is the maximum principal curvature). The three levels of local refinement allow representingsmall features precisely, while keeping the number of elements small. The number of hexahedrawith jmin�0.2 is 340. The lowest minimum scaled Jacobian is 0.0158. The smoothing methodmay need to be improved to create better-quality meshes with more than one level of localrefinement.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 23: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

OCTREE-BASED REASONABLE-QUALITY HEXAHEDRAL MESH GENERATION 1831

Figure 19. Hexahedral mesh for a human torso (side view): (a) surface mesh and (b)cross section through the center.

4. CONCLUSIONS

An octree-based mesh generator has been developed to automatically create hexahedral meshes forcomplex geometries suitable for CSM simulations. Two new refinement templates are proposed inthis paper and three other existing templates are used to create geometry-adaptive meshes withoutadding too many extra elements. The addition of a buffer layer on the boundary surface and the nodesmoothing methods with certain restrictions improve the resulting mesh quality significantly. Thecapability of our mesh generation method is demonstrated using four triangulated surface models.The resulting meshes do not have any negative Jacobian elements even for complex geometries,

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 24: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

1832 Y. ITO, A. M. SHIH AND B. K. SONI

and the quality of the meshes is acceptable. The five refinement templates allow the creation ofadaptive meshes efficiently.

ACKNOWLEDGEMENTS

The initial triangulated surface models of the liver and pelvis are provided courtesy of Dr King Yang andMs. Christina Huber of Wayne State University, Detroit, MI, U.S.A. The human torso model is providedcourtesy of Alexandre Olivier-Mangon and George Drettakis of INRIA by the AIM@SHAPE ShapeRepository. The authors would like thank the reviewers for their constructive comments. This research issupported in part by the Southern Consortium for Injury Biomechanics (SCIB) No. DTNH22-01-H-07551.

REFERENCES

1. Ito Y, Shum PC, Shih AM, Soni BK, Nakahashi K. Robust generation of high-quality unstructured meshes onrealistic biomedical geometry. International Journal for Numerical Methods in Engineering 2006; 65(6):943–973.DOI: 10.1002/nme.1482.

2. Staten ML, Kerr RA, Owen SJ, Blacker TD. Unconstrained paving and plastering: progress update. Proceedingsof the 15th International Meshing Roundtable, Birmingham, AL, 2006; 469–486. DOI: 10.1007/978-3-540-34958-7 27.

3. Zhang Y, Bajaj C. Adaptive and quality quadrilateral/hexahedral meshing from volumetric data. ComputerMethods in Applied Mechanics and Engineering 2006; 195:942–960. DOI: 10.1016/j.cma.2005.02.016.

4. Zhang Y, Bajaj C, Xu G. Surface smoothing and quality improvement of quadrilateral/hexahedral meshes withgeometric flow. Proceedings of the 14th International Meshing Roundtable, San Diego, CA, 2005; 449–468.

5. Schneiders R, Schindler R, Weiler F. Octree-based generation of hexahedral element meshes. Proceedings of the5th International Meshing Roundtable, Sandia National Laboratories, 1996; 205–216.

6. Boyd SK, Muller R. Smooth surface meshing for automated finite element model generation from 3D imagedata. Journal of Biomechanics 2006; 39:1287–1295. DOI: 10.1016/j.jbiomech.2005.03.006.

7. Zhang H, Zhao G. Adaptive hexahedral mesh generation based on local domain curvature and thickness usinga modified grid-based method. Finite Elements in Analysis and Design 2007; 43:691–704. DOI: 10.1016/j.finel.2007.03.001.

8. Mitchell SA, Tautges TJ. Pillowing doublets: refining a mesh to ensure that faces share at most one edge.Proceedings of the 4th International Meshing Roundtable, Sandia National Laboratories, 1995; 231–240.

9. Tchon K, Dompierre J, Camarero R. Automated refinement of conformal quadrilateral and hexahedral meshes.International Journal for Numerical Methods in Engineering 2004; 59:1539–1562. DOI: 10.1002/nme.926.

10. Harris N, Benzley S, Owen S. Conformal refinement of all-hexahedral element meshes based on multipletwist plane insertion. Proceedings of the 13th International Meshing Roundtable, Sandia National Laboratories,Williamsburg, VA, 2004; 157–168. SAND #2004-3765C.

11. Parrish M, Borden M, Staten M, Benzley S. A selective approach to conformal refinement of unstructuredhexahedral finite element meshes. Proceedings of the 16th International Meshing Roundtable, Seattle, WA, 2007;251–268. DOI: 10.1007/978-3-540-75103-8 15.

12. Knupp PM. Achieving finite element mesh quality via optimization of the Jacobian matrix norm and associatedquantities. Part II-A framework for volume mesh optimization and the condition number of the Jacobian matrix.International Journal for Numerical Methods in Engineering 2000; 48:1165–1185. DOI: 10.1002/(SICI)1097-0207(20000720)48:8<1165::AID-NME940>3.0.CO;2-Y.

13. Shepherd JF. Topologic and geometric constraint-based hexahedral mesh generation. Ph.D. Dissertation, Schoolof Computing, University of Utah, 2007.

14. Shepherd JF, Zhang Y, Tuttle CJ, Silva CT. Quality improvement and Boolean-like cutting operations in hexahedralmeshes. Proceedings of the 10th International Conference on Numerical Grid Generation in Computational FieldSimulations, Crete, Greece, 2007 (CD-ROM).

15. Merkley K, Ernst C, Shepherd J, Borden MJ. Methods and applications of generalized sheet insertion forhexahedral meshing. Proceedings of the 16th International Meshing Roundtable, Seattle, WA, 2007; 233–250.DOI: 10.1007/978-3-540-75103-8 14.

16. Taubin G. A signal processing approach to fair surface design. Proceedings of ACM SIGGRAPH 95, 1995;351–358.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme

Page 25: Octree-based reasonable-quality hexahedral mesh generation using a new set of refinement templates

OCTREE-BASED REASONABLE-QUALITY HEXAHEDRAL MESH GENERATION 1833

17. Kallinderis Y, Ward S. Prismatic grid generation for three-dimensional complex geometries. AIAA Journal 1993;31(10):1850–1856.

18. Ito Y, Shih AM, Soni BK, Nakahashi K. Multiple marching direction approach to generate high quality hybridmeshes. AIAA Journal 2007; 45(1):162–167. DOI: 10.2514/1.23260.

19. Ito Y, Shih AM, Soni BK. Hybrid mesh generation with embedded surfaces. Proceedings of the 10th InternationalConference on Numerical Grid Generation in Computational Field Simulations, Crete, Greece, September 2007(CD-ROM).

20. Zhou T, Shimada K. An angle-based approach to two-dimensional mesh smoothing. Proceedings of the 9thInternational Meshing Roundtable, New Orleans, LA, 2000; 373–384.

21. Ito Y, Nakahashi K. Improvements in the reliability and quality of unstructured hybrid mesh generation.International Journal for Numerical Methods in Fluids 2004; 45(1):79–108. DOI: 10.1002/fld.669.

22. Freitag LA, Plassmann PE. Local optimization-based untangling algorithms for quadrilateral meshes. Proceedingsof the 10th International Meshing Roundtable, Newport Beach, CA, 2001; 397–406.

Copyright q 2008 John Wiley & Sons, Ltd. Int. J. Numer. Meth. Engng 2009; 77:1809–1833DOI: 10.1002/nme