<<

Hexahedral from Volumetric Data by Dual Interval Volume

Thesis

Presented in Partial Fulfillment of the Requirements for the Degree Master of Science in

the Graduate School of The Ohio State University

By

Fei Xiao

Graduate Program in Computer Science and Engineering

The Ohio State University

2018

Thesis Committee

Dr. Rephael Wenger, Advisor

Dr. Tamal Dey

Copyrighted by

Fei Xiao

2018

Abstract

Finite element methods play an important role in the field of scientific research and engineering applications. An important requirement of numerical methods is to discretize the model into a mesh composed of simple elements. In three-dimensional numerical analysis, tetrahedral and hexahedral elements are usually used. Tetrahedral meshes have the advantage of high efficiency, easy implementation, flexibility for adaptive mesh generation and (relatively) easy mesh regeneration. However, hexahedral meshes have an advantage over element meshes regarding the analysis accuracy and total number of elements. This makes hexahedral meshes an attractive choice for numerical analysis.

In medical and industrial applications, X-ray computed (CT) or magnetic resonance imaging (MRI) scanners are widely used in medical and industrial diagnostics. The CT and MRI produce a regular grid with scalar values at each grid vertex. This regular grid is called volumetric data. Hexahedral mesh generation for volumetric data provides an opportunity to exploit the structure provided in the volumetric data.

One way to generate hexahedral meshes from the volumetric data is to extract the surface geometry first and then mesh the object. However, this two-step approach takes extra time and effort for mesh generation. Also, this approach does not take the advantage of the regular grid from which the surface is generated.

i

The advantage of generating hexahedral meshes directly from a regular grid is that the underlying grid can guide hexahedral mesh generation. There are usually one or two hexahedral vertices placed in each grid . This property keeps the vertices well separated. Previous work constructing hexahedral meshes directly from volumetric data placed a single mesh vertex in each grid cube. That algorithm required adaptive refinement to avoid non-manifold conditions.

This paper proposes a new algorithm, called Dual Interval Volume, to generate an all hexahedral mesh directly from volumetric data. Our algorithm allows two or more hexahedral mesh vertices to be placed in the same grid cube such that some of the non- manifold issues can be avoided. Special rules are used to guarantee that the output meshes are manifolds. Smoothing methods are implemented to improve the mesh quality.

The algorithm is tested with real volumetric data and the results are compared with commercial software.

ii

Acknowledgments

First and foremost, I would like to express my deep gratitude to my advisor, Dr.

Rephael Wenger, for his support and guidance throughout last two years. By working with him, I have learned to solve problems in computer science. He is a rigorous researcher. I feel very lucky that learning with Dr. Wenger is such a pleasant journey.

I am grateful to Dr. Tamal Dey for serving on the thesis committee, as well as for his Geometric Modeling class. Among all the classes I have ever taken, his class is the most important one to this thesis. Dr. Dey is good at encouraging students asking questions, and then answering the questions themselves. This process helped me understand the geometric concepts better and longer. The best thing for a student like me is learning from such a remarkable teacher.

At last, I give my appreciation to my wife and my parents. Without their support and encouragement, I cannot finish this thesis. It is power of love keeps me progressing.

iii

Vita

Jul 2013 ...... B. Sc. Naval Architecture and Ocean Engineering

Shanghai Jiao Tong University.

Shanghai, China

May 2015 ...... M.Sc. Ocean Engineering

Texas A&M University

College Station, Texas, USA

Aug 2015 – Present ...... M.Sc Student, Computer Science and Engineering

The Ohio State University.

Columbus, OH, USA

Publications

Soghrati, S., Xiao, F., & Nagarajan, A. (2017). A conforming to interface structured adaptive mesh refinement technique for modeling fracture problems. Computational

Mechanics, 59(4), 667-684.

Fields of Study

Major Field: Computer Science and Engineering

iv

Table of Contents

Abstract ...... i

Acknowledgments...... iii

Vita ...... iv

List of Tables ...... vii

List of Figures ...... viii

Chapter 1. Introduction ...... 1

Chapter 2. Background ...... 4

2.1 extraction ...... 5

2.2 Mesh Generation ...... 9

2.2.1 Definition of Mesh ...... 9

2.2.2 Triangle/Tetrahedral Mesh Generation ...... 11

2.2.3 Hexahedral Mesh ...... 12

2.3 Mesh Quality Improvement ...... 14

Chapter 3. Dual Interval Volume ...... 16

3.1 Definitions and Notations ...... 16

3.2 Dual Marching ...... 17

3.3 DIVol ...... 22

3.3.1 Background ...... 22

3.3.2 Construction of the Interval Volume Lookup Table ...... 23

3.4 Manifold ...... 29

Chapter 4 Hexahedral Mesh Quality ...... 45 v

4.1 Hexahedral Mesh Quality Metrics ...... 45

4.2 Mesh Quality Improvement ...... 48

Chapter 5 Experimental Results...... 51

5.1 Manifold Check of Random Data ...... 51

5.2 Manifold Check on Real Data ...... 52

5.3 Mesh Quality Check on Real Data for Interval Volume [σ0, +∞] ...... 53

5.3.1 Mesh Quality at Internal Vertices ...... 53

5.3.2 Mesh Quality at All Vertices ...... 58

5.4 Mesh Quality Check on Real Data for Interval Volume [σ0, σ1] ...... 59

5.4.1 Mesh Quality at Internal Vertices ...... 59

5.4.2 Mesh Quality at All Vertices ...... 60

5.5 Mesh Quality Improvement ...... 61

5.5.1 Short Edge Length Improvement ...... 61

5.5.2 Scaled Jacobian Improvement for All Vertices ...... 64

5.5.3 Scaled Jacobian Improvement for Range [σ0, σ1] ...... 66

5.6 Mesh Quality Comparison with Bolt 2.0 ...... 69

Chapter 6 Conclusions ...... 77

Bibliography ...... 79

Appendix A...... 86

vi

List of Tables

Table 1 Mesh Quality Tests of Neghip at Internal Vertices ...... 54

Table 2 Comparison of CPU Time between DIVol and Bolt 2.0 ...... 70

Table 3 Comparison of Normalized Scaled Jacobian of DIVol and Bolt 2.0 at Internal

Vertices ...... 75

Table 4 Comparison of Normalized Scaled Jacobian of DIVol and Bolt 2.0 at All

Vertices ...... 75

Table 5 Comparison of Shape of DIVol and Bolt 2.0 at Internal Vertices ...... 76

Table 6 Comparison of Shape of DIVol and Bolt 2.0 at All Vertices ...... 76

Table 7 Mesh Quality Tests of Silicium at Internal Vertices ...... 86

Table 8 Mesh Quality Tests of Marschnerlobb at Internal Vertices ...... 87

Table 9 Mesh Quality Tests of Lobster at Internal Vertices ...... 88

Table 10 Mesh Quality Tests of Fuel at Internal Vertices ...... 89

Table 11 Mesh Quality Tests of Aneurysm at Internal Vertices ...... 90

vii

List of Figures

Figure 1 Torus Mesh Example ...... 2

Figure 2 Example of a Scalar Field with Isovalue equals to 2 ...... 5

Figure 3 Example of 2D Ambiguous Case ...... 6

Figure 4 Example 3D Ambiguous Case...... 7

Figure 5 (a) Structured Mesh (b) Unstructured Mesh ...... 10

Figure 6 Indirect Hexahedral Mesh Generation ...... 13

Figure 7 Interval Volume between Isovalues 0.5 and 2.5 ...... 17

Figure 8 Dual Lookup Table ...... 18

Figure 9 An Example of Marching Cubes Lookup Table...... 21

Figure 10 Example of 4D Dual Contouring ...... 22

Figure 11 (a) A 4 × 4 × 4 Scalar Grid with Scalar Values 1 and 3; (b) Corresponding

Interval ...... 23

Figure 12 Example of Lifting 3D Cube to 4D Hypercube...... 25

Figure 13 Build Lookup Table for Cube with 7 star and 1 Positive Vertices...... 27

Figure 14 Example of Lookup Table with Positive, Negative and Star Vertices...... 28

Figure 15 Example of Lookup Table with Two Negative Connected Components ...... 29

Figure 16 Examples of Non-manifold Mesh...... 30

Figure 17 Ambiguous Facets...... 31

Figure 18 Not an Ambiguous Facet...... 31

Figure 19 Example of Non-Manifold Mesh...... 32 viii

Figure 20 Non-manifold Mesh Example in 4D ...... 32

Figure 21 Non-manifold Mesh which Split Positive Connected Components Cannot Fix.

...... 34

Figure 22 Subdivision of a Unit Cube...... 34

Figure 23 Subdivision Rule 1...... 35

Figure 24 Subdivision Rule 2...... 36

Figure 25 Subdivision Rule 3...... 36

Figure 26 Subdivision Rule 4...... 37

Figure 27 Subdivision Rule 5a...... 38

Figure 28 Subdivision Rule 5b...... 39

Figure 29 Procedure of Appying Subdivision Rule 1 to Rule 5 ...... 40

Figure 30 Subdivision rule for cube center ...... 42

Figure 31 Non-manifold Vertex Example ...... 42

Figure 32 Lookup Table Entry Construction of Non-manifold Vertex Example...... 43

Figure 33 Manifold Mesh by Applying Eliminate Non-manifold Vertices Rule ...... 44

Figure 34 Hexahedron with Corner Labels...... 45

Figure 35 A Unit Cube and A Distorted Cube...... 48

Figure 36 Laplacian Smoothing ...... 49

Figure 37 Examples of Manifold Tests Output Meshes...... 51

Figure 38 Manifold Tests on Real Image Data ...... 52

Figure 39 Element with Three Facets on the Boundary ...... 53

ix

Figure 40 Distribution of Shape and Scaled Jacobian of Neghip at Internal Vertices with isovalues [73.5, 255.5] ...... 55

Figure 41 Shape Distribution of Silicium, Marschnerlobb, Lobster, Fuel and Aneurysm at

Internal Vertices for Interval Volume Range [73.5, 255.5] at Internal Vertices ...... 56

Figure 42 Scaled Jacobian Distribution of Silicium, Marschnerlobb, Lobster, Fuel and

Aneurysm for Interval Volume Range [73.5, 255.5] ...... 57

Figure 43 Scaled Jacobian Distribution at All Vertices for Interval Volume [73.5, 255.5]

...... 58

Figure 44 Scaled Jacobian Distribution of all Datasets at Internal Vertices for Interval

Volume Range [29.5, 48.5] ...... 59

Figure 45 Scaled Jacobian Distribution of all Datasets at All Vertices for Interval Volume

Range [29.5, 48.5] ...... 60

Figure 46 Edge Length Distribution of Neghip with Isovalues [29.5, 48.5] ...... 61

Figure 47 Edge Length Distributions of all Datasets with Isovalues [29.5, 48.5] ...... 62

Figure 48 Optimization Smoothing for Scaled Jacobian at All Vertices for Interval

Volume [73.5, 255.5] ...... 64

Figure 49 Scaled Jacobian Distribution of Neghip at Internal Vertices in [29.5, 48.5] ... 66

Figure 50 Scaled Jacobian Distributions of all Datasets with Isovalues [29.5, 48.5] ...... 67

Figure 51 Hexahedral Mesh of Generated by Bolt 2.0 with isovalues [73.5, 255.5] ...... 69

Figure 52 Comparison of Neghip Scaled Jacobian of DIVol and Bolt at Internal Vertices

...... 71

Figure 53 Scaled Jacobian of Neghip by Bolt 2.0 with Various Number of Hexahedra .. 71

x

Figure 54 Comparison of Silicium Scaled Jacobian of DIVol and Bolt 2.0 ...... 72

Figure 55 Comparison of Marschnerlobb Scaled Jacobian of DIVol and Bolt 2.0 ...... 72

Figure 56 Comparison of Lobster Scaled Jacobian of DIVol and Bolt 2.0 ...... 73

Figure 57 Comparison of Fuel Scaled Jacobian of DIVol and Bolt 2.0 ...... 73

Figure 58 Comparison of Aneurysm Scaled Jacobian of DIVol and Bolt 2.0 ...... 73

xi

Chapter 1 Introduction

X-ray computed tomography (CT) or magnetic resonance imaging (MRI) scanners are widely used in medical and industrial diagnostics. The CT and MRI scanners produce a set of values placed on regular grid vertices, where each vertex value represents material properties such as densities, pressures or temperatures. These data are referred to as volumetric data.

There are two standard approaches to visualizing an object represented by volumetric data. One approach, direct , uses a transfer function to compute the color at each point based on the data. By using different transfer functions, different objects can be rendered from the data. Direct volume rendering produces excellent images, but the algorithms are computationally expensive, and the image cannot be used for simulation purpose.

Surface reconstruction is another approach to visualizing volumetric data. The

Marching Cubes algorithm is one of the most famous surface reconstruction algorithms

(Lorensen & Cline, 1987). The Marching Cubes algorithm constructs triangular surface patches within each grid cube based on the scalar values at the grid nodes. Each patch is a triangulated surface with vertices on the grid cube. The whole surface is constructed by connecting all the small patches together. Another surface reconstruction algorithm is

Dual Contouring. The Dual Contouring algorithm places a point inside each grid cube.

Points in adjacent cubes are connected to construct a surface patch. As with the Marching Cubes algorithm, these patches together form the object surface. 1

In medical and industrial diagnostics, numerical simulations such as Finite Element

Analysis (FEA) and Computational Fluid Dynamics (CFD) are always required for understanding physical processes in objects or domains. Direct volume rendering and surface reconstruction algorithms can properly visualize the object, but the output image or surface patches cannot be used for simulating processes in the interior or exterior of an object. Mesh generation is a necessary step for FEA and CFD simulations. Typical meshes are triangular and quadrilateral meshes in 2D and tetrahedral and hexahedral meshes in 3D. Figure 1 shows an example of a mesh on the surface of a torus. Triangular and tetrahedral meshes are the most common . Octree based, advancing front and Delaunay are the three most well-known triangle/tetrahedral mesh generation techniques. However, triangular and tetrahedral mesh usually require more elements than quadrilateral and hexahedral meshes to achieve same level of accuracy. Typical hexahedral mesh generation techniques include grid-based, medial surface, plastering and whisker weaving methods. Detailed description of these techniques are discussed in

Chapter 2.

Figure 1 Torus Mesh Example

Most of the meshing algorithms requires surface geometry as input to generate internal meshes. For volumetric input data, these algorithms reconstruct the surface 2 before generating the mesh, which takes extra computation time. Zhang and Bajaj (2006) presented an algorithm to extract adaptive quadrilateral and hexahedral meshes from volumetric data. They use an octree-based Dual Contouring algorithm to extract an adaptive hexahedral mesh. Their algorithm only adds one vertex per grid cube and requires multi-resolution to avoid non-manifold mesh conditions. In this paper, we propose Dual Interval Volume (DIVol), an algorithm which generates all hexahedral meshes directly from the volumetric data. The algorithm first labels all vertices with ‘+’,

‘-‘ and ‘*‘ based on the scalar values at each vertex. The DIVol algorithm constructs a lookup table for all possible configurations with labeled vertices. Each lookup table entry contains information of hexahedra dual to edges and scalar grid vertices. It also contains the information of the dual vertices incident on the dual hexahedra. After the construction of the lookup table, DIVol generates a hexahedral mesh based on this lookup table. For each scalar grid cube, DIVol retrieve the dual interval volume hexahedra incident on each edge and corner. Then, DIVol computes the dual interval volume vertex locations using linear interpolation. These dual interval volume vertices are the hexahedral mesh vertices.

This paper is organized as follows. Chapter 2 reviews past research about surface reconstruction and mesh generation algorithms. Chapter 3 describes how the DIVol algorithm generates hexahedral mesh from volumetric data, and how to handle ambiguous and manifold issues. Chapter 4 discusses the mesh quality metrics and methods to improve the DIVol output mesh quality. Chapter 5 shows the experimental results and compares the DIVol mesh quality with commercial software Bolt 2.0. Chapter

6 summarizes the contributions and remaining issues.

3

Chapter 2 Background

A scalar field is a function 휙 which assigns a scalar value to each point in 푅푑. The value d is the dimension of the scalar field. Given a scalar field and a constant scalar value 휎, the set 휙−1(휎) = {푥: 휙(푥) = 휎} is called a level set of 휙. In three dimensions, level sets are also called implicit surfaces or . In medical and industrial applications, X-ray computed tomography (CT) or magnetic resonance imaging (MRI) scanners produce regular grids of scalar values representing material densities of the scanned objects. The regular grid generated by the CT and MRI is a sampling of a scalar field. Scalar fields can represent many physical properties such as temperature, pressure humidity and density. The scalar field can be used for rendering the object geometry or performing Finite Element Analysis (FEA) and Computational Fluid Dynamics (CFD) simulations.

A common way to render an object represented by a scalar grid is to extract an isosurface from the scalar grid. An isovalue is specified to indicate the location of the isosurface, and corresponding surface meshes are constructed based on the isovalue and the scalar field. Two popular algorithms (Marching Cubes and Dual Contouring) for extracting isosurfaces will be discussed in Section 2.1.

To perform FEA or CFD simulations on an object, meshing inside or outside the isosurface is needed to discretize the entire domain. Meshing algorithms should be applied to the isosurface or CAD model. Section 2.2 will introduce typical techniques for generating tetrahedral and hexahedral meshes. To increase the accuracy and robustness of 4 the simulation, the mesh should meet special geometric requirements. Section 2.3 will discuss metrics of mesh quality and relevant techniques for improving the mesh quality.

2.1 Isosurface extraction

In most cases, an isosurface is extracted from the scalar field in the form of a piecewise linear approximation. The Marching Cubes algorithm (Lorensen & Cline, 1987) is one of the most popular algorithm to extract an isosurface surface. The input of the

Marching Cubes algorithm is an isovalue and a set of scalar values at each vertex of a regular grid. Vertices with scalar values which are greater than or equal to the isovalue are called positive vertices, and all the other vertices, with scalar values less than the isovalue, are called negative vertices. A cube edge with one positive vertex and one negative vertex is called a bipolar edge. In each cube, the isosurface should intersect each of the bipolar edges. In Figure 2, an example cell is shown with isovalue equals to 2. The edge with scalar values 1 and 3 at two ends are bipolar edges. The shaded triangles are isosurfaces in this cell.

Figure 2 Example of a Scalar Field with Isovalue equals to 2

5

Since each vertex can either be positive or negative, there are a total of 28 = 256 configurations with reflections and rotations. The number of distinct configurations can be reduced to 22 and a lookup table built accordingly (Wenger, 2013). An isosurface extracted by the Marching Cubes algorithm usually follows three steps: read in the isosurface lookup table, retrieve the local isosurface triangle from the lookup table, and compute the isosurface vertices locations based on the cube scalar values.

The Marching Cubes algorithm may have choices in constructing an isosurface. This is called an ambiguous case. Ambiguity happens when a quadrilateral has four bipolar edges. As shown in Figure 3, in a 2D grid with two positive vertices on one diagonal and two negative vertices on the other diagonal, there are two possible contours corresponding to one scalar field, which are ambiguous configuration. Choosing different isocontours will change the topology. Figure 4 gives an example of an ambiguous configuration in 3D.

Figure 3 Example of 2D Ambiguous Case

6

Figure 4 Example 3D Ambiguous Case

Nielson and Hamann (1991) introduced the Asymptotic Decider to resolve the ambiguity problem. The decider uses bilinear interpolation to determine which vertices are to be connected. Another way to eliminate ambiguity is to subdivide each cube into 5 or 6 tetrahedra and assume linear variation in each tetrahedron (Nielson & Hamann,

1990).

Another concern regarding the Marching Cubes algorithm and its variants is their poor ability to correctly approximate sharp features. Since volumetric data is a discrete sample of the original field, sharp edges and corners may fall inside a grid cube. The

Extended Marching Cubes (Kobbelt et al., 2001) algorithm tries to overcome this limitation. The Extended Marching Cubes method has basically two operations. One is detecting and sampling the sharp features and the other is edge flipping. The main idea is to find the exact intersection points by intersecting the tangent planes of the zero-crossing points. Ho et al. (2005) developed a Cubical Marching algorithm which converts

7

3D marching cubes into 2D cubical marching squares, resolving topology ambiguity with sharp features and eliminating inter-cell dependency by sampling sharp features

Another popular approach for extracting isosurfaces is Dual Contouring algorithms.

Instead of adding isosurface vertices on grid edges, Dual Contouring algorithms place isosurface vertices inside grid cubes intersected by the isosurface. connect isosurface vertices in the four adjacent grid cubes which share a common grid edge.

Gibson (1998) gave the first Dual Contouring algorithm called Surface Nets, placing at most one isosurface vertex inside each grid cube. Nielson (2004) described the Dual

Marching Cubes algorithm which adds between one and four vertices inside each grid cube. The algorithm uses a lookup table based on the configuration of positive and negative cube vertices. For each interior bipolar grid edge, retrieve from the lookup table the associated isosurface vertices and add a quadrilateral. Ju et al. (2002) propose Dual

Contouring that uses Extended Marching Cubes to sample sharp features and Surface

Nets to connect the features to form the surfaces. This method achieved a good preservation of sharp features. Regarding the sharp feature problem, Schaefer and Warren

(2004) proposed an alternative solution by introducing an algorithm, also named Dual

Marching Cubes, which uses dual grids. (This should not be confused with Nielson’s

Dual Marching Cubes algorithm.) Compared to Dual Contouring and Extended Marching

Cubes, this approach requires a sparse underlying octree to produce an equivalent contour.

The dual grid also provides a better approximation of sharp features when they are not axis aligned. To allow finer control over small features, Varadhan et al. (2003) modified the Dual Contouring algorithm to model two intersections of the isosurface and each grid

8 edge. Zhang, Hong, and Kaufman (2004) further modified the algorithm to model more complicated structures within a grid cube. Varadhan et al. (2006) proposed a different solution for an accurate topological and geometrical polygonal approximation using visibility mapping. The algorithm catches all topological features by subdividing the surface into cells that are star-shaped patches and then is performed for each patch.

Zhang and Bajaj (2006) presented an algorithm to extract adaptive quadrilateral and hexahedral meshes from volumetric data. They use octree-based algorithm and Dual

Contouring algorithm to extract uniform hexahedral mesh and refine the mesh adaptively.

Their algorithm only adds one vertex per grid cube and requires multi-resolution to avoid non-manifold mesh. Bhattacharya and Wenger (2013) developed a cube merging algorithm to construct isosurfaces with sharp feature by merging grid cubes near sharp edges.

2.2 Mesh Generation

2.2.1 Definition of Mesh

A mesh is a discretization of a geometric domain into small simple shapes. The

Marching Cubes and the Dual Contouring algorithms only generate meshes on the isosurface. However, to perform physical simulation such as Finite Element Analysis

(FEA) of Computational Fluid Dynamics (CFD) on the interior or exterior of an object, the entire geometric domain needs to be meshed. The basic idea of FEA and CFD is to calculate physical properties at only a limited number of points and then interpolate the results for the entire domain. Meshing is a necessary step to partition the domain into

9 limited units. In one-dimensional space, a mesh is composed of line segments; In two- dimensional space, commonly used meshes are triangles and quadrilaterals; In three- dimensional space, commonly used elements are tetrahedra, pyramids, prisms and hexahedra.

Meshes can be classified in two types: structured meshes and unstructured meshes

(Figure 5). A structured mesh is one in which all the elements are regularly connected.

An unstructured mesh is one in which every element may have arbitrary neighbors.

Generally, structured meshes are easy and fast to generate, but only fit simple geometric domains. Unstructured meshes are a better fit to complicated domain and are better for mesh refinement.

Mesh quality is very important to numerical simulation because it affects the simulation accuracy and convergence. Mesh quality metrics are used to quantify the quality of a mesh. A mesh quality metric is a scalar function that measures some geometric properties of the element. Volume, aspect ratio, skew, angles and stretching are commonly used quality metrics.

Figure 5 (a) Structured Mesh (b) Unstructured Mesh

10

2.2.2 Triangle/Tetrahedral Mesh Generation

Triangle and tetrahedral meshes are the most common types of unstructured meshes.

Octree based, advancing front and Delaunay are the three most well-known triangle/tetrahedral mesh generation techniques. The octree meshing technique starts with a cube contains the entire geometric model and then recursively subdivides the cube until the desired resolution is reached (Shephard & Georges, 1991). The mesh the is generated based on the intersection of subdivided cells and the geometric surface boundary.

Advancing front methods start from a boundary and move a front from the boundary towards empty space within the domain (Frey, Borouchaki, & George, 1996; Lohner,

1988; Seveno & others, 1997). First, tetrahedral meshes are formed on the boundary. The boundary of the tetrahedra facing the domain inside is called front. The front will progress to fill in the unmeshed area with new tetrahedra until the entire domain is meshed.

A third popular triangular and tetrahedral meshing technique is the . A Delaunay triangulation for a given set P of discrete points in a plane is a triangulation DT(P) such that no point in P is inside the circumcircle of any triangle in

DT(P). This is referred to as the Delaunay criterion. To achieve good conformity and element shape, refinement is always a necessary step for Delaunay triangulation.

Delaunay refinement refines the triangles or tetrahedra locally by inserting new nodes to maintain the Delaunay criterion. Different approaches to define new nodes were studied

(Cheng & Dey, 2003; Chew, 1997; J. R. Shewchuk, 1998). A deterministic algorithm

(Cheng & Dey, 2003) was presented for generating a weighted Delaunay mesh with no

11 poor quality tetrahedra including slivers. To enforcing boundary conformity, Shewchuk

(2002) introduced the constrained Delaunay triangulation (CDT). A constrained

Delaunay triangulation is a generalization of the Delaunay triangulation that forces certain line segments or triangle to be in the triangulation. A constrained Delaunay triangulation may contain edges that do not satisfy Delaunay criterion, but it can be used to conform to a boundary mesh.

2.2.3 Hexahedral Mesh

Hexahedral meshes are another commonly used mesh type. Hexahedral meshes are often preferred over tetrahedral meshes if available. Tetrahedral meshes typically require

4-10 times more elements than a hexahedral mesh to obtain the same level of accuracy

(Cifuentes & Kalbag, 1992; Weingarten, 1994). In some types of numerical approximations, tetrahedral elements will be mathematically ‘stiffer’ due to a reduced number of degrees of freedom associated with a tetrahedral element (Benzley, Perry,

Merkley, Clark, & Sjaardama, 1995; BussLER & Ramesh, 1993).

Hexahedral meshing algorithms can be categorized as direct methods and indirect methods. One indirect method is dividing triangles into three quadrilaterals or decomposing each tetrahedron mesh into four hexahedra (Eppstein, 1999). This method requires first triangulation and then subdivision into hexahedra. An example of indirect hexahedral mesh generation is shown in Figure 6. The main problem of this subdivision method is that if the tetrahedral mesh has bad mesh quality, the generated hexahedral mesh will inherit some of the bad quality metrics such as small dihedral angles.

12

Figure 6 Indirect Hexahedral Mesh Generation

Another approach is recombining tetrahedra into hexahedra (Botella, Lévy, &

Caumon, 2016; Lo, 1989). Since all operations are local, indirect methods have the advantage of being very fast. Global intersection checks are not necessary as is required with some forms of direct methods. The drawback of indirect methods is that it significantly increases the total number of elements.

The other hexahedral meshing approaches are direct methods. Direct methods mainly include four techniques: grid-based, medial surface, plastering and whisker weaving. The grid-based approach generates a fitted 3D grid of hex elements on the interior of the volume (Schneiders, 1996, 1997). A regular grid of hexahedra is first placed inside the domain, and then extra hexahedra are inserted at the boundary to fill in the gaps between the regular grid and the domain boundary. This approach tends to generate low quality element at the region near boundary. Zhang and Zhao (2007) propose an adaptive hexahedral mesh generation based on local domain curvature and thickness using a modified grid-based method. Huang et al. (2016) improve the grid- based algorithm by refining mesh based on surface curvatures, geometry features, density

13 windows and field variables distribution. Medial surface methods are another approach for generating hexahedral meshes (Price & Armstrong, 1997; Price, Armstrong, & Sabin,

1995). Medial surface method partitions the domain by a set of medial surfaces, and then create hexahedral meshes using pre-defined templates within each local region.

Plastering algorithms take similar approaches as tetrahedral advancing front algorithms. The plastering algorithms first place elements on the boundary and advances the front of the elements towards the domain center (Blacker & Meyers, 1993; Canann,

1991). Since elements advance toward the center from different directions, they may not merge seamlessly and therefore require non-hex elements to fill in the last gap. The plastering algorithms sometimes also need to modify existing elements to facilitate placement of hexahedra towards the interior.

The Whisker Weaving algorithm is based on the spatial twist continuum (STC) or dual of the hex mesh (Tautges, Blacker, & Mitchell, 1996). STC or dual of the hex mesh are surfaces bisecting the original hexahedral mesh in each direction. After constructing the STC, the hex elements can then be fitted into the volume.

2.3 Mesh Quality Improvement

The quality of the meshes has significant influence on the FEA and CFD simulation result. Mesh quality is measured by algebraic mesh quality metrics based on geometric criteria, such as element volume, aspect ratio, skew, angles, stretching, and Jacobian. A detailed definition of quality metrics will be described in Chapter 3. Stimpson et al. (2007) provides standard checks for each metrics, which apply to both tetrahedral and hexahedral meshes.

14

Algorithms for mesh improvement can be classified into three categories (Owen,

1998; Teng & Wong, 2000): local coarsening/refinement, local remeshing, and mesh smoothing by relocating vertices. (J. R. Shewchuk, 1998), edge removal and multi-face removal optimization algorithm (J. Shewchuk, 2002) were used to improve the tetrahedral quality.

Laplacian smoothing, in its simplest form, relocates the vertex position at the average of the nodes connecting to it. This method generally works quite well for meshes in convex regions. However, it can result in distorted or even inverted elements near concavities in the mesh. George and Borouchaki (1998) weighted the contribution of each neighboring node in the average function. Field (1988) constrained the node movement in order to avoid the creation of invert elements. Meyer et al. (2003) discretized the Laplacian operator using Voronoi cells and the mixed finite element/finite volume method. The discretized format was used to solve surface modelling problems using the finite difference method (Xu, Pan, Bajaj, & others, 2003). De L’isle and George

(1995) and Hansbo (1995) developed methods to extend to anisotropic meshes.

Instead of relocating vertices based on a heuristic algorithm, people proposed optimization techniques to improve the mesh quality. The optimization algorithms measure the quality of the surrounding elements to a node and attempts to optimize it.

The optimization based smoothing yields better results while it is more expensive than

Laplacian smoothing. Therefore, Freitag (1997) recommended a combined

Laplacian/optimization-based approach, which uses Laplacian smoothing when possible and only uses optimization-based smoothing when necessary.

15

Chapter 3 Dual Interval Volume

A scalar field is a function 휙 which assigns a scalar value to each point in 푅푑. The

set 휙−1(휎) = {푥: 휙(푥) = 휎} is called a level set of 휙. The region between two level sets

is called an interval volume. In this chapter, we introduce the Dual Interval Volume

(DIVol) algorithm which generates an all hexahedral mesh directly from the volumetric

data in the interval volume region. Several rules are defined to guarantee that the mesh is

a manifold.

3.1 Definitions and Notations

The interval volume for a function 휙: 푅3 → 푅 is defined as:

3 І휙(휎0, 휎1) = {푥 ∈ 푅 : 휎0 ≤ 휙(푥) ≤ 휎1}

where 휎0 is the lower isovalue and 휎1 is the upper isovalue. Let v be a mesh vertex

with scalar value 푠푣, then:

(1) Vertex v is positive, “+”, if 푠푣 > 휎1.

(2) Vertex v is negative, “-”, if 푠푣 < 휎0.

(3) Vertex v is star, “*”, if 휎0 ≤ 푠푣 ≤ 휎1.

An example of interval volume is shown in Figure 7 with 휎0 equals 0.5 and 휎1

equals 2.5.

16

Figure 7 Interval Volume between Isovalues 0.5 and 2.5

Definition of edges is given as:

(1) An edge with two positive vertices is a positive edge.

(2) An edge with two negative vertices is a negative edge.

(3) An edge with two star vertices is a star edge.

(4) An edge with two different types of vertices is a bipolar edge.

Note that all positive and negative edges are outside the interval volume. All star

edges are inside the interval. All bipolar edges are intersecting the boundary of the

interval volume.

3.2 Dual Marching Cubes

The Dual Marching Cubes algorithm was developed by Nielson (2004) for

extracting an isosurface from a scalar field. For cubes with at least one bipolar edge, the

Dual Marching Cubes algorithm places one or more vertices in the cube. For each bipolar

edge, a quadrilateral is created by connecting four vertices in the four incident cubes of

the bipolar edge. If the cube has more than one vertex, a preconstructed lookup table is

used to determine the right vertex for creating the quadrilateral. 17

In each cube, a vertex can be either positive or negative so that there are 28 = 256 different configurations. After merging the rotation and reflection cases, there are 22 distinct cube configurations as shown in Figure 8.

0 1

2A 2B 2C

3A 3B 3C

4A 4B 4C

Figure 8 Dual Marching Cubes Lookup Table

18

4D 4E 4F

5A 5B 5C

6A 6B 6C

7 8

19

To construct an entry in the lookup table, each cube is considered as a graph. The cube vertices are graph vertices and cube edges are graph edges. A connected component with all positive vertices is called a positive connected component, and a connected component with all negative vertices is called a negative connected component.

For example, in the configuration shown in Figure 9, there are two negative connected components. Two isovertices W1 and W2 are assigned to each component. For each bipolar edge, there is a quadrilateral dual to the edge. Vertex W1 is incident on the quadrilaterals which are dual to the three cube edges 푒1, 푒2 and 푒3. The lookup table

Table stores this association relationship by adding pairs Table[k, 푒1] = Table[k, 푒2] =

Table[k, 푒3] = W1, where k represents one of the 22 configurations. The assigned value

W1 means the vertex is the first dual isosurface vertex in this configuration. On the other side, vertex W2 is incident on the quadrilaterals which dual to three cube edges 푒4, 푒5 and

푒6. The lookup table Table stores this association relationship by adding pairs Table[k, 푒4]

= Table[k, 푒5] = Table[k, 푒6] = W2, where k represents one of the 22 configurations. The assigned value W2 means the vertex is the second dual isosurface vertex in this configuration.

For each lookup table entry, the Dual Marching Cubes algorithm determines the total number of isosurface vertices using the total number of negative connected components. This is the default option in the Dual Marching Cubes algorithm. In some circumstances, the Dual Marching Cubes algorithm may change to use the total number of positive connected components to determine the number of isosurface vertices to avoid non-manifold case.

20

Figure 9 An Example of Marching Cubes Lookup Table

For each bipolar edge, all the dual isosurface vertices are retrieved using the lookup table. The isosurface quadrilateral which is dual to this bipolar edge is constructed by connecting all the dual isosurface vertices in order. All the quadrilaterals constructed in this way form the isosurface of the original object. The position of each isosurface vertex is determined by the isovalue using linear interpolation.

In 4D, the dual isosurface vertices and dual quadrilaterals are constructed in the same way. Figure 10 is an example of a hypercube with one negative vertex. Two facets of the hypercube are connected between the two hyperplanes h0 and h1. There is only one negative connected component such that there is one dual isosurface vertex. There are three bipolar edges in hyperplane h1 and one bipolar edge between hyperplane h0 and hyperplane h1. Therefore, there are four quadrilaterals dual to these bipolar edges.

21

Figure 10 Example of 4D Dual Contouring

3.3 DIVol

3.3.1 Background

The input to DIVol algorithm is a set of scalar values at the vertex of a regular grid and two isovalues 휎0, 휎1 with 휎0 < 휎1. The output of DIVol algorithm is a hexahedral mesh filling in the region between 휎0 푎푛푑 휎1. Figure 11 shows an example scalar fields and corresponding output hexahedral meshes with isovalues 0.5 and 2.5. The left side shows a 4 × 4 × 4 3D scalar field composed of isovalues 1 and 3. A grid vertex with scalar value 1 is in the range of [0.5,2.5] so that it lies inside the interval volume. A grid vertex with scalar value 3 is outside the range [0.5,2.5] so that it lies outside of the interval volume.

22

(a) (b)

Figure 11 (a) A 4 × 4 × 4 Scalar Grid with Scalar Values 1 and 3; (b) Corresponding Interval Volume Mesh

Algorithm DIVol has four steps:

(1) Construct a lookup table.

(2) For each bipolar edge, retrieve the interval volume hexahedra dual to the bipolar

edge.

(3) For each grid vertex, retrieve the interval volume hexahedral dual to the vertex.

(4) Compute vertex locations using linear interpolation.

3.3.2 Construction of the Interval Volume Lookup Table

To generate the lookup table entry for a given configuration, we lift a cube c in 푅3 to

4 higher dimension 푅 as two hypercubes c × [0, 2]. Set c × [0, 2] = {(px, py, pz, 훼) : (px, py, pz) ∈ c and 훼 ∈ {0, 1, 2}}, where (px, py, pz) is the vertex coordinate in 3D and 훼 is the

23 fourth dimension parameter representing the hyperplanes. The three hyperplanes of c ×

[0, 1] are defined as:

ℎ0 = {(푝푥, 푝푦, 푝푧, 훼): 훼 = 0}

ℎ1 = {(푝푥, 푝푦, 푝푧, 훼): 훼 = 1}

ℎ2 = {(푝푥, 푝푦, 푝푧, 훼): 훼 = 2}

In a 4D hypercube, we label all vertices with only positive and negative labels instead of using positive, star and negative. Rules to label the vertices of c × [0, 1] are given as follow:

(1) If vertex (푝푥, 푝푦, 푝푧) in 3D has a positive label, then label vertices (푝푥, 푝푦, 푝푧, 훼)

positive for 훼 ∈ {0,1,2};

(2) If vertex (푝푥, 푝푦, 푝푧) in 3D has a negative label, then label vertices (푝푥, 푝푦, 푝푧, 훼)

negative for 훼 ∈ {0,1,2};

(3) If vertex (푝푥, 푝푦, 푝푧) in 3D has a star label, then label vertices (푝푥, 푝푦, 푝푧, 0) and

(푝푥, 푝푦, 푝푧, 1) with positive, and label vertices (푝푥, 푝푦, 푝푧, 2) with negative.

An example of lifting a 3D cube to a 4D hypercube is shown in Figure 12.

24

Figure 12 Example of Lifting 3D Cube to 4D Hypercube.

After constructing the two 4D hypercubes, the number and the positions of the dual interval volume vertices and hexahedra can be determined by analyzing the connected components and bipolar edges in the 4D hypercubes. Either positive connected components or negative connected components can be used to determine the total number of dual interval volume vertices. The DIVol algorithm chooses negative connected components as the default option. The total number of dual interval volume vertices in

3D cube equals to the total number of connected negative components in the two 4D

25 hypercubes, and the total number of dual interval volume hexahedra equals the number of bipolar edges in 4D. The bipolar edges in hyperplane h0 and hyperplane h1 represent hexahedra dual to the 3D cube edges, and the bipolar edges between hyperplane h1 and hyperplane h2 represent hexahedral dual to the 3D cube vertices.

Several examples are given to illustrate the procedure of building the DIVol lookup table.

Case One: All Positive Vertices with One Star Vertex

The simplest example is a cube with 7 positive vertices and one star vertex as shown in Figure 13. When the cube is lifted to 4D, the star vertex is set to positive in hyperplane h0 and hyperplane h1 and negative in hyperplane h2. In this hypercube, there is just one negative component (the only negative vertex in hyperplane h2). Therefore, only one dual interval volume vertex is placed in the 3D cube. There is one bipolar edge between hyperplane h1 and hyperplane h2. Therefore there is one hexahedron dual to the 3D cube vertex.

With this configuration, the lookup table is built by linking the interval volume vertex to the three “+*” bipolar edges and the star vertex.

26

Figure 13 Build Lookup Table for Cube with 7 star and 1 Positive Vertices.

Case Two: Mixed Cube with Positive, Negative and Star Vertices.

An example with a mix of positive, negative and star vertices is given in Figure 14.

The star vertices are set to be positive in hyperplane h0 and hyperplane h1 and negative in hyperplane h2. In this hypercube, there is one connected negative component between hyperplane h0 and hyperplane h1, and another connected negative component between hyperplane h1 and hyperplane h2. Therefore, there are two dual interval volume vertices in the 3D cube. There are four bipolar edges in hyperplane h2 and thus there are four hexahedral dual to the 3D cube edges. There are another four bipolar edges between

27 hyperplane h1 and hyperplane h2 and thus there are four hexahedra dual to the 3D cube vertices.

Figure 14 Example of Lookup Table with Positive, Negative and Star Vertices.

Case Three: Two Negative Connected Components in One Cube.

An example of lookup table entry with two negative connected components is shown in Figure 15. There are four positive vertices on one diagonal plane and four star vertices on the other diagonal plane. In the 4D hyperplanes, the star vertices are set to be positive in hyperplane h0 and hyperplane h1 and negative in hyperplane h2. In the hypercube between hyperplane h1 and hyperplane h2, there are two negative connected components. Therefore, there are two dual interval volume vertices in the 3D cube, and

28 the hexahedra incident on different dual interval volume vertices are separated. There are four bipolar edges between hyperplane h1 and hyperplane h2 and thus there are four hexahedral dual to the 3D cube vertices.

Figure 15 Example of Lookup Table with Two Negative Connected Components

3.4 Manifold

An n-dimensional manifold is a topological sphere where each point has a neighborhood that is homeomorphic to the Euclidean space of dimension n. An n- dimensional manifold can be referred as an n-manifold. DIVol algorithm develops several rules to generate a mesh which is a manifold.

29

When generating a hexahedral mesh with the DIVol algorithm, there exists cases where the mesh can be non-manifold. Several non-manifold examples are shown in

Figure 16.

(a) (b)

Figure 16 Examples of Non-manifold Mesh.

Non-manifold cases are caused by the ambiguous facets as mentioned in Chapter 2.

Examples of ambiguous facets are shown in Figure 17. When lifting these facets into higher dimension, the star vertices in Figure 17 (b) (c) (d) (e) will be assigned with positive or negative labels. Therefore, they become the same ambiguous facets as Figure

17 (a). Note that a quadrilateral with one positive vertex and one negative vertex on opposite diagonal and two star vertices on the other diagonal is not an ambiguous facet

(Figure 18). In this configuration, only star vertices can form connected components and the positive and negative vertices must be separated. The quadrilaterals or the hexahedra dual to the positive diagonal at opposite corners connect at a single vertex or a single edge, which causes the non-manifold condition.

30

(a) (b) (c)

(d) (e)

Figure 17 Ambiguous Facets.

Figure 18 Not an Ambiguous Facet.

31

Figure 19 Example of Non-Manifold Mesh.

An example of non-manifold meshes and the corresponding scalar field is shown in

Figure 19. The common facet of the two cubes is ambiguous. When lifting one of the cubes to 4D as in Figure 20, there is one connective negative component and two bipolar edges between hyperplane h1 and hyperplane h2. Therefore, there are two hexahedra dual to the star vertices and they are connect with an edge creating a non-manifold condition.

A split positive connected component rule is introduced to fix this non-manifold problem.

Figure 20 Non-manifold Mesh Example in 4D

32

(1) Split Positive Connect Components

The DIVol algorithm counts the negative connected components to determine the number of dual interval volume vertices. This rule is to guarantee the consistency of the lookup table construction. If two neighboring cubes use positive connected components at the same time on their common facet, their dual hexahedra can still match each other.

Therefore, a split positive connected component rule is applied when ambiguity like the case in Figure 19 happens.

In the example shown in Figure 20, if positive connected components are used to determine the number of dual interval volume vertices instead of negative connected components, then there are two positive connected components between hyperplane h1 and hyperplane h2. In the 3D cube, the two dual interval volume hexahedra are separated because they are incident on two different dual interval volume vertices. In this way, the output mesh becomes a manifold.

(2) Subdivision

Splitting positive connected components can handle several non-manifold cases, but there exist configurations that splitting positive connected component makes no difference. Figure 21 shows a non-manifold mesh example. The output meshes are the same no matter whether split positive connected components or split negative connected component is used. In the scalar grid, it is the ambiguous facet between the two grid cubes causing the non-manifold. To eliminate this type of non-manifold meshes, an intuitive idea is to change the label of one vertex. For example, in Figure 21, if one of the

33 plus vertices is changed to a star vertex, the ambiguous facet is eliminated. However, changing the original scalar grid values is problematic because it manipulates the input data. Therefore, we propose a series of subdivision rules which subdivide each grid cube into 8 subcubes and change the labels of the newly created vertices to eliminate non- manifold cases.

Figure 21 Non-manifold Mesh which Split Positive Connected Components Cannot Fix.

The subdivision rule subdivides each facet into four quadrilaterals and evaluates the scalar values at new vertices using linear interpolation as shown in Figure 22. If the subdivision creates an ambiguous facet, the scalar values of several new vertices are altered based on the following five rules to eliminate the ambiguity.

Figure 22 Subdivision of a Unit Cube.

34

Rule 1: Linear Interpolation on Grid Edges

For all the scalar grid unit facet, linear interpolation is first performed as shown in

Figure 23. The computation process of Rule 1 is elaborated as:

• Scalar value at 푣01 is average of scalar at 푣0 and scalar at 푣1.

• Scalar value at 푣12 is average of scalar at 푣1 and scalar at 푣2.

• Scalar value at 푣23 is average of scalar at 푣2 and scalar at 푣3.

• Scalar value at 푣03 is average of scalar at 푣3 and scalar at 푣0.

Figure 23 Subdivision Rule 1.

Rule 2: Three Corners of Same Label

For configurations which tend to generate non-manifold meshes, the center of the

is evaluated based on a series of special rules. Rule 2 considers a unit facet with

three same corner vertices. As shown in Figure 24, if corner vertices 푣0, 푣1 and 푣3 are

labeled with the same labels (positive, star or negative), and vertex 푣2 is different (Figure

24), set the scalar value at center vertex 푣푐 to be the average of vertices 푣1 and 푣3, so that

the center vertex is the same type as vertices 푣0, 푣1 and 푣3. Rule 2 guarantees that none

of the facets are ambiguous because in this configuration, vertices 푣0, 푣1, 푣3, 푣01, 푣03 35 and 푣푐 form one positive connected component, and vertex 푣2 is another connected components (negative or star connected components). Vertices 푣12 and 푣23 can belong to either side of the connected components, but this is not ambiguous.

Figure 24 Subdivision Rule 2.

Rule 3: Two Opposite Corners and Neighbor Edge Midpoint of Same Label

For the configuration in Figure 25, subdivision Rule 3 is applied to avoid ambiguous cases. In this configuration, vertices 푣1, 푣3, 푣01 and 푣03 have the same labels. Vertices 푣0 and 푣2 have different labels than vertices 푣1 and 푣3. Set center vertex 푣푐 to be average of

푣1 and 푣3. The center vertex is the same type as vertices 푣1, 푣3, 푣01 and 푣03. Since vertex

푣2 is not the same as vertices 푣푐, ambiguous facets cannot exist in this configuration.

Figure 25 Subdivision Rule 3.

36

Rule 4: Two Opposite Edge Midpoint of Same Label

If the two midpoints on the opposite edge have same label, Rule 4 can be applied to avoid ambiguity. In Figure 26, vertices 푣03 and 푣12 have same labels. Set center vertex 푣푐 to be average of 푣03 and 푣12 so that the center vertex is the same type as vertices 푣03 and

푣12. Ambiguity is avoided because each subsquare has a (+, +) or (*, *) or (-, -) edge.

In Rule 4, confliction may happen when vertices 푣03 and 푣12 determines one label and vertices 푣01 and 푣23 determines a different label. If a conflict happens, star vertices have higher priority over minus vertices, and minus vertices have higher priority over plus vertices.

Figure 26 Subdivision Rule 4.

Rule 5a: Two Opposite Corners with Positive Labels

Rule 5a is developed for configurations where the original grid facet is ambiguous and the previous rules do not apply. In Figure 27, vertices 푣1 and 푣3 are positive. Vertices

푣0, 푣2 are NOT positive. If the configuration is not covered by Rule 3 or Rule 4, set center vertex 푣푐 to be average of the two isovalues 휎0 and 휎1. Center vertex 푣푐 will be labeled with a star.

37

Rule 5a avoids ambiguous facets for the following reasons. If vertices 푣0 and 푣2 are star vertices, then the edge midpoint 푣01, 푣12, 푣23 and 푣03 can be either plus or star based on the subdivision. Therefore, every subdivided quadrilateral will have at least one “star - star” edge or one “plus-plus” edge. This avoids any ambiguity. If vertices 푣0 and 푣2 are minus, since vertices 푣01 and 푣03 cannot be positive at same time (otherwise the configuration is covered by Rule 3), the square with vertices 푣0, 푣01, 푣푐 and 푣03 cannot be ambiguous. Other squares avoid the ambigity for the same reason.

Figure 27 Subdivision Rule 5a.

Rule 5b: Two Opposite Corners with Negative Labels

Rule 5b is the symmetric case of Rule 5a. As shown in Figure 28, vertices 푣1 and 푣3 are negative. Vertices 푣0 and 푣2 are NOT negative. If the configuration is not covered by

Rule 3 or Rule 4, set center vertex 푣푐 to be average of the two isovalues 휎0 푎푛푑 휎1.

Center vertex 푣푐 will be labeled with a star.

38

Figure 28 Subdivision Rule 5b.

The procedure of applying Rule 1 to Rule 5 is shown in Figure 29. Rule 1 is applied for every cube. For Rule 2 to Rule 5, at most one rule is applied. If one rule applies, use that rule to evalute the scalar value at facet center. Otherwise, check the next rule until a rule applies. If all the rules from Rule 2 to Rule 5 do not apply, the facet center value is determined by linear interpolation of the scalar values at all corner vertices.

39

Figure 29 Procedure of Appying Subdivision Rule 1 to Rule 5

40

Rule 6: Cube Center

The above rules discussed the subdivision rules of a unit square. In 3D scalar fields, a subdivision rule for the unit cube center is needed. In a unit cube, the cube center value is determined by the three squares passing through it. 1) If none of the threes squares belongs to the previous rules, then use linear interpolation to determine the cube center value. 2) If only one of the three squares belongs to the previous rules, use that square and corresponding rule to evaluate the cube center. 3) If more than one square belongs to the previous rules and they produce same type at the cube center, then use the average of these scalar values at the cube center.

Among the three squares passing through the cube center, if more than one square belongs to the previous rules and the rules produce different results at cube center

(conflicting rules), the following rule is applied. As shown in Figure 30, label the six facets center vertices with 1,2,3,4,5 and 6 (vertices 1, 2 in X direction; vertices 3, 4 in Y direction; vertices 5, 6 in Z direction). If three of the facet center vertices are of the same type and they are from three different directions, then set the cube center to be the average of the two isovalues 휎0 and 휎1. As in the example shown in Figure 30, if vertices

2, 3, 5 are all positive vertices, then set the cube center to be the average of the two isovalues 휎0 and 휎1. Otherwise, if the conflict happens between positive and star, set the cube center with the positive scalar value. If the conflict happens between negative and star, set the cube center with the negative scalar value.

41

Figure 30 Subdivision rule for cube center

(3) Eliminate Non-manifold Vertices

The subdivision rules can eliminate the non-manifold cases caused by an ambiguous

facet. However, non-manifold meshes can still be generated from a scalar field without

ambiguous facets. Figure 31 shows an example with a non-manifold vertex.

Figure 31 Non-manifold Vertex Example

In this example, neither split positive connected components nor subdivision can

help eliminate the non-manifold. The result of splitting positive connected components is

shown in Figure 32. No matter whether positive or negative connected components are

chosen to be split, there is only one connected component and therefore only one dual 42 interval volume vertex in 3D cube. Subdivision of the original scalar grid may produce a new cube with configuration in Figure 32. This configuration is not covered by the six rules. Subdivision may still produce a non-manifold vertex.

Figure 32 Lookup Table Entry Construction of Non-manifold Vertex Example.

A new rule is proposed in addition to the five subdivision rules to fix this non- manifold vertex problem. After subdivision is performed, if the configuration in Figure

32 exists, then change one of the positive vertices to a star vertex. If one of the positive vertices belongs to the original scalar field, then change the other one to makes sure that

43 the original scalar field is unchanged. The manifold result after applying this rule is shown in Figure 33.

Figure 33 Manifold Mesh by Applying Eliminate Non-manifold Vertices Rule

44

Chapter 4 Hexahedral Mesh Quality

The quality of the mesh has significant influence on the accuracy and convergence of the FEM and CFD simulation. A poor mesh may lead to unstable or inaccurate finite element approximations. Usually, mesh quality metrics are based on geometric criteria.

Knupp (2001) summarizes the categories and properties of the most used mesh quality metrics. In this paper, we will focus on three major quality metrics: edge length, Jacobian and shape.

4.1 Hexahedral Mesh Quality Metrics

A hexahedron is shown in Figure 34 with eight corner vertices being labeled as P0 to

P7.

Figure 34 Hexahedron with Corner Labels.

The twelve edge vectors are defined as follow:

45

The edge lengths are denoted as follow:

퐿0 = ‖퐿⃗ 0‖ … 퐿11 = ‖퐿⃗ 11‖

The maximum and minimum edge lengths are:

퐿푚푎푥 = 푚푎푥 {퐿0 … 퐿11}

퐿푚푖푛 = 푚𝑖푛 {퐿0 … 퐿11}

Jacobian matrices are given as follows, where A0 to A7 are Jacobian matrices at each vertex. Each item is defined using the three edge vectors incident on the vertex. Jacobian matrices measure the amount of stretching, rotating and transforming locally. For a unit cube, the determinant of Jacobian det(A푖) is 1 for all i.

With these definitions, the three mesh quality metrics can be defined as follows.

(1) Edge ratio and Minimum Edge Length

The edge ratio quality metric is the ratio of the longest to shortest edge of a hexahedron:

퐿 퐸푑𝑔푒푅푎푡𝑖표 = 푚푎푥 퐿푚푖푛

Generally, any edge ratio between 1 and positive infinity is acceptable. However, the minimum edge length should be greater than 0 since it is the denominator of the

46 metric. Geometrically, the minimum edge length should be greater than zero to guarantee each element is a hexahedron. The criteria for checking minimum edge length is:

퐿푚푖푛 > 0

(2) Jacobian and Scaled Jacobian

Jacobian is the most commonly used mesh quality metric because it indicates the inversion of a mesh. The Jacobian is defined as:

7 퐽푎푐표푏𝑖푎푛 = 푚𝑖푛 {푑푒푡(퐴푖)푖=0} where 푑푒푡(퐴푖) is the determinate. If the Jacobian value is negative, it means the mesh is inverted and the simulation result will be distorted. Therefore, an acceptable range of

Jacobian is from zero to positive infinity.

To eliminate the scale effect of the Jacobian, scaled Jacobian metrics are introduced.

The scaled version of the Jacobian metrices is given below. The acceptable range of the scaled Jacobian is from 0.5 to 1.

퐿⃗ 퐿⃗ 푗 퐿⃗ 퐴^ = ( 푖 , , 푘 ) ‖퐿⃗ 푖‖ ‖퐿⃗ 푗‖ ‖퐿⃗ 푘‖

7 푆푐푎푙푒푑퐽푎푐표푏𝑖푎푛 = 푚𝑖푛 {푑푒푡(퐴^ ) } 푖 푖=0

The Jacobian metric has a limitation that it cannot measure the distortion of an element. In the example shown in Figure 35, Figure 35 (a) is a unit cube and Figure 35 (b) is a distorted cube with right angles at each corner. The scaled Jacobian values are both 1 for these two hexahedra, which does not reflect the difference between these two cubes.

In this situation, another quality metric called shape is used to reflect the difference.

47

(a) (b)

Figure 35 A Unit Cube and A Distorted Cube.

(3) Shape

The shape metric is used for evaluating the distortion of an element. The definition of shape is given as follows. Shape is a dimensionless quantity because the denominator

2 is 퐴 to the power of 2 and the numerator is the determinant of 퐴 to the power of . 푖 푖 3

Compare to the scaled Jacobian, shape not only measures the local angle, but also indicates the distortion of an element.

2 7 푑푒푡(퐴푖)3 푆ℎ푎푝푒 = 3푚𝑖푛 { 2 } |퐴푖| 푖=0

The shape metric value is in range [0,1], and an acceptable range is in [0.3,1].

4.2 Mesh Quality Improvement

(1) Laplacian Smoothing

One of the most straight forward smoothing methods is Laplacian smoothing.

Laplacian smoothing places a vertex in the mesh at the average coordinate of all its

48 neighboring vertices. Assume the coordinate of a vertex is 푣 , and it has k neighbor vertices with coordinates 푣 1, … 푣 푘. Laplacian smoothing produces a new coordinate:

1 푣 = (푣 + 푣 + ⋯ + 푣 ) 푘 1 2 푘

Laplacian smoothing is useful for improving the quality of a mesh with large edge ratio or a mesh with zero edge length. Figure 36 shows an example of mesh improvement using Laplacian smoothing.

Figure 36 Laplacian Smoothing

We implement a two-step Laplacian smoothing as follows. First, vertices on the boundary with edge length below a given threshold are placed at the average location of all its neighboring vertices which are on the boundary. Internal neighboring vertices are not used for this averaging to make sure that the vertex is moving along the boundary surface. Second, vertices which are not on the boundary with edge length below a given threshold are placed at the average location of all their neighbor vertices. If there still exists edge lengths below the threshold after these two steps, additional rounds of smoothing are performed until no more improvement can be achieved.

49

(2) Optimization Smoothing

Optimization smoothing is another approach to improve mesh quality. Optimization- based smoothing method measures the metrics of the neighbor elements to a vertex and calculates the local gradient of the metrics with respect to the vertex location. The vertex is moved in the direction of the increasing gradient until optimal metrics are reached.

Each vertex with quality metrics below a given threshold is selected to be optimized by using a linear search procedure. The search directions are the edges connecting the vertex and all its direct neighbor vertices. The direction which improves the quality metrics most becomes the moving direction. In this direction, the vertex is moved until the optimal quality metrics are reached. Optimization smoothing is an iterative process.

Each vertex is optimized for optimal location in a number of iterations.

Optimization smoothing is slower compared to Laplacian smoothing because optimization smoothing searches in each direction. Therefore, a combined Laplacian smoothing and optimization smoothing is usually used to balance the efficiency and mesh quality. The Laplacian smoothing is first performed on the entire domain. Then, optimization is performed on the vertices where quality metrics are still below a given criterion.

50

Chapter 5 Experimental Results

This chapter describes the application of algorithm DIVol to synthetic data and real volumetric data. Mesh quality of each of the output hexahedral meshes is reported.

Results of manifold checks are also reported. The results are compared with commercial software Bolt 2.0.

5.1 Manifold Check of Random Data

In Chapter 3, methods of avoiding ambiguous configurations and generating manifold meshes were introduced. To test if DIVol can guarantee manifold meshes for any input dataset, we generated 50,000 random scalar fields with real number scalar values in the interval [0.0, 4.0] within a 10 × 10 × 10 three-dimensional domain and extracted the interval volume meshes. The two isovalues 휎0 and 휎1 are set as 1.0 and 3.0 respectively. The output meshes are checked for non-manifold vertices, edges and facets.

The result shows that all 50,000 tests passed the manifold check. Since the input data is generated randomly, the output meshes can be either dense or sparse. Three of the output meshes are shown in Figure 37.

Figure 37 Examples of Manifold Tests Output Meshes.

51

5.2 Manifold Check on Real Data

A series of manifold tests are also performed on real image data. Six datasets are used for manifold testing including Neghip, Silicium, Marschnerlobb, Lobster, Fuel and

Aneurysm. All the output meshes pass the manifold check. The resulting meshes are shown in Figure 38.

Neghip (휎0 = 73.5) Silicium (휎0 = 73.5) Marschnerlobb (휎0 = 73.5)

Lobster (휎0 = 73.5) Fuel (휎0 = 73.5) Aneurysm (휎0 = 73.5)

Figure 38 Manifold Tests on Real Image Data

52

5.3 Mesh Quality Check on Real Data for Interval Volume [흈ퟎ, +∞]

5.3.1 Mesh Quality at Internal Vertices

Mesh quality metrics are computed for all the real image datasets. The scalar values of all the image data are in the interval [0, 255]. Smaller isovalues represent the outside of an object, and larger isovalues represent the inside of an object. The mesh quality tests choose a random lower isovalue 휎0 within the range [0,255] and set upper isovalue 휎1 as

+∞ such that the interval volume represents the region inside an isosurface whose isovalue is 휎0.

Some of our mesh elements have three facets on the boundary (Figure 39). Because those facets are constrained by the surface geometry, they may have poor quality at the boundary. In this section, we only consider the mesh quality measured at internal vertices.

Figure 39 Element with Three Facets on the Boundary

(1) Neghip

The testing results of Neghip are shown in Table 1. The minimum values of the scaled Jacobian and the shape at internal vertices are reported.

53

As discussed in Chapter 4, the scaled Jacobian should be in range [0.5, 1] and the shape should be in range [0.3, 1]. As shown in the Table 5.1, most of the testing results fall in this range.

Table 1 Mesh Quality Tests of Neghip at Internal Vertices Minimum Number of Minimum 휎 휎 Scaled 0 1 Hexahedra Shape Jacobian 49.5 255.5 226230 0.5631 0.6304 55.5 255.5 205646 0.5558 0.6210 61.5 255.5 187946 0.5729 0.6241 67.5 255.5 172695 0.5144 0.5983 73.5 255.5 159249 0.5476 0.6302 79.5 255.5 147235 0.5810 0.6596 85.5 255.5 136179 0.5561 0.5907 91.5 255.5 126491 0.5708 0.6527 97.5 255.5 117702 0.4403 0.5662 103.5 255.5 109536 0.5897 0.6238 109.5 255.5 102212 0.4556 0.5858 115.5 255.5 95613 0.5409 0.5786 121.5 255.5 89648 0.5772 0.6164 127.5 255.5 84299 0.5832 0.5687 133.5 255.5 78823 0.5546 0.6365 139.5 255.5 74175 0.5714 0.6271 145.5 255.5 69797 0.5601 0.6337

There exist cases where the scaled Jacobian is less than 0.5. However, the results in

Table 1 only shows the minimum value. Taking one of the test cases as an example, the test case with 휎0 = 97.5 has minimum scaled Jacobian as 0.4403, which is out of the acceptable range. The distribution of the scaled Jacobian at each vertex is shown in

Figure 40. Most of the scaled Jacobian values are in the range [0.5, 1.0] and the values below 0.5 are negligible. The distribution of shape is also plotted in Figure 40. The same tests are also performed for other image data, and the results are listed in the following sections.

54

Shape Scaled Jacobian

Figure 40 Distribution of Shape and Scaled Jacobian of Neghip at Internal Vertices with isovalues [73.5, 255.5]

(2) Silicium, Marschnerlobb, Lobster, Fuel and Aneurysm

The same tests were performed on all other image data include Silicium,

Marschnerlobb, Lobster, Fuel and Aneurysm at internal vertices. The quality metrics results are shown in Table 7 to Table 11 Mesh Quality Tests of Aneurysm at Internal

Verticesin Appendix A. These results are plotted in Figure 41 and Figure 42 respectively.

There exist cases where scaled Jacobian values are below the required value 0.5. For example, several of the minimum scaled Jacobian values of Lobster fall in the region [0.4,

0.5]. However, the scaled Jacobian values are very close to 0.5, and the amount of the small Jacobian compare to the total number of vertices is negligible. As shown in Figure

42, more than 99% vertices have scaled Jacobian value greater than 0.5.

55

Silicium Marschnerlobb

Lobster Fuel

Aneurysm

Figure 41 Shape Distribution of Silicium, Marschnerlobb, Lobster, Fuel and Aneurysm at Internal Vertices for Interval Volume Range [73.5, 255.5] at Internal Vertices

56

Silicium Marschnerlobb

Lobster Fuel

Aneurysm

Figure 42 Scaled Jacobian Distribution of Silicium, Marschnerlobb, Lobster, Fuel and Aneurysm for Interval Volume Range [73.5, 255.5]

57

5.3.2 Mesh Quality at All Vertices

The above experimental results are computed at internal vertices. For the completeness of conducting experiments, the scaled Jacobian distributions of all vertices

(include boundary vertices) are reported in Figure 43. Due to the constraint of surface geometry, there exist bad elements on the boundary. Therefore, the number of vertices with small Jacobian values are large.

Neghip Silicium

Marschnerlobb Lobster

Fuel Aneurysm Figure 43 Scaled Jacobian Distribution at All Vertices for Interval Volume [73.5, 255.5] 58

5.4 Mesh Quality Check on Real Data for Interval Volume [흈ퟎ, 흈ퟏ]

5.4.1 Mesh Quality at Internal Vertices

In Section 5.3, we reported the mesh quality for interval volume [휎0, +∞]. This choice simplified the meshing process since everything above isovalue 휎0 is included in the interval volume. However, a more general problem is to mesh an interval volume extracted from range [휎0, 휎1] where 휎1 is not +∞.

In this section, we generate meshes from interval volume range [29.5, 48.5]. The distribution of the scaled Jacobian at internal vertices is plotted in Figure 44. These results are worse than the results for interval volume range [73.5, 255] in Figure 42.

There are several thousand vertices whose scaled Jacobian values are below the acceptable range.

Neghip Silicium Marschnerlobb

Lobster Fuel Aneurysm

Figure 44 Scaled Jacobian Distribution of all Datasets at Internal Vertices for Interval Volume Range [29.5, 48.5]

59

5.4.2 Mesh Quality at All Vertices

The scaled Jacobian distributions at all vertices for interval volume range [29.5, 48.5] are reported in Figure 45. Compare to the results at internal vertices, there are more small

Jacobian values at all vertices. Improving the mesh quality for an interval volume range

[휎0, 휎1] remains a problem for future work.

Neghip Silicium Marschnerlobb

Lobster Fuel Aneurysm

Figure 45 Scaled Jacobian Distribution of all Datasets at All Vertices for Interval Volume Range [29.5, 48.5]

60

5.5 Mesh Quality Improvement

5.5.1 Short Edge Length Improvement

In the experimental results discussed above, DIVol generated hexahedral meshes with good shape, Jacobian and scaled Jacobian metrics at internal vertices. However, we found that there are significant amount of short edge and even zero length edges on the mesh boundary (Figure 46).

To reduce the number of elements with short edge length, we apply Laplacian smoothing on entire mesh. The edge length distributions with and without Laplacian smoothing for Neghip, Silicium, Marschnerlobb, Lobster, Fuel and Aneurysm are shown in Figure 47.

The initial Neghip and Silicium meshes have about 10000 zero length edges. After performing the Laplacian smoothing, the total number of zero length edges is reduced to

100. For Fuel, the number of zero length edges is reduced from 2000 to 0. For

Marschnerlobb, the number of zero length edges is reduced from 10000 to 5000. For

Lobster and Aneurysm, this number is reduced from 100000 to around 10000. Laplacian smoothing helps improving the short edge lengths significantly.

Figure 46 Edge Length Distribution of Neghip with Isovalues [29.5, 48.5]

61

Neghip Neghip with Laplacian Smoothing

Silicium Silicium with Laplacian Smoothing

Marschnerlobb Marschnerlobb with Laplacian Smoothing

Figure 47 Edge Length Distributions of all Datasets with Isovalues [29.5, 48.5]

62

Lobster Lobster with Laplacian Smoothing

Fuel Fuel with Laplacian Smoothing

Aneurysm Aneurysm with Laplacian Smoothing

63

5.5.2 Scaled Jacobian Improvement for All Vertices

In Section 5.3.2, we reported scaled Jacobian at all vertices for interval volume range [73.5, 255.5]. The optimization smoothing method is applied to improve the mesh quality measured by the scaled Jacobian. The smoothing results are shown in Figure 48.

The left side shows the original scaled Jacobian distribution, and the right side shows the scaled Jacobian distribution after optimization smoothing. The scaled Jacobian before and after smoothing are almost the same. Our optimization smoothing method does not significantly improve the mesh quality as measured by the scaled Jacobian metric.

Further investigation is needed to improve or change the method.

Neghip Neghip with Optimization Smoothing

Silicium Silicium with Optimization Smoothing

Figure 48 Optimization Smoothing for Scaled Jacobian at All Vertices for Interval Volume [73.5, 255.5]

64

Marschnerlobb Marschnerlobb with Optimization Smoothing

Lobster Lobster with Optimization Smoothing

Fuel Fuel with Optimization Smoothing

Aneurysm Aneurysm with Optimization Smoothing

65

5.5.3 Scaled Jacobian Improvement for Range [흈ퟎ, 흈ퟏ]

For scaled Jacobian measured at internal vertices, when we set the upper isovalue 휎1 with a value less than 255.5, we observed a significant amount of elements with small or even negative scaled Jacobians as discussed in Section 5.4. Figure 49 shows the scaled

Jacobian distribution of Neghip output mesh at internal vertices from the interval volume

[29.5, 48.5]. There are about 100 negative scaled Jacobian values and about 10000 scaled

Jacobian valued below 0.5.

To address this problem, we apply optimization smoothing to improve the scaled

Jacobian metric. Figure 50 shows the scaled Jacobian distributions of all datasets with and without optimization smoothing at internal vertices from the interval volume [29.5,

48.5]. The results show that optimization smoothing helps eliminate several negative scaled Jacobian values. However, the overall scaled Jacobian distributions are not changed significantly. Several thousand scaled Jacobian values are still below the recommended value 0.5. This remains a research problem for future work.

Figure 49 Scaled Jacobian Distribution of Neghip at Internal Vertices in [29.5, 48.5]

66

Neghip Neghip with Optimization Smoothing

Silicium Silicium with Optimization Smoothing

Marschnerlobb Marschnerlobb with Optimization Smoothing

Figure 50 Scaled Jacobian Distributions of all Datasets with Isovalues [29.5, 48.5]

67

Lobster Lobster with Optimization Smoothing

Fuel Fuel with Optimization Smoothing

Aneurysm Aneurysm with Optimization Smoothing

68

5.6 Mesh Quality Comparison with Bolt 2.0

We used commercial software Bolt 2.0 (developed by Sandia National Laboratories) to construct all hexahedral meshes using the same datasets as discussed in the last section.

Isovalues were chosen to be 휎0 = 73.5 and 휎1 = 255.5 for both DIVol and Bolt 2.0. Mesh generation in Bolt 2.0 is almost automatic, and the only parameter users can change is the minimum element size. To compare with DIVol, we change the minimum element size parameter to control the total number of output mesh elements. The total number of output mesh elements of Bolt 2.0 are controlled to be similar for both DIVol and Bolt 2.0 such that the results are comparable. The output meshes of Bolt 2.0 are shown in Figure

51.

Neghip Silicium Marschnerlobb

Lobster Fuel Aneurysm

Figure 51 Hexahedral Mesh of Generated by Bolt 2.0 with isovalues [73.5, 255.5]

69

Table 2 Comparison of CPU Time between DIVol and Bolt 2.0 DIVol with DIVol Bolt 2.0 Laplacian Smoothing Neghip 2.14 s 2.21 s 4.93 s Silicium 2.25 s 2.33 s 7.58 s Marschnerlobb 2.36 s 2.42 s 9.12 s Lobster 6.16 s 6.73 s 26.21 s Fuel 1.84 s 1.86 s 1.17 s Aneurysm 7.14 s 7.60 s 9.28 s

First, the running time of mesh generation for each dataset is compared as shown in

Table 2. For most datasets, DIVol takes less running time compared to Bolt 2.0. Only for the Fuel dataset does Bolt 2.0 finish meshing faster than DIVol. The running time of

DIVol with Laplacian smoothing is also reported. The Laplacian smoothing takes less than one second for each dataset.

All of Bolt 2.0 output meshes have very small scaled Jacobian and shape values.

Taking Neghip as an example, the minimum scaled Jacobian at internal vertices is

0.00656851, and the minimum shape at internal vertices is 0.0338934. In contrast, the minimum scaled Jacobian value in the meshes produced by DIVol is 0.5476 and the minimum shape at internal vertices is 0.6302 as shown in Table 5.1. A more comprehensive comparison of all scaled Jacobian value distributions is listed in the following section for all the image data.

(1) Neghip

A comparison of all scaled Jacobian value distributions of DIVol and Bolt 2.0 are shown in Figure 52. The output mesh of DIVol contains 159249 hexahedra and the output mesh of Bolt 2.0 contains 156848 hexahedra. The x-axis is the scaled Jacobian value, and the y-axis is the number of vertices at each scaled Jacobian value. All the 70 scaled Jacobian values in DIVol results fall in the acceptable range. In contrast, Bolt 2.0 results have several thousand of scaled Jacobian values below the minimum requirement.

DIVol (159249 Hexahedra) Bolt 2.0 (156848 Hexahedra)

Figure 52 Comparison of Neghip Scaled Jacobian of DIVol and Bolt at Internal Vertices

Bolt 2.0 (119429 Hexahedra) Bolt 2.0 (156848 Hexahedra)

Bolt 2.0 (202371 Hexahedra) Bolt 2.0 (319969 Hexahedra)

Figure 53 Scaled Jacobian of Neghip by Bolt 2.0 with Various Number of Hexahedra

When changing the number of Bolt 2.0 output hexahedra, the results remain the same. Figure 53 shows the distribution of the scaled Jacobian by Bolt 2.0 with 119429, 71

156848, 202371 and 319969 output hexahedra respectively. Increasing the total number of hexahedra does not seem to help to improve the scaled Jacobian values. It shows that

Bolt 2.0 cannot completely eliminate bad scaled Jacobian values, but DIVol provide good quality mesh at internal vertices.

(2) Silicium, Marschnerlobb, Lobster, Fuel, Aneurysm

Comparison of scaled Jacobian distributions of all other image data between DIVol and Bolt 2.0 are shown in Figure 54 to Figure 58. Similar to the results of Neghip, DIVol output meshes have better scaled Jacobian values over Bolt 2.0.

DIVol (217929 Hexahedra) Bolt 2.0 (215108 Hexahedra)

Figure 54 Comparison of Silicium Scaled Jacobian of DIVol and Bolt 2.0

DIVol (359985 Hexahedra) Bolt 2.0 (366090 Hexahedra)

Figure 55 Comparison of Marschnerlobb Scaled Jacobian of DIVol and Bolt 2.0

72

DIVol (1351898 Hexahedra) Bolt 2.0 (965802 Hexahedra)

Figure 56 Comparison of Lobster Scaled Jacobian of DIVol and Bolt 2.0

DIVol (19094 Hexahedra) Bolt 2.0 (30124 Hexahedra)

Figure 57 Comparison of Fuel Scaled Jacobian of DIVol and Bolt 2.0

DIVol (632497 Hexahedra) Bolt 2.0 (163926 Hexahedra)

Figure 58 Comparison of Aneurysm Scaled Jacobian of DIVol and Bolt 2.0

73

Table 3 shows a comparison of scaled Jacobian at internal vertices. The total number and percentage of vertices with acceptable normalized scaled Jacobian and shape metrics are included. Table 4 shows the comparison of scaled Jacobian at all vertices. At internal vertices, DIVol generate meshes with almost 100% acceptable scaled Jacobian values for all image data. Only Lobster and Aneurysm output mesh contain couple vertices whose scaled Jacobian are below 0.5. Even though they are out of the acceptable range, the percentage of these vertices is below 0.1%. On the other hand, most of the meshes generated by Bolt 2.0 have 10% to 20% vertices with bad scaled Jacobian values.

Changing the element size or mesh resolution in Bolt 2.0 would not help improve these quality metrics.

For the comparison of scaled Jacobian at all vertices, DIVol produces meshes with average of 80% acceptable results, while Bolt 2.0 produces meshes with average of 90% acceptable results. Bolt 2.0 creates a layer of hexahedra which match the boundary leading to good boundary meshes. The problem hexahedra lie at the interface of the boundary hexahedra and the internal hexahedra. In addition, Bolt 2.0 applies a smoothing algorithm to improve the mesh quality at the expense of changing the boundary shape.

This gives greater freedom to create good boundary mesh.

Table 5 and Table 6 shows the comparison results of shape at internal vertices and at all vertices respectively. Similarly, DIVol produces better results at internal vertices, but worse results at all vertices. Methods to improve boundary mesh quality will be the future research topic for DIVol.

74

Table 3 Comparison of Normalized Scaled Jacobian of DIVol and Bolt 2.0 at Internal Vertices

DIVol Bolt 2.0 Percentage Percentage Number of Number of Dataset of of Number of Scaled Number of Scaled [휎 , 휎 Scaled Scaled 0 1 Hexahedra Jacobian Hexahedra Jacobian Jacobian in Jacobian in below 0.5 below 0.5 [0.5, 1] [0.5, 1] Neghip 159249 0 100.00% 156848 8865 93.50% [73.5, 255.5] Silicium 217929 0 100.00% 215108 6467 96.50% [73.5, 255.5] Marschnerlobb 359985 0 100.00% 366090 48940 84.50% [73.5, 255.5] Lobster 1351898 10 99.90% 965802 962 99.60% [31.5, 255.5] Fuel 19094 0 100.00% 30124 2821 88.70% [73.5, 255.5] Aneurysm 632497 2 99.90% 163926 23198 82.30% [73.5, 255.5]

Table 4 Comparison of Normalized Scaled Jacobian of DIVol and Bolt 2.0 at All Vertices

DIVol Bolt 2.0 Percentage Percentage Number of Number of Dataset of of Number of Scaled Number of Scaled [휎 , 휎 Scaled Scaled 0 1 Hexahedra Jacobian Hexahedra Jacobian Jacobian in Jacobian in below 0.5 below 0.5 [0.5, 1] [0.5, 1] Neghip 190544 29931 81.2% 156848 13877 91.2% [73.5, ∞] Silicium 262132 41252 81.1% 215108 7941 96.3% [73.5, ∞] Marschnerlobb 397828 13945 96.1% 366090 62840 82.8% [73.5, ∞] Lobster 1658252 267053 80.2% 965802 31211 96.8% [31.5, ∞] Fuel 24490 5030 73.7% 30124 3224 89.3% [73.5, ∞] Aneurysm 865754 210219 66.8% 163926 32866 80.0% [73.5, ∞]

75

Table 5 Comparison of Shape of DIVol and Bolt 2.0 at Internal Vertices

DIVol Bolt 2.0

Dataset Number Percentage Number Percentage Number of Number of [휎 , 휎 of Shape of Shape in of Shape of Shape in 0 1 Hexahedra Hexahedra below 0.3 [0.3, 1] below 0.3 [0.3, 1] Neghip 138206 0 100% 135711 617 99.5% [73.5, ∞] Silicium 182550 0 100% 185733 1814 99.0% [73.5, ∞] Marschnerlobb 331008 0 100% 316536 16721 94.7% [73.5, ∞] Lobster 1136636 0 100% 270936 210 99.9% [31.5, ∞] Fuel 15420 0 100% 24932 295 98.8% [73.5, ∞] Aneurysm 462404 0 100% 130824 10619 91.9% [73.5, ∞]

Table 6 Comparison of Shape of DIVol and Bolt 2.0 at All Vertices

DIVol Bolt 2.0

Dataset Number Percentage Number Percentage Number of Number of [휎 , 휎 of Shape of Shape in of Shape of Shape in 0 1 Hexahedra Hexahedra below 0.3 [0.3, 1] below 0.3 [0.3, 1] Neghip 163506 20031 87.7% 156848 930 99.4% [73.5, ∞] Silicium 222161 30455 86.3% 215108 2563 98.8% [73.5, ∞] Marschnerlobb 363921 12517 96.6% 366090 24750 93.2% [73.5, ∞] Lobster 1389181 176801 87.3% 402637 4885 98.8% [31.5, ∞] Fuel 19725 3329 83.1% 30124 434 98.6% [73.5, ∞] Aneurysm 640293 111448 82.6% 163926 14808 91.0% [73.5, ∞]

76

Chapter 6 Conclusions

This thesis characterizes the problems associated with mesh generation from industrial computed tomography data and describes a new method for constructing high quality all hexahedral mesh from these data.

This thesis presents algorithm DIVol, describes methods for constructing hexahedral mesh directly from the volumetric data, and introduces methods and rules for avoiding non-manifold meshes. Methods for measuring and improving the mesh quality are also discussed.

The DIVol algorithm constructs the hexahedral mesh by first generating a lookup table and then retrieving the dual hexahedra and vertices for each grid cube. The lookup table was built by mapping the 3D interval volume to 4D.

The manifold issue was addressed by developing several rules. During the process of constructing lookup table, the flexibility of choosing either positive connected components or negative connected components allows user to avoid non-manifold for certain cases. The subdivision rules were developed to prevent ambiguous facets and therefore avoid non-manifold meshes. A special case of non-manifold vertex is also considered and addressed.

The mesh quality metrics and methods for improving the mesh quality were discussed. As shown in the experimental results, the DIVol algorithm generates quality internal hexahedral mesh elements naturally. DIVol does have problems generating

77 quality boundary elements. For meshes whose quality metrics lie below the minimum requirement, mesh smoothing methods were implemented for improving the mesh quality.

Laplacian smoothing and optimization smoothing are two primary quality improvement methods used in DIVol. The experiments on real image data produces good quality hexahedral meshes. Compare to commercial software, DIVol generates hexahedral mesh with higher quality regarding the Jacobian and shape metrics.

While DIVol shows promising results, there remains several problems for future research. The reported mesh quality metrics were measured at internal vertices. We observed that there are vertices on the boundary where Jacobian values are negative.

Local refinement or reshaping may be needed for improve the mesh quality on the boundary. Also, the smoothing methods can help improve the mesh quality to some extent, but, for regions where bad elements are close to each other, improving the mesh quality of one element may worsen the quality of neighboring elements. For regions where the dual interval volume upper boundary is close to the lower boundary, there is only one or two layers of elements in that region. There is not enough room for smoothing methods to change the element shape. Expanding or remeshing the region may be needed to improve the mesh quality. Currently we are using a subdivision method to avoid non-manifold. However, subdivision is performed for the entire domain even for regions where subdivision is not needed. This takes extra computation time and creates unnecessary elements. It would be nice to avoid such subdivisions while ensuring a manifold mesh. Multi-resolution subdivisions may be another way to avoid these issues.

78

Bibliography

Benzley, S. E., Perry, E., Merkley, K., Clark, B., & Sjaardama, G. (1995). A comparison

of all hexagonal and all tetrahedral finite element meshes for elastic and elasto-

plastic analysis. In Proceedings, 4th International Meshing Roundtable (Vol. 17, pp.

179–191).

Bhattacharya, A., & Wenger, R. (2013). Constructing isosurfaces with sharp edges and

corners using cube merging. In Forum (Vol. 32, pp. 11–20).

Blacker, T. D., & Meyers, R. J. (1993). Seams and wedges in plastering: a 3-D

hexahedral mesh generation algorithm. Engineering with Computers, 9(2), 83–93.

Botella, A., Lévy, B., & Caumon, G. (2016). Indirect unstructured hex-dominant mesh

generation using tetrahedra recombination. Computational Geosciences, 20(3), 437–

451.

BussLER, M. L., & Ramesh, A. (1993). The eight-node hexahedral element in FEA of

part designs. Foundry Management & Technology, 121(11), 26–28.

Canann, S. A. (1991). Plastering and optismoothing: new approaches to automated 3D

hexahedral mesh generation and mesh smoothing. Ph. D. Dissertation, Brigham

Young University.

Cheng, S.-W., & Dey, T. K. (2003). Quality meshing with weighted Delaunay refinement.

SIAM Journal on Computing, 33(1), 69–93.

79

Chew, L. P. (1997). Guaranteed-quality delaunay meshing in 3d (short version). In

Proceedings of the thirteenth annual symposium on Computational geometry (pp.

391–393).

Cifuentes, A. O., & Kalbag, A. (1992). A performance study of tetrahedral and

hexahedral elements in 3-D finite element structural analysis. Finite Elements in

Analysis and Design, 12(3–4), 313–318. de L’isle, E. B., & George, P. L. (1995). Optimization of tetrahedral meshes. In Modeling,

Mesh Generation, and Adaptive Numerical Methods for Partial Differential

Equations (pp. 97–127). Springer.

Eppstein, D. (1999). Linear complexity hexahedral mesh generation. Computational

Geometry, 12(1–2), 3–16.

Field, D. A. (1988). Laplacian smoothing and Delaunay triangulations. International

Journal for Numerical Methods in Biomedical Engineering, 4(6), 709–712.

Freitag, L. A. (1997). On combining Laplacian and optimization-based mesh smoothing

techniques. ASME Applied Mechanics Division-Publications-Amd, 220, 37–44.

Frey, P. J., Borouchaki, H., & George, P. L. (1996). Delaunay tetrahedralization using an

advancing-front approach. In 5th International Meshing Roundtable (pp. 31–48).

George, P.-L., & Borouchaki, H. (1998). Delaunay triangulation and meshing.

Gibson, S. F. F. (1998). Using distance maps for accurate surface representation in

sampled volumes. In Volume Visualization, 1998. IEEE Symposium on (pp. 23–30).

Hansbo, P. (1995). Generalized Laplacian smoothing of unstructured grids. International

Journal for Numerical Methods in Biomedical Engineering, 11(5), 455–464.

80

Ho, C., Wu, F.-C., Chen, B.-Y., Chuang, Y.-Y., Ouhyoung, M., & others. (2005). Cubical

marching squares: Adaptive feature preserving surface extraction from volume data.

In Computer graphics forum (Vol. 24, pp. 537–545).

Huang, L., Zhao, G., Wang, Z., & Zhang, X. (2016). Adaptive hexahedral mesh

generation and regeneration using an improved grid-based method. Advances in

Engineering Software, 102, 49–70.

Ju, T., Losasso, F., Schaefer, S., & Warren, J. (2002). Dual contouring of hermite data. In

ACM transactions on graphics (TOG) (Vol. 21, pp. 339–346).

Knupp, P. M. (2001). Algebraic mesh quality metrics. SIAM Journal on Scientific

Computing, 23(1), 193–218.

Kobbelt, L. P., Botsch, M., Schwanecke, U., & Seidel, H.-P. (2001). Feature sensitive

surface extraction from volume data. In Proceedings of the 28th annual conference

on Computer graphics and interactive techniques (pp. 57–66).

Lo, S. H. (1989). Generating quadrilateral elements on plane and over curved surfaces.

Computers & Structures, 31(3), 421–426.

Lohner, R. (1988). Three-dimensional grid generation by the advancing front method. Int.

J. Numer. Meths. Fluids., 8, 1135–1149.

Lorensen, W. E., & Cline, H. E. (1987). Marching cubes: A high resolution 3D surface

construction algorithm. In ACM siggraph computer graphics (Vol. 21, pp. 163–169).

Meyer, M., Desbrun, M., Schröder, P., & Barr, A. H. (2003). Discrete differential-

geometry operators for triangulated 2-manifolds. In Visualization and mathematics

III (pp. 35–57). Springer.

81

Nielson, G. M. (2004). Radial hermite operators for scattered point cloud data with

normal vectors and applications to implicitizing surfaces for

generalized CSG operations and smoothing. In Visualization, 2004. IEEE (pp. 203–

210).

Nielson, G. M., & Hamann, B. (1990). Techniques for the interactive visualization of

volumetric data. In Visualization, 1990. Visualization’90., Proceedings of the First

IEEE Conference on (pp. 45–50).

Nielson, G. M., & Hamann, B. (1991). The asymptotic decider: resolving the ambiguity

in marching cubes. In Proceedings of the 2nd conference on Visualization’91 (pp.

83–91).

Owen, S. J. (1998). A survey of unstructured mesh generation technology. In IMR (pp.

239–267).

Price, M. A., & Armstrong, C. G. (1997). Hexahedral mesh generation by medial surface

subdivision: Part II. Solids with flat and concave edges. International Journal for

Numerical Methods in Engineering, 40(1), 111–136.

Price, M. A., Armstrong, C. G., & Sabin, M. A. (1995). Hexahedral mesh generation by

medial surface subdivision: Part I. Solids with convex edges. International Journal

for Numerical Methods in Engineering, 38(19), 3335–3359.

Schaefer, S., & Warren, J. (2004). Dual marching cubes: Primal contouring of dual grids.

In Computer Graphics and Applications, 2004. PG 2004. Proceedings. 12th Pacific

Conference on (pp. 70–76).

82

Schneiders, R. (1996). A grid-based algorithm for the generation of hexahedral element

meshes. Engineering with Computers, 12(3–4), 168–177.

Schneiders, R. (1997). An algorithm for the generation of hexahedral element meshes

based on an octree technique. In 6th International Meshing Roundtable (pp. 195–

196).

Seveno, E., & others. (1997). Towards an adaptive advancing front method. In 6th

International Meshing Roundtable (pp. 349–362).

Shephard, M. S., & Georges, M. K. (1991). Automatic three-dimensional mesh

generation by the finite octree technique. International Journal for Numerical

Methods in Engineering, 32(4), 709–749.

Shewchuk, J. (2002). What is a good linear finite element? interpolation, conditioning,

anisotropy, and quality measures (preprint). University of California at Berkeley, 73,

137.

Shewchuk, J. R. (1998). Tetrahedral mesh generation by Delaunay refinement. In

Proceedings of the fourteenth annual symposium on Computational geometry (pp.

86–95).

Shewchuk, J. R. (2002). Constrained Delaunay Tetrahedralizations and Provably Good

Boundary Recovery. In IMR (pp. 193–204).

Stimpson, C. J., Ernst, C. D., Knupp, P., Pébay, P. P., & Thompson, D. (2007). The

verdict geometric quality library. Sandia National Laboratories, SAND2007-1751.

83

Tautges, T. J., Blacker, T., & Mitchell, S. A. (1996). The whisker weaving algorithm: A

connectivity-based method for constructing all-hexahedral finite element meshes.

International Journal for Numerical Methods in Engineering, 39(19), 3327–3349.

Teng, S.-H., & Wong, C. W. (2000). Unstructured mesh generation: Theory, practice, and

perspectives. International Journal of Computational Geometry & Applications,

10(03), 227–266.

Varadhan, G., Krishnan, S., Kim, Y. J., & Manocha, D. (2003). Feature-sensitive

subdivision and isosurface reconstruction. In Visualization, 2003. VIS 2003. IEEE

(pp. 99–106).

Varadhan, G., Krishnan, S., Zhang, L., & Manocha, D. (2006). Reliable implicit surface

polygonization using visibility mapping. In Proceedings of the fourth Eurographics

symposium on (pp. 211–221).

Weingarten, V. I. (1994). The controversy over hex or tet meshing. Machine Design,

66(8), 74–76.

Wenger, R. (2013). Isosurfaces: geometry, topology, and algorithms. CRC Press.

Xu, G., Pan, Q., Bajaj, C., & others. (2003). Discrete surface modeling using geometric

flows. Computer Science Department, University of Texas at Austin.

Zhang, H., & Zhao, G. (2007). Adaptive hexahedral mesh generation based on local

domain curvature and thickness using a modified grid-based method. Finite

Elements in Analysis and Design, 43(9), 691–704.

84

Zhang, N., Hong, W., & Kaufman, A. (2004). Dual contouring with topology-preserving

simplification using enhanced cell representation. In Proceedings of the conference

on Visualization’04 (pp. 505–512).

Zhang, Y., & Bajaj, C. (2006). Adaptive and quality quadrilateral/hexahedral meshing

from volumetric data. Computer Methods in Applied Mechanics and Engineering,

195(9–12), 942–960.

85

Appendix A.

Table 7 Mesh Quality Tests of Silicium at Internal Vertices Number of Minimum Minimum 휎 휎 0 1 Hexahedra Scaled Jacobian Shape 49.5 255.5 282760 0.5892 0.6288 55.5 255.5 264670 0.6054 0.5980 61.5 255.5 247818 0.5747 0.5707 67.5 255.5 232571 0.5712 0.5734 73.5 255.5 217929 0.5643 0.6419 79.5 255.5 204520 0.5634 0.6164 85.5 255.5 191869 0.5617 0.6233 91.5 255.5 179347 0.5764 0.6243 97.5 255.5 167094 0.5822 0.6082 103.5 255.5 154932 0.5796 0.5775 109.5 255.5 142900 0.5560 0.5803 115.5 255.5 129982 0.5765 0.5778 121.5 255.5 116598 0.5751 0.5975 127.5 255.5 101269 0.5876 0.5940 133.5 255.5 86700 0.6138 0.5750 139.5 255.5 73489 0.5958 0.6104 145.5 255.5 61646 0.6129 0.6105

86

Table 8 Mesh Quality Tests of Marschnerlobb at Internal Vertices Number of Minimum Minimum 휎 휎 0 1 Hexahedra Scaled Jacobian Shape 49.5 255.5 417089 0.5770 0.6474 55.5 255.5 399548 0.5435 0.6660 61.5 255.5 385110 0.5473 0.6491 67.5 255.5 371967 0.5191 0.6455 73.5 255.5 359985 0.5596 0.6762 79.5 255.5 348103 0.5995 0.6707 85.5 255.5 337099 0.5060 0.6326 91.5 255.5 326290 0.6158 0.6748 97.5 255.5 315662 0.5083 0.6346 103.5 255.5 305341 0.5474 0.6685 109.5 255.5 295227 0.5168 0.6434 115.5 255.5 285241 0.5506 0.6709 121.5 255.5 275254 0.5168 0.6434 127.5 255.5 265409 0.5506 0.6709 133.5 255.5 255337 0.5168 0.6434 139.5 255.5 245503 0.5404 0.6490 145.5 255.5 235350 0.5898 0.6929

87

Table 9 Mesh Quality Tests of Lobster at Internal Vertices Minimum Number of Minimum 휎 휎 Scaled 0 1 Hexahedra Shape Jacobian 49.5 255.5 1888159 0.4873 0.5624 55.5 255.5 1737327 0.3652 0.5090 61.5 255.5 1597375 0.4514 0.5599 67.5 255.5 1468891 0.5060 0.5645 73.5 255.5 1351898 0.4912 0.5322 79.5 255.5 1247333 0.5190 0.5727 85.5 255.5 1153317 0.4868 0.5445 91.5 255.5 1067818 0.4550 0.5724 97.5 255.5 990640 0.5154 0.5757 103.5 255.5 917918 0.4966 0.5571 109.5 255.5 849715 0.5254 0.5781 115.5 255.5 784072 0.4701 0.5661 121.5 255.5 718388 0.5022 0.5722 127.5 255.5 648316 0.4787 0.5629 133.5 255.5 521799 0.5251 0.5972 139.5 255.5 334669 0.5373 0.5935 145.5 255.5 139850 0.4625 0.5912

88

Table 10 Mesh Quality Tests of Fuel at Internal Vertices Minimum Number of Minimum 휎 휎 Scaled 0 1 Hexahedra Shape Jacobian 49.5 255.5 26627 0.5600 0.6735 55.5 255.5 24457 0.5276 0.6491 61.5 255.5 22587 0.5866 0.6795 67.5 255.5 20803 0.6219 0.6582 73.5 255.5 19094 0.5913 0.7041 79.5 255.5 17468 0.5926 0.7053 85.5 255.5 15892 0.6178 0.6016 91.5 255.5 14493 0.6302 0.7041 97.5 255.5 13455 0.6370 0.6982 103.5 255.5 12291 0.5776 0.6935 109.5 255.5 11293 0.6655 0.7065 115.5 255.5 10249 0.6081 0.7166 121.5 255.5 9445 0.6104 0.7182 127.5 255.5 8544 0.6122 0.7208 133.5 255.5 7864 0.5770 0.6927 139.5 255.5 7159 0.7400 0.7305 145.5 255.5 6606 0.5910 0.7039

89

Table 11 Mesh Quality Tests of Aneurysm at Internal Vertices Minimum Number of Minimum 휎 휎 Scaled 0 1 Hexahedra Shape Jacobian 49.5 255.5 745305 0.4189 0.5587 55.5 255.5 712769 0.4963 0.5784 61.5 255.5 683292 0.4699 0.5957 67.5 255.5 656707 0.4937 0.5813 73.5 255.5 632497 0.4637 0.5675 79.5 255.5 610322 0.4336 0.5662 85.5 255.5 590001 0.5007 0.5491 91.5 255.5 570628 0.4560 0.5784 97.5 255.5 552456 0.5238 0.5652 103.5 255.5 535097 0.5323 0.5763 109.5 255.5 518702 0.4719 0.5688 115.5 255.5 503102 0.5549 0.5536 121.5 255.5 488182 0.5309 0.5514 127.5 255.5 474065 0.5343 0.5564 133.5 255.5 456969 0.5565 0.5797 139.5 255.5 443938 0.5372 0.5705 145.5 255.5 431258 0.4756 0.5631

90